linux/drivers/phy
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
..
allwinner phy: sun4i-usb: Add D1 variant 2022-02-25 13:53:21 +05:30
amlogic phy: fixes for 5.17 2022-02-07 10:24:00 +05:30
broadcom phy: usb: Add "wake on" functionality for newer Synopsis XHCI controllers 2022-02-25 14:13:19 +05:30
cadence phy/cadence: Use of_device_get_match_data() 2022-02-25 13:58:12 +05:30
freescale phy: freescale: i.MX8 PHYs should depend on ARCH_MXC && ARM64 2022-01-27 11:05:18 +05:30
hisilicon phy: HiSilicon: Fix copy and paste bug in error handling 2021-11-23 10:42:13 +05:30
ingenic phy: ingenic: Fix a typo in ingenic_usb_phy_probe() 2021-03-30 23:35:17 +05:30
intel phy: intel: Remove redundant dev_err call in thunderbay_emmc_phy_probe() 2021-12-02 09:46:33 +05:30
lantiq phy: lantiq: rcu-usb2: wait after clock enable 2021-01-13 19:29:03 +05:30
marvell Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-16 16:13:19 -08:00
mediatek phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy 2022-01-27 12:14:34 +05:30
microchip phy: lan966x: Remove set_speed function 2021-12-14 14:24:48 +05:30
motorola phy-for-5.12 2021-02-09 09:32:35 +01:00
mscc
qualcomm phy: qcom: Program SSC only if supported by sink 2022-02-08 11:02:55 +05:30
ralink phy-for-5.14 version 2 2021-06-23 10:33:34 +02:00
renesas phy: renesas: phy-rcar-gen3-usb2: Add USB2.0 PHY support for RZ/G2L 2021-08-06 18:12:30 +05:30
rockchip phy: rockchip: add naneng combo phy for RK3568 2022-02-24 20:13:52 +05:30
samsung phy: samsung: unify naming and describe driver in KConfig 2021-10-01 11:46:20 +05:30
socionext phy: uniphier-usb3ss: fix unintended writing zeros to PHY register 2021-12-24 10:06:38 +05:30
st phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable() 2022-01-27 11:04:40 +05:30
tegra phy: tegra: xusb: Fix return value of tegra_xusb_find_port_node function 2021-12-14 13:07:21 +05:30
ti phy: ti: tusb1210: Add charger detection 2022-02-25 14:28:07 +05:30
xilinx phy: xilinx: zynqmp: Fix bus width setting for SGMII 2022-01-27 10:55:26 +05:30
Kconfig phy: pistachio-usb: Depend on MIPS || COMPILE_TEST 2021-08-12 16:01:49 +02:00
Makefile phy: phy-can-transceiver: Add support for generic CAN transceiver driver 2021-06-14 11:20:17 +05:30
phy-can-transceiver.c phy: phy-can-transceiver: Make devm_gpiod_get optional 2021-11-23 12:15:08 +05:30
phy-core-mipi-dphy.c phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) 2022-02-25 14:14:06 +05:30
phy-core.c phy: Allow a NULL phy name for devm_phy_get() 2021-05-14 17:48:41 +05:30
phy-lgm-usb.c phy: Add USB3 PHY support for Intel LGM SoC 2020-09-11 17:12:49 +05:30
phy-lpc18xx-usb-otg.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
phy-pistachio-usb.c
phy-xgene.c phy: phy-xgene.c: Fix alignment of comment 2021-05-31 14:08:55 +05:30