1What: Raise a uevent when a USB charger is inserted or removed 2Date: 2020-01-14 3KernelVersion: 5.6 4Contact: linux-usb@vger.kernel.org 5Description: There are two USB charger states: 6 USB_CHARGER_ABSENT 7 USB_CHARGER_PRESENT 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 15 16 Here are two examples taken using udevadm monitor -p when 17 USB charger is online: 18 UDEV change /devices/soc0/usbphynop1 (platform) 19 ACTION=change 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 24 OF_COMPATIBLE_N=1 25 OF_FULLNAME=/usbphynop1 26 OF_NAME=usbphynop1 27 SEQNUM=2493 28 SUBSYSTEM=platform 29 USB_CHARGER_STATE=USB_CHARGER_PRESENT 30 USB_CHARGER_TYPE=USB_CHARGER_SDP_TYPE 31 USEC_INITIALIZED=227422826 32 33 USB charger is offline: 34 KERNEL change /devices/soc0/usbphynop1 (platform) 35 ACTION=change 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 40 OF_COMPATIBLE_N=1 41 OF_FULLNAME=/usbphynop1 42 OF_NAME=usbphynop1 43 SEQNUM=2494 44 SUBSYSTEM=platform 45 USB_CHARGER_STATE=USB_CHARGER_ABSENT 46 USB_CHARGER_TYPE=USB_CHARGER_UNKNOWN_TYPE 47