Skip to content

support ppps usb control - #33

Merged
lumag merged 2 commits into
linux-msm:masterfrom
kcxt:ppps
Sep 28, 2023
Merged

lumag merged 2 commits into
linux-msm:masterfrom
kcxt:ppps

Conversation

@kcxt

@kcxt kcxt commented Sep 24, 2023

Copy link
Copy Markdown
Member

Since Linux kernel 6.0, PPPS capable USB hubs expose a simple sysfs attribute for power control. Allow overwriting the usb control callback to use PPPS hub control instead.

This really simply allows for combining a PPPS hub with some other control board like a micro controller implementing the qcomlt_debug_board interface.

Comment thread device_parser.c Resolved
Comment thread ppps.c
#include "device.h"

#define PPPS_BASE_PATH "/sys/bus/usb/devices/"
#define PPPS_BASE_PATH_LEN strlen(PPPS_BASE_PATH)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that uhubctl toggles both USB 2 and USB 3 hubs to fully toggle the power. Let me check if toggling just one of them is enough for e.g. UUGEAR hub.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my setup I just always disable the usb 3.0 part, the oneplus devices don't support superspeed anyway so it was just easier. imo this can be extended if someone needs it...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting rid of uhubctl would be nice. I'll look into this after merging this PR. Fortunately the hub has LED showing whether vbus is enabled or not.

Comment thread ppps.c Resolved
Comment thread ppps.c Resolved
@kcxt
kcxt force-pushed the ppps branch 2 times, most recently from fa17d6f to 0b841a3 Compare September 28, 2023 09:49
Comment thread ppps.c Resolved
@kcxt
kcxt force-pushed the ppps branch 3 times, most recently from 2d8939f to d526cf9 Compare September 28, 2023 10:06
Since Linux kernel 6.0, PPPS capable USB hubs expose a simple sysfs
attribute for power control. Allow overwriting the usb control callback
to use PPPS hub control instead.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Musl requires that this header be explicitly included for O_CREAT,
O_CLOEXEC, etc.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
@kcxt
kcxt force-pushed the ppps branch 2 times, most recently from 17df128 to d360973 Compare September 28, 2023 10:36
@lumag
lumag merged commit 363bac3 into linux-msm:master Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants