linux-stable/drivers/phy/ti
Stephan Gerhold 48969a5623 phy: ti: tusb1210: Add charger detection
Some Android x86 tablets with a Bay Trail (BYT) SoC and a Crystal Cove
PMIC, which does not support charger-detection, rely on a TUSB1211
phy for charger-detection.

Add support for charger detection on TUSB1211 phy-s and export
the information about the detected charger through the standard
power_supply class interface. power_supply class charger IC drivers
like the bq24190_charger.c driver will then pick this up and set
their input_current_limit based on this.

Note the "linux,phy_charger_detect" property used to enable this is
a special kernel-internal (so not part of the dt-bindings) property
used by dwc3 platform code to indicate that the phy needs to do
charger-detection.

Changes by Hans de Goede:
- Use "linux,phy_charger_detect" property to enable charger-detect
- Switch from a linear flow to a state-machine, with retries on
  ulpi communication errors
- Use SW_CONTROL bit to disable the FSM when detection is finished
- Do a phy-reset on disconnect to work around the phy often refusing
  ulpi_read()/_write() commands after a disconnect
- Use power_supply_reg_notifier() for Vbus monitoring
- Export the detection result through a power_supply class device

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Co-developed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220213130524.18748-10-hdegoede@redhat.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2022-02-25 14:28:07 +05:30
..
Kconfig phy: ti: gmii-sel: simplify config dependencies between net drivers and gmii phy 2020-03-26 20:01:13 -07:00
Makefile phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC 2020-01-14 10:50:19 +05:30
phy-am654-serdes.c phy: ti: report 2 non-kernel-doc comments 2021-11-16 15:31:30 +05:30
phy-da8xx-usb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285 2019-06-05 17:36:37 +02:00
phy-dm816x-usb.c phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe() 2021-06-21 12:04:18 +05:30
phy-gmii-sel.c phy: ti: gmii-sel: check of_get_address() for failure 2021-10-26 16:36:23 +05:30
phy-j721e-wiz.c phy: ti: Fix missing sentinel for clk_div_table 2022-01-24 09:33:33 +05:30
phy-omap-control.c phy: ti: Use IS_ERR_OR_NULL() to clean code 2021-12-14 13:10:03 +05:30
phy-omap-usb2.c phy: ti: omap-usb2: Fix the kernel-doc style 2021-11-23 10:38:24 +05:30
phy-ti-pipe3.c phy: ti: convert to devm_platform_ioremap_resource(_byname) 2020-11-16 12:47:48 +05:30
phy-tusb1210.c phy: ti: tusb1210: Add charger detection 2022-02-25 14:28:07 +05:30
phy-twl4030-usb.c phy: phy-twl4030-usb: Disable PHY for suspend 2021-08-06 17:32:51 +05:30