Linux USB
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Douglas Gilbert <dgilbert@interlog.com>
Cc: Benson Leung <bleung@google.com>,
	Prashant Malani <pmalani@chromium.org>,
	Badhri Jagan Sridharan <badhri@google.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Saranya Gopal <saranya.gopal@intel.com>,
	linux-usb@vger.kernel.org
Subject: Re: [typec] pd: fixed source capability: peak_current field
Date: Mon, 11 Sep 2023 16:45:31 +0300	[thread overview]
Message-ID: <ZP8Z+1Kn+RagnFNq@kuha.fi.intel.com> (raw)
In-Reply-To: <9b87f828-cf1d-e370-f4ca-e0c53c9a35c5@interlog.com>

+linux-usb ml, Guenter and others.

On Sun, Sep 10, 2023 at 09:29:04PM -0400, Douglas Gilbert wrote:
> Hi,
> The Peak current 2 bit field has been present in the fixed source PDO
> since PD 2.0 . It is commented out in typec/pd.c with a note to revisit
> as it needs the Operational current field from the active RDO.
> 
> Not sure I agree with that: the 2 bit field is unit-less and could easily
> be displayed as such. At the moment the active RDO is not directly
> available through sysfs and would certainly be a useful addition for
> many reasons.
> 
> So my vote (not that I get one) would be to output peak_current in
> sysfs with no unit. Then in the ABI peak_current could be explained
> by reference to a table in the spec (e.g. "USB Power Delivery
> Specification Revision 3.1, Version 1.8, table 6-10 Fixed Power
> Source Peak Current Capability"). Then the issue of what it means
> is handed off to the user space :-)
> 
> Also of note is that the Peak current field is B21..B20 which is
> below B23 (obviously) so all fixed source PDOs have that field
> (and thus those unit-less values could differ), not just
> PDO #1 .

I agree with you. I don't think it makes sense to try to interpret the
peak current value in kernel, so we could just expose the value as-is.

But first giving the others heads-up on this, just in case somebody
disagrees.

thanks,

-- 
heikki

       reply	other threads:[~2023-09-11 21:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9b87f828-cf1d-e370-f4ca-e0c53c9a35c5@interlog.com>
2023-09-11 13:45 ` Heikki Krogerus [this message]
2023-09-11 16:45   ` [typec] pd: fixed source capability: peak_current field Douglas Gilbert

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=ZP8Z+1Kn+RagnFNq@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=badhri@google.com \
    --cc=bleung@google.com \
    --cc=dgilbert@interlog.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pmalani@chromium.org \
    --cc=saranya.gopal@intel.com \
    /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