From mboxrd@z Thu Jan 1 00:00:00 1970 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 |