Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: intel-cht-wc: Report RID_A for ACA adapters

Make cht_wc_extcon_get_id() report RID_A for ACA adapters, instead of
reporting ID_FLOAT.

According to the spec. we should read the USB-ID pin ADC value
to determine the resistance of the used pull-down resister and
then return RID_A / RID_B / RID_C based on this. But all "Accessory
Charger Adapter"s (ACAs) which users can actually buy always use
a combination of a charging port with one or more USB-A ports, so
they should always use a resistor indicating RID_A. But the spec
is hard to read / badly-worded so some of them actually indicate
they are a RID_B ACA even though they clearly are a RID_A ACA.

To workaround this simply always return INTEL_USB_RID_A, which
matches all the ACAs which users can actually buy.

Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Hans de Goede and committed by
Sebastian Reichel
21356ac1 66e31186

+13 -5
+13 -5
drivers/extcon/extcon-intel-cht-wc.c
··· 121 121 return INTEL_USB_ID_GND; 122 122 case CHT_WC_PWRSRC_RID_FLOAT: 123 123 return INTEL_USB_ID_FLOAT; 124 + /* 125 + * According to the spec. we should read the USB-ID pin ADC value here 126 + * to determine the resistance of the used pull-down resister and then 127 + * return RID_A / RID_B / RID_C based on this. But all "Accessory 128 + * Charger Adapter"s (ACAs) which users can actually buy always use 129 + * a combination of a charging port with one or more USB-A ports, so 130 + * they should always use a resistor indicating RID_A. But the spec 131 + * is hard to read / badly-worded so some of them actually indicate 132 + * they are a RID_B ACA evnen though they clearly are a RID_A ACA. 133 + * To workaround this simply always return INTEL_USB_RID_A, which 134 + * matches all the ACAs which users can actually buy. 135 + */ 124 136 case CHT_WC_PWRSRC_RID_ACA: 137 + return INTEL_USB_RID_A; 125 138 default: 126 - /* 127 - * Once we have IIO support for the GPADC we should read 128 - * the USBID GPADC channel here and determine ACA role 129 - * based on that. 130 - */ 131 139 return INTEL_USB_ID_FLOAT; 132 140 } 133 141 }