public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Won Chung <wonchung@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Benson Leung <bleung@chromium.org>,
	Prashant Malani <pmalani@chromium.org>,
	"open list:ULTRA-WIDEBAND (UWB) SUBSYSTEM:" 
	<linux-usb@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] usb:typec: Add sysfs support for Type C connector's physical location
Date: Wed, 2 Mar 2022 13:21:05 +0200	[thread overview]
Message-ID: <Yh9TIeCIchBrZOdH@kuha.fi.intel.com> (raw)
In-Reply-To: <CAJZ5v0ipcdUqTEFn075NeioyHRDKy2j_pYZOBKgqnx_c1=q5Pw@mail.gmail.com>

On Tue, Mar 01, 2022 at 08:11:06PM +0100, Rafael J. Wysocki wrote:
> On Tue, Mar 1, 2022 at 7:57 PM Won Chung <wonchung@google.com> wrote:
> >
> > On Tue, Mar 1, 2022 at 1:33 AM Heikki Krogerus
> > <heikki.krogerus@linux.intel.com> wrote:
> > >
> > > Hi Won,
> > >
> > > On Tue, Mar 01, 2022 at 02:26:25AM +0000, Won Chung wrote:
> > > > When ACPI table includes _PLD field for a Type C connector, share _PLD
> > > > values in its sysfs. _PLD stands for physical location of device.
> > > >
> > > > Currently without connector's location information, when there are
> > > > multiple Type C ports, it is hard to distinguish which connector
> > > > corresponds to which physical port at which location. For example, when
> > > > there are two Type C connectors, it is hard to find out which connector
> > > > corresponds to the Type C port on the left panel versus the Type C port
> > > > on the right panel. With location information provided, we can determine
> > > > which specific device at which location is doing what.
> > > >
> > > > _PLD output includes much more fields, but only generic fields are added
> > > > and exposed to sysfs, so that non-ACPI devices can also support it in
> > > > the future. The minimal generic fields needed for locating a port are
> > > > the following.
> > > > - panel
> > > > - vertical_position
> > > > - horizontal_position
> > > > - dock
> > > > - lid
> > > >
> > > > Signed-off-by: Won Chung <wonchung@google.com>
> > > > ---
> > > >
> > > > Changes in v2:
> > > > - Use string for location.
> > > > - Clarify get_pld() with naming and return type.
> > > >
> > > >  Documentation/ABI/testing/sysfs-class-typec |  35 ++++++
> > > >  drivers/usb/typec/class.c                   | 113 ++++++++++++++++++++
> > > >  drivers/usb/typec/class.h                   |   3 +
> > > >  3 files changed, 151 insertions(+)
> > > >
> > > > diff --git a/Documentation/ABI/testing/sysfs-class-typec b/Documentation/ABI/testing/sysfs-class-typec
> > > > index 75088ecad202..4497a5aeb063 100644
> > > > --- a/Documentation/ABI/testing/sysfs-class-typec
> > > > +++ b/Documentation/ABI/testing/sysfs-class-typec
> > > > @@ -141,6 +141,41 @@ Description:
> > > >               - "reverse": CC2 orientation
> > > >               - "unknown": Orientation cannot be determined.
> > > >
> > > > +What:                /sys/class/typec/<port>/location/panel
> > > > +Date:                March 2022
> > > > +Contact:     Won Chung <wonchung@google.com>
> > > > +Description:
> > > > +             Describes which panel surface of the system’s housing the
> > > > +             port resides on.
> > > > +
> > > > +What:                /sys/class/typec/<port>/location/vertical_position
> > > > +Date:                March 2022
> > > > +Contact:     Won Chung <wonchung@google.com>
> > > > +Description:
> > > > +             Describes vertical position of the port on the panel surface.
> > > > +             Valid values: upper, center, lower
> > > > +
> > > > +What:                /sys/class/typec/<port>/location/horizontal_position
> > > > +Date:                March 2022
> > > > +Contact:     Won Chung <wonchung@google.com>
> > > > +Description:
> > > > +             Describes horizontal position of the port on the panel surface.
> > > > +             Valid values: left, center, right
> > > > +
> > > > +What:                /sys/class/typec/<port>/location/dock
> > > > +Date:                March 2022
> > > > +Contact:     Won Chung <wonchung@google.com>
> > > > +Description:
> > > > +             Set as "yes" if the port resides in a docking station or a port
> > > > +             replicator, otherwise set as "no".
> > > > +
> > > > +What:                /sys/class/typec/<port>/location/lid
> > > > +Date:                March 2022
> > > > +Contact:     Won Chung <wonchung@google.com>
> > > > +Description:
> > > > +             Set as "yes" if the port resides on the lid of laptop system,
> > > > +             otherwise set as "no".
> > > > +
> > >
> > > I've probable lost track of the topic during my winter break, I'm
> > > sorry about that, but why are you proposing now that this should be
> > > made Type-C specific?
> > > This information is not Type-C specific, so it definitely does not
> > > belong here.
> > >
> > > Br,
> > >
> > > --
> > > heikki
> >
> > Hi Heikki,
> >
> > Thank you for the comment. Sorry that my description was not clear.
> > This is follow up from "[PATCH v6] ACPI: device_sysfs: Add sysfs
> > support for _PLD" in which Rafael suggested to have generic location
> > in Type C connector than adding PLD specifically to ACPI device.
> 
> Well, this doesn't have to be /sys/class/typec/<port>/location/ though.
> 
> For example, the device location information can be exposed in a more
> generic way is /sys/devices/.../location/ for all devices for which it
> is available, somewhat in analogy to /sys/devices/.../power/.

Right, that's what I meant. These can be made generic.

thanks,

-- 
heikki

  reply	other threads:[~2022-03-02 11:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  2:26 [PATCH v2] usb:typec: Add sysfs support for Type C connector's physical location Won Chung
2022-03-01  9:33 ` Heikki Krogerus
2022-03-01 18:57   ` Won Chung
2022-03-01 19:11     ` Rafael J. Wysocki
2022-03-02 11:21       ` Heikki Krogerus [this message]
2022-03-03 17:54         ` Won Chung

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=Yh9TIeCIchBrZOdH@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 \
    --cc=rafael@kernel.org \
    --cc=wonchung@google.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