Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp298650pxm; Wed, 2 Mar 2022 15:47:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCP0xCnFZnnwHfdE9HBMyiWYCdfAf6c+pFVWsmbqxr4TweHZSdXcjS9ol/PNH5y7lEsTO7 X-Received: by 2002:a63:70b:0:b0:373:9e98:d8f9 with SMTP id 11-20020a63070b000000b003739e98d8f9mr27360958pgh.242.1646264837354; Wed, 02 Mar 2022 15:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646264837; cv=none; d=google.com; s=arc-20160816; b=LO8HcpoLYPMiFZA2PWnhmP90clLKc6f2arBB3C5Bmb7yC+9KIGkL9EjJogLkNWgqxB S/JVP2pS6zepPS3XPREVFu9vPoecpbew5AHunNMdWmjKmPG8EQDjBuaYA2Fai4kyCSMt TmcIJIiVTJWdX1IFBgz7mEsNGiK5wFwenWCOLOktTMGNiWYZgz6b3ScRL1h5CTg7ebCw 3FWAsUDzWX0fbj4UqGD2SrwD7QRJcA7JZlrSukMFUKEcU798fekQVOtj8EDrTvaS6fKB 1OFWmYJAXaIwVBG4kuuxQpVkD+QE4aa0BcJT6PaqQafEnWf9JmXW6mHzgxWU2xosJ4y3 oiwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=V68QnUwTKpMla//REqfEeTImRpXFt3KfK5Sb2mTGcrM=; b=GtUnsKq5Z4ayLaZsq9v0xhK1RX93h2YYgr0R+mTQDFW70VhocxLaS35aP3dxW+xTOF Mi/YYCgE5MLCnvhVzFATNllQJtD3jSvCJOXT1cTB4FrZGvu6N3pTFvEGhnPlMzVH1vSe C3H4LbKQ8Z3E3f+ybKnuOxgUwIK63RE3uWvd9uaRHSIjsf+XRVv3T2A7xlVK0CkNHx0v ZZBX/W66WFpCf1oQRBLtS11KDlmvH7FGwn4eSRnixur/iqrA3k4Ta+umIrqgO06eKrI6 M1ffxtkzWgOqz25nognJVcUD7O7RZBV7DJ4F2iUrYfOUMoacciyruz5YUIdBx8q3Ly1z A1iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="R65X/oEY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 201-20020a6303d2000000b00338a8050e87si410439pgd.739.2022.03.02.15.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:47:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="R65X/oEY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EA30B171EE5; Wed, 2 Mar 2022 15:11:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233304AbiCBLVz (ORCPT + 99 others); Wed, 2 Mar 2022 06:21:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbiCBLVy (ORCPT ); Wed, 2 Mar 2022 06:21:54 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACB63219E; Wed, 2 Mar 2022 03:21:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646220070; x=1677756070; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=uLNxc+hzfZRFOP722nQGlf7G0w39Iep5IwVHkKWJPDc=; b=R65X/oEYZPosGI8lxqahZQn0lbOG6r8SLPL0sgiIsTZurjvUSlviAvjw 7IbC4qvIj+AW7s2ZFQBDMJc+ezof29FhOLSfC5MR/Y4iEwZxIG58he9SU u0N6z+F/3lpwV1bfFsgXu362UqDN5ZKCZdgwjdzlusJfT8IF7LhC7xK6m jFx6MNxNqiATKMGDa7NP33g7b/rERig3InHH//0SyNySLGWDJ6ofBWCmF FS6GIPu77XAGrZu0LWxcuJyl2WCmVIYP+5P4NuPVIGr8FgRSkkzuVg5Qr rxV2M2fomu6spvS3ju1GJttby+PrbU8Uy8vnfbCsglJLl5qpN3ArETn17 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="339807372" X-IronPort-AV: E=Sophos;i="5.90,148,1643702400"; d="scan'208";a="339807372" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 03:21:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,148,1643702400"; d="scan'208";a="686106119" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 02 Mar 2022 03:21:06 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 02 Mar 2022 13:21:05 +0200 Date: Wed, 2 Mar 2022 13:21:05 +0200 From: Heikki Krogerus To: "Rafael J. Wysocki" Cc: Won Chung , Greg Kroah-Hartman , Benson Leung , Prashant Malani , "open list:ULTRA-WIDEBAND (UWB) SUBSYSTEM:" , Linux Kernel Mailing List Subject: Re: [PATCH v2] usb:typec: Add sysfs support for Type C connector's physical location Message-ID: References: <20220301022625.469446-1-wonchung@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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 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 > > > > --- > > > > > > > > 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//location/panel > > > > +Date: March 2022 > > > > +Contact: Won Chung > > > > +Description: > > > > + Describes which panel surface of the system’s housing the > > > > + port resides on. > > > > + > > > > +What: /sys/class/typec//location/vertical_position > > > > +Date: March 2022 > > > > +Contact: Won Chung > > > > +Description: > > > > + Describes vertical position of the port on the panel 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 panel 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 station 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 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//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