From: Peter Chen <peter.chen@nxp.com>
To: balbi@kernel.org
Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com,
gregkh@linuxfoundation.org, Peter Chen <peter.chen@nxp.com>
Subject: [PATCH v3 2/2] Doc: ABI: add usb charger uevent
Date: Tue, 14 Jan 2020 17:38:58 +0800 [thread overview]
Message-ID: <1578994738-8872-2-git-send-email-peter.chen@nxp.com> (raw)
In-Reply-To: <1578994738-8872-1-git-send-email-peter.chen@nxp.com>
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
+
+ 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
--
2.17.1
next prev parent reply other threads:[~2020-01-14 9:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 9:38 [PATCH v3 1/2] usb: phy: show USB charger type for user Peter Chen
2020-01-14 9:38 ` Peter Chen [this message]
2020-01-14 9:48 ` [PATCH v3 2/2] Doc: ABI: add usb charger uevent Greg KH
2020-01-15 1:58 ` Peter Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1578994738-8872-2-git-send-email-peter.chen@nxp.com \
--to=peter.chen@nxp.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-imx@nxp.com \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).