From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-usb@vger.kernel.org,
Douglas Gilbert <dgilbert@interlog.com>
Subject: Re: [PATCH] usb: pd: Exposing the Peak Current value of Fixed Supplies to user space
Date: Wed, 27 Sep 2023 14:10:38 +0200 [thread overview]
Message-ID: <2023092721-barrier-geranium-ec0e@gregkh> (raw)
In-Reply-To: <20230927111031.1059096-1-heikki.krogerus@linux.intel.com>
On Wed, Sep 27, 2023 at 02:10:31PM +0300, Heikki Krogerus wrote:
> Exposing the value of the field as is.
>
> The Peak Current value has to be interpreted as described
> in Table 6-10 (Fixed Power Source Peak Current Capability)
> of the USB Power Delivery Specification, but that
> interpretation will be done in user space, not in kernel.
>
> Suggested-by: Douglas Gilbert <dgilbert@interlog.com>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/pd.c | 10 ++++------
> include/linux/usb/pd.h | 1 +
> 2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/typec/pd.c b/drivers/usb/typec/pd.c
> index 8cc66e4467c4..85d015cdbe1f 100644
> --- a/drivers/usb/typec/pd.c
> +++ b/drivers/usb/typec/pd.c
> @@ -83,14 +83,12 @@ unchunked_extended_messages_supported_show(struct device *dev,
> }
> static DEVICE_ATTR_RO(unchunked_extended_messages_supported);
>
> -/*
> - * REVISIT: Peak Current requires access also to the RDO.
> static ssize_t
> peak_current_show(struct device *dev, struct device_attribute *attr, char *buf)
> {
> - ...
> + return sysfs_emit(buf, "%u\n", (to_pdo(dev)->pdo >> PDO_FIXED_PEAK_CURR_SHIFT) & 3);
> }
> -*/
> +static DEVICE_ATTR_RO(peak_current);
Don't you need to add a Documentation/ABI/ entry for this new field?
thanks,
greg k-h
next prev parent reply other threads:[~2023-09-27 12:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 11:10 [PATCH] usb: pd: Exposing the Peak Current value of Fixed Supplies to user space Heikki Krogerus
2023-09-27 12:10 ` Greg Kroah-Hartman [this message]
2023-09-27 12:19 ` 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=2023092721-barrier-geranium-ec0e@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=dgilbert@interlog.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
/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