Re: [PATCH 3/7] leds-lm3530: add 'is_vin_always_on' in the lm3530_platform_data
From: Linus Walleij
Date: Mon Jan 23 2012 - 14:13:20 EST
On Fri, Jan 20, 2012 at 2:48 AM, Kim, Milo <Milo.Kim@xxxxxx> wrote:
> The 'IN' pin(Input voltage connection) can be always turned on
> in case it is connected with VBATT.
> To support this case, 'is_vin_always_on' is added.
> If VIN is always on, then we don't need to control the regulator for IN pin.
>
> Signed-off-by: Milo(Woogyom) Kim <milo.kim@xxxxxx>
(...)
> + if (!drvdata->enable && !pltfm->is_vin_always_on) {
> ret = regulator_enable(drvdata->regulator);
> if (ret) {
> dev_err(&drvdata->client->dev,
> @@ -256,7 +256,7 @@ static void lm3530_brightness_set(struct led_classdev *led_cdev,
> else
> drvdata->brightness = brt_val / 2;
>
> - if (brt_val == 0) {
> + if (brt_val == 0 && !pdata->is_vin_always_on) {
> err = regulator_disable(drvdata->regulator);
NACK on this, and paging Mark.
As far as I know we want to get rid of different design patterns
avoiding the regulator interface. The way forward for this is
either:
(A) Provide a fixed voltage regulator in your platform for this
device (AFAIK the voltage does not even have to be correct)
(B) Enable dummy regulators in your platform
(A) is more elegant.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/