Excessive power consumption when using USB host with chg_otg_en enabled before plugging the device in
It may not be an issue at all depending on how enabling USB power will be implemented when switching to host mode, but let's at least document the observed behavior somewhere.
When using USB host mode, one still does have to manually enable power by using /sys/class/leds/chg_otg_en/brightness
interface. It works fine - with !84 (closed), the USB port automatically switches between device and host mode as needed, and after plugging in an USB-C to USB-A passive adapter enabling power via chg_otg_en
makes the connected device work just fine.
However, when one does echo 255 > /sys/class/leds/chg_otg_en/brightness
before plugging the adapter in, the phone starts to take about 1A additional power from the battery after the adapter is finally plugged in. It doesn't stop even after echo 0 > /sys/class/leds/chg_otg_en/brightness
- it only stops after unplugging the adapter. It doesn't even matter whether any actual USB device is connected to the other end of such adapter.
It's not really a big issue by itself since all it takes to avoid the excessive power consumption is to always enable chg_otg_en
after plugging the adapter in, and to disable it when unplugging the adapter. It might be something worth remembering about when implementing automatic chg_otg
pin switching though.