From: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Prashant Malani <pmalani@chromium.org>
Cc: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>,
Benson Leung <bleung@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"bleung@chromium.org" <bleung@chromium.org>,
"badhri@google.com" <badhri@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sebastian Reichel <sre@kernel.org>,
Guenter Roeck <linux@roeck-us.net>
Subject: RE: [RFC PATCH 2/3] power: supply: Add support for PDOs props
Date: Tue, 12 Oct 2021 10:42:06 +0000 [thread overview]
Message-ID: <DB9PR10MB4652F5AC42208209BE8BBC5180B69@DB9PR10MB4652.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <YWAnA1mc5CrlEs7H@kuha.fi.intel.com>
On 08 October 2021 12:10, Heikki Krogerus wrote:
> > To downscope this issue for the time being, one of our immediate goals
> > is to expose the PDOs
> > to userspace for metrics reporting and potentially for some power
> > policy control through other
> > channels (like Chrome OS Embedded Controller).
> >
> > Would it be acceptable to revise this series to drop the power supply
> > support for now (since I don't yet
> > see a consensus on how to implement it for the partner), and just add
> > sysfs nodes for each PDO ?
> > This would be akin to how it's being done for identity VDOs right now.
> >
> > So we would have :
> >
> > /sys/class/typec/<port>-partner/source_pdos/pdo{1-13}
> >
> > and
> >
> > /sys/class/typec/<port>-partner/sink_pdos/pdo{1-13}
> >
> > and similarly for the port device.
> >
> > If we want to add additional parsing of the Fixed Supply PDO into
> > individual properties for the partner/port,
> > those can of course be added later.
> >
> > WDYT?
>
> I don't think we should use sysfs to expose and control any of these
> objects. It does not really matter under which subsystem we are
> working. Sysfs is just the wrong interface for this kind of data.
>
> I'm now preparing a proof-of-concept patches where I create character
> device for every USB PD capable device (port, plug and partner). The
> idea is that we could use those char devices to tap into the USB PD
> protocol directly. Right now I'm thinking the nodes would look like
> this (with the first Type-C port):
>
> /dev/pd0/port
> /dev/pd0/plug0 - you only get this node with full featured cables
> /dev/pd0/plug1 - ditto
> /dev/pd0/partner - and this is here only if you are connected
>
> So in this case you would use those char devices to send the actual
> Get_Source_Cap and Get_Sink_Cap messages to get the PDOs.
>
> The problem is that it's not going to be possible to always support
> every type of command. For example with UCSI we are pretty much
> limited to the capability control messages. But I still think this is
> the right way to do this.
>
> Let me know what you think.
My two pence worth; this feels like a more appropriate mechanism to access that
data. Look forward to seeing the POC.
next prev parent reply other threads:[~2021-10-12 10:42 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 21:34 [RFC PATCH 0/3] Type C partner power supply and PDO support Prashant Malani
2021-09-02 21:34 ` [RFC PATCH 1/3] usb: pd: Increase max PDO objects to 13 Prashant Malani
2021-09-03 6:47 ` Jack Pham
2021-09-03 18:05 ` Jack Pham
2021-09-07 21:36 ` Prashant Malani
2021-09-07 23:28 ` Benson Leung
2021-09-09 17:37 ` Jack Pham
2021-09-02 21:35 ` [RFC PATCH 2/3] power: supply: Add support for PDOs props Prashant Malani
2021-09-13 13:30 ` Heikki Krogerus
2021-09-13 15:15 ` Adam Thomson
2021-09-13 19:30 ` Benson Leung
2021-09-14 10:28 ` Heikki Krogerus
2021-09-14 10:14 ` Heikki Krogerus
2021-09-16 7:22 ` Benson Leung
2021-09-16 10:23 ` Heikki Krogerus
2021-09-16 14:12 ` Adam Thomson
2021-09-16 16:16 ` Badhri Jagan Sridharan
2021-09-20 13:20 ` Rajaram R
2021-09-22 10:40 ` Heikki Krogerus
2021-09-21 10:53 ` Heikki Krogerus
2021-09-24 15:38 ` Adam Thomson
2021-10-07 22:32 ` Prashant Malani
2021-10-08 11:09 ` Heikki Krogerus
2021-10-11 23:05 ` Prashant Malani
2021-10-12 10:42 ` Adam Thomson [this message]
2021-09-13 17:40 ` Benson Leung
2021-09-14 11:04 ` Heikki Krogerus
2021-09-02 21:35 ` [RFC PATCH 3/3] usb: typec: Add partner power registration call Prashant Malani
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=DB9PR10MB4652F5AC42208209BE8BBC5180B69@DB9PR10MB4652.EURPRD10.PROD.OUTLOOK.COM \
--to=adam.thomson.opensource@diasemi.com \
--cc=badhri@google.com \
--cc=bleung@chromium.org \
--cc=bleung@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=pmalani@chromium.org \
--cc=sre@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
all inboxes | Powered by JetHome®