1 What: Raise a uevent when a USB charger is inserted or removed
4 Contact: linux-usb@vger.kernel.org
5 Description: There are two USB charger states:
8 There are five USB charger types:
9 USB_CHARGER_UNKNOWN_TYPE: Charger type is unknown
10 USB_CHARGER_SDP_TYPE: Standard Downstream Port
11 USB_CHARGER_CDP_TYPE: Charging Downstream Port
12 USB_CHARGER_DCP_TYPE: Dedicated Charging Port
13 USB_CHARGER_ACA_TYPE: Accessory Charging Adapter
14 https://www.usb.org/document-library/battery-charging-v12-spec-and-adopters-agreement
16 Here are two examples taken using udevadm monitor -p when
17 USB charger is online:
18 UDEV change /devices/soc0/usbphynop1 (platform)
20 DEVPATH=/devices/soc0/usbphynop1
21 DRIVER=usb_phy_generic
22 MODALIAS=of:Nusbphynop1T(null)Cusb-nop-xceiv
23 OF_COMPATIBLE_0=usb-nop-xceiv
25 OF_FULLNAME=/usbphynop1
29 USB_CHARGER_STATE=USB_CHARGER_PRESENT
30 USB_CHARGER_TYPE=USB_CHARGER_SDP_TYPE
31 USEC_INITIALIZED=227422826
33 USB charger is offline:
34 KERNEL change /devices/soc0/usbphynop1 (platform)
36 DEVPATH=/devices/soc0/usbphynop1
37 DRIVER=usb_phy_generic
38 MODALIAS=of:Nusbphynop1T(null)Cusb-nop-xceiv
39 OF_COMPATIBLE_0=usb-nop-xceiv
41 OF_FULLNAME=/usbphynop1
45 USB_CHARGER_STATE=USB_CHARGER_ABSENT
46 USB_CHARGER_TYPE=USB_CHARGER_UNKNOWN_TYPE