Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1804442pxb; Thu, 7 Oct 2021 15:49:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDILbTgy00IW6mu/H+CETUA812PT1sfOhdlwf0A2tnsThLTRCGOIaSKV7hKYD20UsP1ZWJ X-Received: by 2002:a17:906:e99:: with SMTP id p25mr9170116ejf.534.1633646970188; Thu, 07 Oct 2021 15:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633646970; cv=none; d=google.com; s=arc-20160816; b=uetEnqIynPzGusqZz8AR9qxbW+H04QbiXewvl4c95qZSIAZL/bwDJZ+M6c7RRhjJFa 9QKsmCaNX8XulscC9QqY09Kk1jRB7BGqjS9Cgnozftm3ZiGzyfFK4bmdh0Yr1JDB3FAS aaZKOrPC6r2WODTSDQKria2Liklxoy62E6saiQeBO7dRonO2a8ldYkgIV9bEKTgOmRCn fGMJkRuyZIvglwhmqo1FdsXTu9lkkueDy5CM7EqR9qDzbCfovUFc9NDBfz6UHzpfH4aC T10pyFYIj6BP+4STjyxLeZAfV1tjC8lHziJJXUlT+W+5Pt3RmQ5w+f8aTQ4iB7GTAjlk xiKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bPosGXG6aj5fiHXiB91n2H+d3yhrMgyk6caA7rCYuVE=; b=I7rP5e4d/qab15lwH7nGRRyzPLznVKePSzXMDREgAZwB24YHOZK9m3qO7HjSmQBNqN 7liLITLGjSR6rQbI5w/kZOwAZXY+bNi95yxctihGDqcvlERjjW9hEQstMTgUZrlcZSo7 UF8FCR1Xoncpxq1KoAm9Nh2KHdwRfiWmwXu8PbLh91SyG+3Zl5uAzw/OpkPQWuWFHQM8 UhYmzvlbf6IJpIBZZBWCS9Vo3W6E6wr3UcfIJlmzLtYk03Cpk/0y/RckoACrg+tt45Ux 7lpsayV1ft/dpDN55pyXh7rkw0v7U+3q2KrijidFFembtLnrEjYQ8JiHYrTXtiSzidWY nZng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TyzCOLeO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr14si1270581ejc.16.2021.10.07.15.49.06; Thu, 07 Oct 2021 15:49:30 -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; dkim=pass header.i=@chromium.org header.s=google header.b=TyzCOLeO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241394AbhJGWee (ORCPT + 99 others); Thu, 7 Oct 2021 18:34:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241362AbhJGWed (ORCPT ); Thu, 7 Oct 2021 18:34:33 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B13C061755 for ; Thu, 7 Oct 2021 15:32:39 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id l13so7852080qtv.3 for ; Thu, 07 Oct 2021 15:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bPosGXG6aj5fiHXiB91n2H+d3yhrMgyk6caA7rCYuVE=; b=TyzCOLeOsNH+ATbCv+mObEZBqB2Q+42LxF3uXOIU4JqOxFv0Suf1hxARW3mECKJGbk 6W72juLLE8mx0B8j0TBIaZ70diDCJy7C1/EwOenCENtB5NKYV4Zt3tTGu6I9cXLJd6yw tgDL6K6e0bH6GRVNl69irNRt4P+TW75No5eE0= 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; bh=bPosGXG6aj5fiHXiB91n2H+d3yhrMgyk6caA7rCYuVE=; b=MdI7J4V4LX1JYChb/HWD4154lIQC8ktYAE0p2i/f80QU4aJ4vEpxAz7BTk2hra7HhC LNu1mHY3F4HG5r7z0Q00ZIy9cr3nCduL58syz1Gt+l+YoBOeW1SGA9Lx0jVKYvL7Ja0T kzyL6+SZh4bawiqbIWsn1T3lFZgCUkhLvUB/GYU04McCCcuWv51QZOpQXidp+whVEqUV fsgAkB2FJtaHde5v6Y+OM89SM+4mB651nB/7enB5cDeAjlXpCccomVVX6XvntKctcpJ9 CJ+2V7F0L0ILh/yAlN/CfkGRrr7ilXE5bhxkS4O+Nmq3cktuTG2OAFvcKlcYXvwyqDzs 2DEw== X-Gm-Message-State: AOAM532HVRXgtYYNqH8TbMX9GPpmMqDvc6Q8GEK1RUvIPaCviF2ls/7b uUBmk1Q+34oJyUl7BjvzNOEuCeqZQLvzp7pf/mUmHQ== X-Received: by 2002:ac8:4347:: with SMTP id a7mr8044529qtn.169.1633645958484; Thu, 07 Oct 2021 15:32:38 -0700 (PDT) MIME-Version: 1.0 References: <20210902213500.3795948-1-pmalani@chromium.org> <20210902213500.3795948-3-pmalani@chromium.org> In-Reply-To: From: Prashant Malani Date: Thu, 7 Oct 2021 15:32:27 -0700 Message-ID: Subject: Re: [RFC PATCH 2/3] power: supply: Add support for PDOs props To: Adam Thomson Cc: Heikki Krogerus , Benson Leung , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-pm@vger.kernel.org" , "bleung@chromium.org" , "badhri@google.com" , Greg Kroah-Hartman , Sebastian Reichel , Guenter Roeck Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi folks, Thanks for the comments and discussion on this RFC series. On Fri, Sep 24, 2021 at 8:38 AM Adam Thomson wrote: > > On 21 September 2021 11:54, Heikki Krogerus wrote: > > > If we can leave the decision about the selection to TCPM, that would > > be great! I'm not against that at all. As I said, I have not though > > through the control aspect. Right now I'm mostly concerned about how > > we expose the information to the user. The only reason why I have > > considered the control part at all is because how ever we decide to > > expose the information to the user, it has to work with control as > > well. > > Well part of the discussion has to be about the role that the user plays in > the control. What does and doesn't need to be controlled further up the stack, > and what will be taken care of by, for example, TCPM? Surely that dictates to > some degree what and how we expose all of this? Right now we have a simple means > to read and control voltages and currents through a PSY class, without the need > for the user to know any details of what a PDO/APDO is. Do we continue with > abstracting away to the user or instead let the user decipher this itself and > decide? Am just trying to understand the needs going forward. > > > The final PSYs and the supply chains they create as well as the > > individual properties I'm more than happy to talk about, but having a > > separate object for the smallest thing that we can see (PDO) is the > > right thing to do here IMO. Trying to concatenate things into single > > objects especially in sysfs, despite how nice it always would seem, > > has taken me to the brink of disaster in the past far too many times. > > > > In this case we don't need to take the risk of having to duplicated > > information or in worst case deprecate something that is also exposed > > to the sysfs in the future. > > > > So the question is not why should we registers every individual PDO > > separately. The question is, why shouldn't we do that? And saying that > > it's "heavyweight" I'm afraid is not good enough. :-) > > That was my initial feeling on the suggestion based on the idea of a PSY per PDO > and I still don't feel that fits as your creating a whole class of resources > to expose something that's pretty small. To me the PSY represents the source as > whole, and the PDOs are simply options/configurations for that source. If we're > needing to expose PDOs then I don't disagree with separating them out > individually and I certainly wouldn't want that all concatenated as one > property. However I think something like dynamically generated properties > might be a nicer solution to expose each PDO, or even groups of properties if > you wanted to split PDOs even further into constituent parts to the user. To downscope this issue for the time being, one of our immediate goals is to expose the PDOs to userspace for metrics reporting and potentially for some power policy control through other channels (like Chrome OS Embedded Controller). Would it be acceptable to revise this series to drop the power supply support for now (since I don't yet see a consensus on how to implement it for the partner), and just add sysfs nodes for each PDO ? This would be akin to how it's being done for identity VDOs right now. So we would have : /sys/class/typec/-partner/source_pdos/pdo{1-13} and /sys/class/typec/-partner/sink_pdos/pdo{1-13} and similarly for the port device. If we want to add additional parsing of the Fixed Supply PDO into individual properties for the partner/port, those can of course be added later. WDYT? Thanks,