BC1.2 charger detection
Not great code-wise, but it appears to work. If anyone knows a way to make usb-phy use tps65982's extcon/power-supply even though tps65982 references dwc3 (and by extension usb-phy) in its connector
node without causing circular dependencies, I'd be glad to learn it ;)
The biggest issue when it comes to cleaning it up and rewriting properly is IMO getting dwc3 to signal set_mode even though the mode didn't change, as otherwise the phy can't see plug events cause it's already in device mode when unplugged.
I guess the better way would be to have phy-fsl-imx8mq-usb implement ->detect_charger()
from usb_phy
API, but I haven't untangled that one yet, so not sure how feasible that actually would be.
Based on and supersedes !289 (closed)