• Chen-Yu Tsai's avatar
    power: supply: axp20x_usb_power: use polling to detect vbus status change · 97ec136e
    Chen-Yu Tsai authored
    On AXP221 and later AXP PMICs that have the N_VBUSEN pin, when this pin
    is high, either due to the PMIC driving it high or as an input, the VBUS
    detection related interrupt mechanisms are disabled.
    
    Previously this was worked around in the phy-sun4i-usb driver, which
    needed to sense VBUS changes and report them to the musb driver in a
    timely matter. However this workaround was only for the A31 and A33 type
    USB PHYs. To support newer platforms we would have to enable it for
    almost all the post-A31 SoCs.
    
    However, since this is actually the result of the PMIC's behavior, the
    workaround would be better if done in the PMIC driver, in this case the
    VBUS power supply driver.
    
    Add the same workqueue-based polling to the VBUS power supply driver.
    The polling interval is chosen to be the debounce interval from the USB
    PHY driver, as this short interval is needed in some cases, but the
    power supply driver would not know when.
    Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
    Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
    97ec136e
axp20x_usb_power.c 12.6 KB