Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1117896pxm; Thu, 3 Mar 2022 10:37:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfKNLR09vLzdvHC5Gn6VJFaMdIov4SupkAPF/b3GO3JPTj5GfeAtRwYJx8K6MOFi+lwv8N X-Received: by 2002:a63:f25:0:b0:374:6b38:c6b3 with SMTP id e37-20020a630f25000000b003746b38c6b3mr31417053pgl.195.1646332647449; Thu, 03 Mar 2022 10:37:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646332647; cv=none; d=google.com; s=arc-20160816; b=mPKxQPDU3RPomEt0+ni5IgzkfzMbLtKBpimHzs7VcGNt2hjhwJuVq+MN6thqzV+S6c XPjDdZDh6K44DAUEaI65gJF+NAjsrVPBEsNeBuumPPiYtGO7+IXbcYhSgCALXKDMmXAY SlOQ+30ju7df7aEN/X92BS5Zote5oue92E2DC/fEFeTU0H9bH59bbIQEKmAg74Y2q8tH zpav4Fwns8awfIDvIf6GhRQk4XPnoEDSLKV0NegVvM9aQrb2FydIV0GOtk/HIo7wRgEO yQIovxwSOPuRtckH5lUBBl3oEeavPQxW/iIVFyE97A47MOEbahp9JQ5TB47Oav/Zn2IW vhIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=RQc1EduZOxTVRuovpIxxC4lLLOT2x5sF2/FtMnYZD/E=; b=Qjs/C7iJiwRsQqGx4ZYPN9ndmJWoh6oHkv+5RxdlG14HQ+TnpbFl81N/jsczDwS3H4 T6lY+aIc4Xmq1zYBCd8X8q5fWOEqrVy3hbDC9g8LmkSUaeLNRM8rFY9wbgQKsLHYWVbp k83T6xvdj+btvr20S3/FTgSvnsP4oFwzU49GzQBVVd62cJPh5TeTviquYANDww150gNI Rm4IVLGb9MKQBhVUGRn5EjCO0RVQbjiPIihE9uOBhfNdqZEwtby6SaHB31tcJD8//J3d P6fSM06SBNNXDl9I5r53Z3xr7TUAh9YpiH1OK2oBD8rihTOnMdx4GD3o4P6kQ9lAsH5t 6Kxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Cwet6+xm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p22-20020a1709027ed600b001501c29b560si3218973plb.402.2022.03.03.10.37.11; Thu, 03 Mar 2022 10:37:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Cwet6+xm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235329AbiCCRz2 (ORCPT + 99 others); Thu, 3 Mar 2022 12:55:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234816AbiCCRzY (ORCPT ); Thu, 3 Mar 2022 12:55:24 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65E9515470D for ; Thu, 3 Mar 2022 09:54:36 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id i11so7604706eda.9 for ; Thu, 03 Mar 2022 09:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RQc1EduZOxTVRuovpIxxC4lLLOT2x5sF2/FtMnYZD/E=; b=Cwet6+xm3v/FuUk7aMMFOzwkCxFlqIg+IXN/Es6pmj/8bjEUctLSG6QX85Nk7SNSHX OAjh3lSun2PuLc+dQhVoaTX5dtgrMAbxuXJPHvIgU1PjmKeRdu8CsDIaOwECO63sf4v4 wN30/iPlbXr7RcfAtg8Igk2qVW4s+WQRc+/fgRBitdCmR1XGg1KxrH6USS1O0cc/Qmp6 4P3g0jz2aODU6+sgof2+vtDbZyXdVFEQQH6nj0Z3NlS68QKcLE0ukAgOr4Is3Xj1JYCR lXJ113FpUGjltfa31Q1FKRIory/1DMJA0bcKB6+hOSGLZX7/IVs+cp9A7I75EF7tfH1s icGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RQc1EduZOxTVRuovpIxxC4lLLOT2x5sF2/FtMnYZD/E=; b=FFj8KFmIz0qnG4gdfz1dqTBw6g/aiCV7zy4Gkwj4q/bo+KUYdBh7P91Iau/xzm5Rvr gstepfAjjvo89Lz0s79ybA6OPLzw00wTBCcLC7V2DsnymXBySuJdoK33QYxaD2jKOhEj P6IznMFJqf3hNPMhq+L+NH9VDvp9w4WR9l1t0cHhqVoQU/m4I8tTyMJeLnsPVwi+FXre 3I0gGDFRYNUq45krQEpCeDatEiyl/VKfut131e8vk74Ic3iIGo9s3W9V5B9ju8VQ4SrK LjI2QgqIGKaZsS2n1SKGqr6rDNUDuic/ItJdpnYKu4p0ee7apUHlN7/mobPNjBQr8KTv QZNg== X-Gm-Message-State: AOAM53397aH1mRcSMIp/k23wXFv49kLPtrPjlfMCFUp5Bhf4M2iQRgCU ZYVM4FdsJfNrtvWhqxA5C9VHu6Sw7mejg25QA0FPkA== X-Received: by 2002:aa7:c687:0:b0:415:eb43:8ff5 with SMTP id n7-20020aa7c687000000b00415eb438ff5mr2509400edq.74.1646330074426; Thu, 03 Mar 2022 09:54:34 -0800 (PST) MIME-Version: 1.0 References: <20220301022625.469446-1-wonchung@google.com> In-Reply-To: From: Won Chung Date: Thu, 3 Mar 2022 09:54:11 -0800 Message-ID: Subject: Re: [PATCH v2] usb:typec: Add sysfs support for Type C connector's physical location To: Heikki Krogerus Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , Benson Leung , Prashant Malani , "open list:ULTRA-WIDEBAND (UWB) SUBSYSTEM:" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-18.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 2, 2022 at 3:21 AM Heikki Krogerus wrote: > > 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 wrote: > > > > > > On Tue, Mar 1, 2022 at 1:33 AM Heikki Krogerus > > > 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 ar= e > > > > > 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 con= nector > > > > > 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 de= termine > > > > > which specific device at which location is doing what. > > > > > > > > > > _PLD output includes much more fields, but only generic fields ar= e added > > > > > and exposed to sysfs, so that non-ACPI devices can also support i= t 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 > > > > > --- > > > > > > > > > > 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/Docume= ntation/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//location/panel > > > > > +Date: March 2022 > > > > > +Contact: Won Chung > > > > > +Description: > > > > > + Describes which panel surface of the system=E2=80= =99s housing the > > > > > + port resides on. > > > > > + > > > > > +What: /sys/class/typec//location/vertical_p= osition > > > > > +Date: March 2022 > > > > > +Contact: Won Chung > > > > > +Description: > > > > > + Describes vertical position of the port on the pane= l surface. > > > > > + Valid values: upper, center, lower > > > > > + > > > > > +What: /sys/class/typec//location/horizontal= _position > > > > > +Date: March 2022 > > > > > +Contact: Won Chung > > > > > +Description: > > > > > + Describes horizontal position of the port on the pa= nel surface. > > > > > + Valid values: left, center, right > > > > > + > > > > > +What: /sys/class/typec//location/dock > > > > > +Date: March 2022 > > > > > +Contact: Won Chung > > > > > +Description: > > > > > + Set as "yes" if the port resides in a docking stati= on or a port > > > > > + replicator, otherwise set as "no". > > > > > + > > > > > +What: /sys/class/typec//location/lid > > > > > +Date: March 2022 > > > > > +Contact: Won Chung > > > > > +Description: > > > > > + Set as "yes" if the port resides on the lid of lapt= op 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//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 Hi Heikki and Rafael, Thank you for clarification and guidance. I created and sent a new patch on driver core for /sys/devices/.../location/. Won