From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Cc: "Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
"Łukasz Bartosik" <ukaszb@chromium.org>,
"Benson Leung" <bleung@chromium.org>,
"Jameson Thies" <jthies@google.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org
Subject: [PATCH v1 0/3] usb: typec: USB Modes
Date: Fri, 4 Oct 2024 17:04:35 +0300 [thread overview]
Message-ID: <20241004140440.1882311-1-heikki.krogerus@linux.intel.com> (raw)
Hi,
This was originally a proposal of mine that I posted back in 2019 as
an RFC [1].
The goal is to expose the USB Mode - USB Mode as defined in the USB
Type-C and USB Power Delivery specifications - to the user via sysfs.
With ports the mode will show the supported and the default USB Mode,
which is the mode that is (or should be) used in the next Enter_USB
Message.
With the partners the mode will show similarly the supported USB
modes, and also the active mode. Changing the active mode should cause
Data Reset (as described in the USB Power Delivery spec.). This should
happen even if there is no active USB Mode (in Alternate Mode).
I've modified the original RFC patches based on comments I've received
(offline). The major change is that I renamed the sysfs attribute file
for the port from "usb_mode" to "usb_capability".
I'm taking the USB mode in use in the UCSI driver with these, but I
did not add support for the "Set USB" UCSI command yet. I have no way
of testing it. Also, I don't really like that we have to construct the
Enter_USB Message from the abstracted information that UCSI supplies.
The interface should supply the Enter_USB Message that was used as is.
[1] https://lore.kernel.org/linux-usb/20191230152857.43917-1-heikki.krogerus@linux.intel.com/
Heikki Krogerus (4):
usb: typec: Add attribute file showing the supported USB modes of the
port
usb: typec: Add attribute file showing the USB Modes of the partner
usb: typec: ucsi: Supply the USB capabilities to the ports
usb: typec: ucsi: Add support for the partner USB Modes
Documentation/ABI/testing/sysfs-class-typec | 27 +++
drivers/usb/typec/class.c | 204 +++++++++++++++++++-
drivers/usb/typec/class.h | 3 +
drivers/usb/typec/ucsi/ucsi.c | 16 ++
drivers/usb/typec/ucsi/ucsi.h | 10 +
include/linux/usb/typec.h | 22 +++
6 files changed, 278 insertions(+), 4 deletions(-)
--
2.45.2
next reply other threads:[~2024-10-04 14:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 14:04 Heikki Krogerus [this message]
2024-10-04 14:04 ` [PATCH v1 1/4] usb: typec: Add attribute file showing the supported USB modes of the port Heikki Krogerus
2024-10-06 16:35 ` Dmitry Baryshkov
2024-10-04 14:04 ` [PATCH v1 2/4] usb: typec: Add attribute file showing the USB Modes of the partner Heikki Krogerus
2024-10-05 7:25 ` kernel test robot
2024-10-06 16:22 ` Dmitry Baryshkov
2024-10-09 8:34 ` Heikki Krogerus
2024-10-04 14:04 ` [PATCH v1 3/4] usb: typec: ucsi: Supply the USB capabilities to the ports Heikki Krogerus
2024-10-06 16:36 ` Dmitry Baryshkov
2024-10-04 14:04 ` [PATCH v1 4/4] usb: typec: ucsi: Add support for the partner USB Modes Heikki Krogerus
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=20241004140440.1882311-1-heikki.krogerus@linux.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=abhishekpandit@chromium.org \
--cc=bleung@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jthies@google.com \
--cc=linux-usb@vger.kernel.org \
--cc=ukaszb@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.