From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754101AbbI3OHz (ORCPT ); Wed, 30 Sep 2015 10:07:55 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:47547 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbbI3OHt (ORCPT ); Wed, 30 Sep 2015 10:07:49 -0400 Date: Wed, 30 Sep 2015 16:07:47 +0200 From: Sascha Hauer To: linux-kernel@vger.kernel.org Cc: Mark Brown , Liam Girdwood , kernel@pengutronix.de, alkml@pengutronix.de Subject: Re: [RFC] regulator: Propagate voltage changes to supply regulators Message-ID: <20150930140747.GD7858@pengutronix.de> References: <1443621474-2191-1-git-send-email-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443621474-2191-1-git-send-email-s.hauer@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 16:06:07 up 11 days, 3:35, 73 users, load average: 0.37, 0.26, 0.20 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please do not answer to this series, it contains a wrong address for the linux-arm-kernel list. I just resent this with the correct addres. Sorry for the noise. Sascha On Wed, Sep 30, 2015 at 03:57:48PM +0200, Sascha Hauer wrote: > Until now changing the voltage of a regulator only ever effected the > regulator itself, but never its supplies. It's a common pattern though > to put LDO regulators behind switching regulators. The switching > regulators efficiently drop the input voltage but have a high ripple on > their output. The output is then cleaned up by the LDOs. For higher > energy efficiency the voltage drop at the LDOs should be minimized. This > patch adds support for such a scenario. > > A new min_dropout_uv field is added to struct regulator_desc. Regulators > can specify the minimun dropout voltage they need for proper function > here. Now when the voltage is changed on a regulator the regulator core > makes sure that > a) before increasing the voltage on the current regulator the supply > provides at least the desired voltage plus the minimum dropout > b) after decreasing the voltage on the current regulator the supply > is optimized to the minimum required voltage within the needs of > the consumers of the supply. > > Calculating the optimum voltage for the supply regulator is a bit tricky > since the simple approach of just adding the desired minimum voltage and > the minimum dropout is not enough. It may happen that the current > regulator does not support the desired minimum voltage, but only a > higher one. This means we have to figure out the lowest voltage > supported by the regulator that is higher than the minimum desired > voltage. The regulator_get_voltage_floor introduced with this series > does > exactly that. > > This is a first RFC for this series which probably has some rough edges, > but it was already tested successfully on a Phytec PFLA02 i.MX6 board. > > Please review, any input welcome. > > Sascha > > > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |