Re: [PATCH] regulator: palmas: Fix calculating selector inpalmas_map_voltage_ldo

From: Mark Brown
Date: Wed Jul 18 2012 - 06:06:14 EST

On Wed, Jul 18, 2012 at 08:55:30AM +0100, Graeme Gregory wrote:
> On 18/07/12 04:30, Axel Lin wrote:
> > This patch fixes below issues when choosing selector:

> > 1. Current code returns negative selector if min_uV < 900000 which is wrong.
> > For example, it is possible to satisfy the request with selector = 1 if
> > the requested min_uV is 850000.

> Isnt this defending against bugs in the regulator core? I am normally
> against repeating the same checks at multiple levels in a stack.

This isn't a bug in the core, a negative selector is an error code (and
in general whatever selector is returned by the driver ought to agree
with selectors the driver actually supports). It's probably at least a
questionable decision in the machine constraints to allow a request for
less than the regulator can deliver to get through though.

Attachment: signature.asc
Description: Digital signature