From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17DA7C4332F for ; Wed, 22 Sep 2021 10:42:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F197E61356 for ; Wed, 22 Sep 2021 10:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235325AbhIVKoS (ORCPT ); Wed, 22 Sep 2021 06:44:18 -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-usb@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