Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp350907pxb; Wed, 22 Sep 2021 03:45:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2s+FM2p6l4836+mYLoH9MUdRxssEUOZKTjhawjLn0/8GEMXMDVEaEu8eGft9xig4n0nbb X-Received: by 2002:a17:906:7f01:: with SMTP id d1mr40650128ejr.318.1632307555108; Wed, 22 Sep 2021 03:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632307555; cv=none; d=google.com; s=arc-20160816; b=HMFThMef7I1vt6dnjvKedD0APYcuXh6n+yTOzpBqZQkwI3ZS0iYI2J8404L/R4RZGq uiSqEjeckiOULajLsaUSKa8usnCMlphYhm9FOfYjbK4wy9nNY6ELt6f6Y1r93Cx3NU9l ufHHk5avlzf8BgXfwdbq0HY4tY8fEZuVf1EyBpnu/ieWaMeu/VvBrgkzf5XaBn5Bn587 8t4UvxJfX2TL5rLSP4ZLUzSHriIvC31v5axNt1a2+HnIMB8dZ0iE4fF/vfHmno7F2g1a Wkf3pSF9cPeRIzEdiZt8OaI3nnDykWlPrxzfSSHNnTXhz7+jbunokr3in6XW972QrBSE QdDg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Bu6AevBJ6oodtxmwktE4bN9NzIWACmsvGsHSQnfbjxo=; b=p9qySfZqYSI7c4fYFSlLX6ZcLDL/9BvIS0GEDOD8BO0N1/SnAI9GfzGCaF9CFEGczm sNEwWeF6Brk2+JIDdViCl7uf7d4TuyvoTkHMYMox1n+AaysU1R2tBz1oT+mbG4Peu9dk wpT5JdJ9JjSw0VBAj9hh9MaSo79p52MytpP5mc+yJ6pbA37wUJKeZGZk4+4tzcLN4XXG CB4H+hp9yVfNF9+bppND3/wua7TInuCoJ4GHklubGOjN4KUnURdBc5O7OfsjRa0vtixU yDnw1jo+aNSrxwp150Qdv2cNIG9KWtp68DNLA2G2xVMWuAhA5/0stNER6FZ8ySb0aKhM BGNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr21si2029633ejb.14.2021.09.22.03.45.31; Wed, 22 Sep 2021 03:45:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235441AbhIVKoX (ORCPT + 99 others); Wed, 22 Sep 2021 06:44:23 -0400 Received: from mga12.intel.com ([192.55.52.136]:52938 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235403AbhIVKmF (ORCPT ); Wed, 22 Sep 2021 06:42:05 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="203059424" X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="203059424" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 03:40:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="613368772" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 22 Sep 2021 03:40:31 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 22 Sep 2021 13:40:30 +0300 Date: Wed, 22 Sep 2021 13:40:30 +0300 From: Heikki Krogerus To: Rajaram R Cc: Badhri Jagan Sridharan , Adam Thomson , Benson Leung , Prashant Malani , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-pm@vger.kernel.org" , "bleung@chromium.org" , Greg Kroah-Hartman , Sebastian Reichel , Guenter Roeck Subject: Re: [RFC PATCH 2/3] power: supply: Add support for PDOs props Message-ID: References: <20210902213500.3795948-1-pmalani@chromium.org> <20210902213500.3795948-3-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rajaram, I'm sorry for the late reply. On Mon, Sep 20, 2021 at 06:50:22PM +0530, Rajaram R wrote: > On Fri, Sep 17, 2021 at 6:25 AM Badhri Jagan Sridharan > wrote: > > > > On Thu, Sep 16, 2021 at 7:12 AM Adam Thomson > > wrote: > > > > > > On 16 September 2021 11:23, Heikki Krogerus wrote: > > > > > > > > Thanks for providing the clarification. So you're proposing a port-psy and a > > > > > port-partner-psy that are connected to each other (one supplying the other). > > > > > If PD is not present, those two will exist per port and partner, and there > > > > > will be information about Type-C current (and possibly BC 1.2 and other > > > > > methods?) > > > > > > > > Yes, exactly. > > > As Benson mentioned PDOs contain more than power details like USB > Suspend indicator etc or Type-C only devices as Badhri mentioned here > may not integrate well with PSY class. Additionally, it is also > important to consider cable properties here for power as they also > have a role to play in the power limits and necessitates change of > existing PDOs or power limits. ( Type-C Monitor charging a computing > system does not have captive cables) > > Given too many possibilities, would an approach similar to > gadgetfs/configfs or cpu scaling say like "type-configfs" or "typec > scaling" ABI framework that allows USB=C port management under one > path /sys/class/typec that allows: > > - Provision to manage USB-C port power ( Power supply class should > still represent power contract established, as remaining > characteristics are nested with functional aspects and relevant on a > power contract failure ) > + dynamically change Rp ( Rp(default) is required to enter USB suspend) > + Set PDO Policy ( PPS, Fixed, etc) > + Give back power > + Expose complete PDO ( As we do for VDOs) > + Change USB Suspend flag > > - Provision for extended messages > + Provides additional details regarding ports like Get Status etc. > This shall allow us to take system level decisions. > > - Provision to manage USB-C modes > + Provision to enter modes as provided by interface standards like UCSI > > With this user tools like Chrome OS "typecd" be able to use a single > class and its ABIs to manage USB-C port power and mode. Kindly correct > me if I am missing something here. So I agree that we should have secondary interface to the USB Type-C ports, cables and partners, and I think the secondary interface should be "usbpdfs", something similar to usbfs, that you can use to tap into the protocol layer of the PD stack. We have to interpret things especially with UCSI, since we can't even communicate raw VDOs with UCSI, but it will still not be a huge problem. I'm quite certain that we should be able to solve a lot of the control related problems that we now have (so basically lack of control) with it, but more importantly we would then not need to figure out what is the correct way to represent every single thing in sysfs in order to utilise it. I would imagine this could then at least ideally be the only interface that also the typecd would need to deal with. thanks, -- heikki