Re: [PATCH part2 5/6] regulator: max14577: Implement SUSPEND mode for MAX77836 LDO-s

From: Mark Brown
Date: Thu May 01 2014 - 14:44:57 EST


On Wed, Apr 23, 2014 at 04:50:39PM +0200, Krzysztof Kozlowski wrote:

> This patch adds support for mode REGULATOR_MODE_STANDBY (and NORMAL) to
> LDO regulators by implementing the set_mode() and get_mode() operations.
> However the necessary regulator constraints (valid modes) are not parsed
> by of_regulator_match() so the driver adds them manually to the
> regulator init_data.

No, that's not the idea here. The reason that the modes need to be
explicitly enabled is that there's an element of board design in
determining if a given mode can satisfy the required current demand for
the board with sufficient quality (usually the lower power modes have
both a lower maximum current and poorer regulation accuracy especially
as the current rises). Doing it unconditionally isn't in general
reliable.

The reason that the modes aren't supported by DT is that defining a
binding is hard - it's not clear what exactly a "mode" means since it's
basically a Linux internal thing. We probably need to explicitly add
definitions of the modes to the bindings for individual devices
unfortunately (ie, saying "mode X maps to Y in the datasheet", possibly
using the datasheet modes in the binding for ease of use and having that
translation in the driver).

Ideally we'd be able to have the automatic mode setting working for
devices but in practice nobody wants to publish the numbers and working
out how much the board needs can also be hard so that isn't really
practical.

Attachment: signature.asc
Description: Digital signature