diff mbox series

[v3,2/2] Doc: ABI: add usb charger uevent

Message ID 1578994738-8872-2-git-send-email-peter.chen@nxp.com (mailing list archive)
State Superseded
Headers show
Series [v3,1/2] usb: phy: show USB charger type for user | expand

Commit Message

Peter Chen Jan. 14, 2020, 9:38 a.m. UTC
When the USB charger is inserted or removed, the users could get
USB charger state and type through the uevent.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
Changes for v3:
- Change kernel version for 5.6, and delete the kernel printk time

 Documentation/ABI/testing/usb-charger-uevent | 45 ++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/ABI/testing/usb-charger-uevent

Comments

Greg Kroah-Hartman Jan. 14, 2020, 9:48 a.m. UTC | #1
On Tue, Jan 14, 2020 at 05:38:58PM +0800, Peter Chen wrote:
> When the USB charger is inserted or removed, the users could get
> USB charger state and type through the uevent.
> 
> Signed-off-by: Peter Chen <peter.chen@nxp.com>
> ---
> Changes for v3:
> - Change kernel version for 5.6, and delete the kernel printk time
> 
>  Documentation/ABI/testing/usb-charger-uevent | 45 ++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/ABI/testing/usb-charger-uevent
> 
> diff --git a/Documentation/ABI/testing/usb-charger-uevent b/Documentation/ABI/testing/usb-charger-uevent
> new file mode 100644
> index 000000000000..94ab16768e49
> --- /dev/null
> +++ b/Documentation/ABI/testing/usb-charger-uevent
> @@ -0,0 +1,45 @@
> +What:		Raise a uevent when a USB charger is inserted or removed
> +Date:		2020-01-14
> +KernelVersion:	5.6
> +Contact:	linux-usb@vger.kernel.org
> +Description:	There are two USB charger states:
> +		USB_CHARGER_ABSENT
> +		USB_CHARGER_PRESENT
> +		There are five USB charger types:
> +		USB_CHARGER_UNKNOWN_TYPE
> +		USB_CHARGER_SDP_TYPE
> +		USB_CHARGER_CDP_TYPE
> +		USB_CHARGER_DCP_TYPE
> +		USB_CHARGER_ACA_TYPE

Any explaination for what these different types really are?  What is a
"CDP"?  "ACA"?  where would one find that information out?

thanks,

greg k-h
Peter Chen Jan. 15, 2020, 1:58 a.m. UTC | #2
On 20-01-14 10:48:13, Greg KH wrote:
> On Tue, Jan 14, 2020 at 05:38:58PM +0800, Peter Chen wrote:
> > When the USB charger is inserted or removed, the users could get
> > USB charger state and type through the uevent.
> > 
> > Signed-off-by: Peter Chen <peter.chen@nxp.com>
> > ---
> > Changes for v3:
> > - Change kernel version for 5.6, and delete the kernel printk time
> > 
> >  Documentation/ABI/testing/usb-charger-uevent | 45 ++++++++++++++++++++
> >  1 file changed, 45 insertions(+)
> >  create mode 100644 Documentation/ABI/testing/usb-charger-uevent
> > 
> > diff --git a/Documentation/ABI/testing/usb-charger-uevent b/Documentation/ABI/testing/usb-charger-uevent
> > new file mode 100644
> > index 000000000000..94ab16768e49
> > --- /dev/null
> > +++ b/Documentation/ABI/testing/usb-charger-uevent
> > @@ -0,0 +1,45 @@
> > +What:		Raise a uevent when a USB charger is inserted or removed
> > +Date:		2020-01-14
> > +KernelVersion:	5.6
> > +Contact:	linux-usb@vger.kernel.org
> > +Description:	There are two USB charger states:
> > +		USB_CHARGER_ABSENT
> > +		USB_CHARGER_PRESENT
> > +		There are five USB charger types:
> > +		USB_CHARGER_UNKNOWN_TYPE
> > +		USB_CHARGER_SDP_TYPE
> > +		USB_CHARGER_CDP_TYPE
> > +		USB_CHARGER_DCP_TYPE
> > +		USB_CHARGER_ACA_TYPE
> 
> Any explaination for what these different types really are?  What is a
> "CDP"?  "ACA"?  where would one find that information out?

I will add explanation for it, thanks.
diff mbox series

Patch

diff --git a/Documentation/ABI/testing/usb-charger-uevent b/Documentation/ABI/testing/usb-charger-uevent
new file mode 100644
index 000000000000..94ab16768e49
--- /dev/null
+++ b/Documentation/ABI/testing/usb-charger-uevent
@@ -0,0 +1,45 @@ 
+What:		Raise a uevent when a USB charger is inserted or removed
+Date:		2020-01-14
+KernelVersion:	5.6
+Contact:	linux-usb@vger.kernel.org
+Description:	There are two USB charger states:
+		USB_CHARGER_ABSENT
+		USB_CHARGER_PRESENT
+		There are five USB charger types:
+		USB_CHARGER_UNKNOWN_TYPE
+		USB_CHARGER_SDP_TYPE
+		USB_CHARGER_CDP_TYPE
+		USB_CHARGER_DCP_TYPE
+		USB_CHARGER_ACA_TYPE
+
+		Here are two examples taken using udevadm monitor -p when
+		USB charger is online:
+		UDEV  change   /devices/soc0/usbphynop1 (platform)
+		ACTION=change
+		DEVPATH=/devices/soc0/usbphynop1
+		DRIVER=usb_phy_generic
+		MODALIAS=of:Nusbphynop1T(null)Cusb-nop-xceiv
+		OF_COMPATIBLE_0=usb-nop-xceiv
+		OF_COMPATIBLE_N=1
+		OF_FULLNAME=/usbphynop1
+		OF_NAME=usbphynop1
+		SEQNUM=2493
+		SUBSYSTEM=platform
+		USB_CHARGER_STATE=USB_CHARGER_PRESENT
+		USB_CHARGER_TYPE=USB_CHARGER_SDP_TYPE
+		USEC_INITIALIZED=227422826
+
+		USB charger is offline:
+		KERNEL change   /devices/soc0/usbphynop1 (platform)
+		ACTION=change
+		DEVPATH=/devices/soc0/usbphynop1
+		DRIVER=usb_phy_generic
+		MODALIAS=of:Nusbphynop1T(null)Cusb-nop-xceiv
+		OF_COMPATIBLE_0=usb-nop-xceiv
+		OF_COMPATIBLE_N=1
+		OF_FULLNAME=/usbphynop1
+		OF_NAME=usbphynop1
+		SEQNUM=2494
+		SUBSYSTEM=platform
+		USB_CHARGER_STATE=USB_CHARGER_ABSENT
+		USB_CHARGER_TYPE=USB_CHARGER_UNKNOWN_TYPE