RE: [PATCH v4 1/2] usb: phy: show USB charger type for user
From: Peter Chen <hidden>
Date: 2020-01-30 14:05:21
quoted
Signed-off-by: Peter Chen <redacted> --- Changes for v4: - No changes. drivers/usb/phy/phy.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index0277f62739a2..ad2554630889 100644--- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c@@ -34,6 +34,14 @@ struct phy_devm { struct notifier_block *nb; }; +static const char *const usb_chger_type[] = { + [UNKNOWN_TYPE] ="USB_CHARGER_UNKNOWN_TYPE",quoted
+ [SDP_TYPE] = "USB_CHARGER_SDP_TYPE", + [CDP_TYPE] = "USB_CHARGER_CDP_TYPE", + [DCP_TYPE] = "USB_CHARGER_DCP_TYPE", + [ACA_TYPE] = "USB_CHARGER_ACA_TYPE", +};As these are exported values (CDP_TYPE and friends), they really need to have explicit values on the .h file, otherwise it might not work properly on all systems.
Sorry, what do you mean? These values are defined at include/uapi/linux/usb/charger.h Peter