Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1831628lqa; Mon, 29 Apr 2024 23:48:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpWhtEi8rTv4/2aMsiolPmGlFJHp/VOihHSPjFtNrI3sLaM1iPWXn84bZH8nB1eLv5xxdsRmD1Z7kU08EuUDA/PAPLq4ph3YQUcIfvTA== X-Google-Smtp-Source: AGHT+IGD3OZXIB748HBB1Lj1uVaWFFr0gqADdO1AI4IBvxFSgBNvsLJwj3ZzDPiebhhG/ciODwdr X-Received: by 2002:ac8:5a8d:0:b0:43a:bd5b:9657 with SMTP id c13-20020ac85a8d000000b0043abd5b9657mr3205853qtc.1.1714459718383; Mon, 29 Apr 2024 23:48:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714459718; cv=pass; d=google.com; s=arc-20160816; b=UrW0yFvHc75T4KhDjbPaz9mxsd6ppnjPihEPGyjs9kJaBo908etF2Xah3AQS6v+0Jj vNR58UUmsDvv6brjv/CnmKfIU//j1LxgkHeG2JPimLOA8X8MRFQpAM/LHjfbduVHOOOO ge+QXZcl546KDdwmZSJwIAj4R9FCT/kjBnE2wp/5PckojNaA2drFphoPbr2jhZRGbA7y s89Qe6dIUtQxNeFngnla2ENdNFHGBlY1PG9zhgkSI4PWkXk6z54JR5DDfOPpCBdAbg23 JmhAzmegNyxoKsxFNcNHrgsx4EjV/W1iQ1KbvBpZ+pQxrJWi55OCRFptXhhJlCKeo6IT z3nw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=CsLAJwpaFeWfG2ce+mE7KDRnjifT+w5hpaN5hyP5ZkY=; fh=cnwJj0x82+c7t5bCVUm+q1LMjl5rhBZRLvalE4rTX+A=; b=CBIZnzIub4ZqNA1dhZsM7jdbtA5N4d5hfU8Pt6qdld+Dr40z+6GnX4HxrgeHjZjn7N w+UKtzcEXORFfrVARnsisISblosN1Ek2YzCUTP0B3qadOxr+h8NaStcc/I9F5XYwxPmb UDYSoZo9k0VVd0gMoVpI1ERpOXLZLt4dBFJ8mYGtf+JoMjP3bC9IPp+8hN84sD7VVJDV UYk84fJRCRxvnGMRyJYqDsACXwZpG0+yLqM7tMMNEyRl1LArZnesipH6LT3FXjzIrn8B K/m2uyZEg/ycIaDugwvZuqe5T33vaY2t3mUfcnAW4LARZaYbdujt2QQ1ATjMyAaBxtjP Y6tg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-163435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163435-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c3-20020a05622a024300b0043a3b78f868si12665678qtx.372.2024.04.29.23.48.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 23:48:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-163435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163435-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 20AAB1C20FF1 for ; Tue, 30 Apr 2024 06:48:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2330F1B806; Tue, 30 Apr 2024 06:48:32 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34A1117731 for ; Tue, 30 Apr 2024 06:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714459711; cv=none; b=j5co4c7jI2OBpLE6s6uD7WClZAXoy53DRctWFmDEOILw4kuCu2pGiKlALXEXFy2EwCxTaL0fYE4ZeHJIegeryobe4XL3Oz8nSGdQu0EoWIgvJsyWPufe9MfkYCLf1phaEcoVFpZwh/NQNvPtdvIcZPyvLOIC7JcvYIl3YDRPxkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714459711; c=relaxed/simple; bh=QlWC6sF6a80KgWmsLCDwe8nl2naO+GsOgOEyO/ax9Rw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KR2SuyiUwC7NV00FV5niKg6Bl3/tvqFKiXdw9grYxR0Pfnm8XxWHLJ4TZOvUugtgseLremEJrnkzOzCno20BuJMtO67k+oWiCUGmgWcfPxIH2faNfTdkChWjDZaJ+6FIzkyy1Dnyv+0wRGwQDqEY/xmhfD+VqvTtrAlj4ZbQ9wM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1hHt-0007c7-Bj; Tue, 30 Apr 2024 08:48:25 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1hHr-00F7HM-Pl; Tue, 30 Apr 2024 08:48:23 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1s1hHr-0047M1-2H; Tue, 30 Apr 2024 08:48:23 +0200 Date: Tue, 30 Apr 2024 08:48:23 +0200 From: Oleksij Rempel To: Mark Brown Cc: Kory Maincent , Kyle Swenson , Liam Girdwood , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Thomas Petazzoni Subject: Re: PoE complex usage of regulator API Message-ID: References: <20240426124253.56fd0933@kmaincent-XPS-13-7390> <20240429192848.13c576b7@kmaincent-XPS-13-7390> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Tue, Apr 30, 2024 at 11:23:15AM +0900, Mark Brown wrote: > On Mon, Apr 29, 2024 at 07:28:48PM +0200, Kory Maincent wrote: > > Mark Brown wrote: > > > On Fri, Apr 26, 2024 at 12:42:53PM +0200, Kory Maincent wrote: > > > That's right I was focusing on power where I could use already implemented > > voltage and current callbacks. Would you be interested to a new get_current() > > callback to know the current and allows regulator to deduce the consumed power > > or should it be specific to PSE subsystem. > > That feels like it belongs in hwmon or possibly power rather than in the > regulator API but it does feel like it's generally useful rather than > PSE specific. I would say, it depends on use case and abilities of HW. Power consumption may change rapidly, so it is all about sampling rate. For real time current measurement you wont to use iio framework. For most cases and simple diagnostic are more interesting max and probably min values which self cleared after last read. If HW provides only real time measurement, then the question is, how many samples are needed to provide some usable result. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |