mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
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>
This commit is contained in:
parent
66e31186cd
commit
21356ac14e
1 changed files with 13 additions and 5 deletions
|
@ -121,13 +121,21 @@ static int cht_wc_extcon_get_id(struct cht_wc_extcon_data *ext, int pwrsrc_sts)
|
||||||
return INTEL_USB_ID_GND;
|
return INTEL_USB_ID_GND;
|
||||||
case CHT_WC_PWRSRC_RID_FLOAT:
|
case CHT_WC_PWRSRC_RID_FLOAT:
|
||||||
return INTEL_USB_ID_FLOAT;
|
return INTEL_USB_ID_FLOAT;
|
||||||
case CHT_WC_PWRSRC_RID_ACA:
|
|
||||||
default:
|
|
||||||
/*
|
/*
|
||||||
* Once we have IIO support for the GPADC we should read
|
* According to the spec. we should read the USB-ID pin ADC value here
|
||||||
* the USBID GPADC channel here and determine ACA role
|
* to determine the resistance of the used pull-down resister and then
|
||||||
* based on that.
|
* 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 evnen 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.
|
||||||
*/
|
*/
|
||||||
|
case CHT_WC_PWRSRC_RID_ACA:
|
||||||
|
return INTEL_USB_RID_A;
|
||||||
|
default:
|
||||||
return INTEL_USB_ID_FLOAT;
|
return INTEL_USB_ID_FLOAT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue