public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Prashant Malani <pmalani@chromium.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:USB NETWORKING DRIVERS" <linux-usb@vger.kernel.org>,
	Benson Leung <bleung@chromium.org>
Subject: Re: [PATCH v2] usb: typec: Expose Product Type VDOs via sysfs
Date: Thu, 22 Oct 2020 15:42:48 +0300	[thread overview]
Message-ID: <20201022124248.GQ1667571@kuha.fi.intel.com> (raw)
In-Reply-To: <CACeCKafjm-T5WnQNRbpKm3OwxqYH+_MxLMg60-=RrpJFBzcKyA@mail.gmail.com>

On Thu, Oct 22, 2020 at 12:25:07AM -0700, Prashant Malani wrote:
> Hi Greg,
> 
> On Thu, Oct 22, 2020 at 12:17 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > > > > +What:                /sys/class/typec/<port>-partner/identity/product_type_vdo
> > > > > +Date:                October 2020
> > > > > +Contact:     Prashant Malani <pmalani@chromium.org>
> > > > > +Description:
> > > > > +             Product Type VDOs part of Discover Identity command result. 3 values
> > > > > +             are displayed (for the 3 possible Product Type VDOs), one per line.
> > > >
> > > > sysfs is "one value per file", not "one value per line".  This is not
> > > > ok.
> > >
> > > I see. Would listing these out as three separate vdos (i.e vdo0, vdo1,
> > > vdo2) be better?
> >
> > Given that your current implementation is not acceptable, something has
> > to change :)
> 
> Got it. I'd like to see if Heikki has any suggestions on naming these
> entries better.

Why not have product type specific attribute files?

So if the partner is UFP, then we expose ufp1 and ufp2 files that
return the UFP1 and UFP2 VDO values and hide the other files:

        % ls /sys/class/typec/port0-partner/identity/
        id_header cert_stat product ufp1 ufp2

If the partner is DFP, then you expose the dfp file and hide
everything else:

        % ls /sys/class/typec/port0-partner/identity/
        id_header cert_stat product dfp

And so on.

thanks,

-- 
heikki

  reply	other threads:[~2020-10-22 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  6:15 [PATCH v2] usb: typec: Expose Product Type VDOs via sysfs Prashant Malani
2020-10-22  6:57 ` Greg KH
2020-10-22  7:13   ` Prashant Malani
2020-10-22  7:17     ` Greg KH
2020-10-22  7:25       ` Prashant Malani
2020-10-22 12:42         ` Heikki Krogerus [this message]
2020-10-22 18:18           ` Prashant Malani
2020-10-22 23:25           ` Benson Leung
2020-10-23  9:34             ` Heikki Krogerus
2020-10-23 21:52     ` 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=20201022124248.GQ1667571@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=bleung@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pmalani@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox