[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=WWPWpytKAGBJXPJdGa8MrBwocDi_tOw6hYvqorL64ckg@mail.gmail.com>
Date: Tue, 26 Aug 2014 08:44:31 -0700
From: Doug Anderson <dianders@...omium.org>
To: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
Cc: Mark Brown <broonie@...nel.org>, Olof Johansson <olof@...om.net>,
Yuvaraj Kumar C D <yuvaraj.cd@...il.com>,
linux-samsung-soc <linux-samsung-soc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] regulator: max77802: set opmode to normal if off is
read from hw
Javier,
On Tue, Aug 26, 2014 at 4:37 AM, Javier Martinez Canillas
<javier.martinez@...labora.co.uk> wrote:
> The max77802 driver reads the default operating mode (opmode)
> set for regulators when enabled from the hardware registers.
>
> But if a regulator is disabled and the system warm restarted,
> the hardware reports OFF as the opmode so the regulator is
> not enabled. Default to operating mode NORMAL if OFF is read
> from the hardware register.
>
> Reported-by: Yuvaraj Cd <yuvaraj.lkml@...il.com>
> Signed-off-by: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
> ---
>
> This patch fixes the issue reported in https://lkml.org/lkml/2014/8/25/69
>
> drivers/regulator/max77802.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/max77802.c b/drivers/regulator/max77802.c
> index ad1caa9..967e109 100644
> --- a/drivers/regulator/max77802.c
> +++ b/drivers/regulator/max77802.c
> @@ -540,7 +540,17 @@ static int max77802_pmic_probe(struct platform_device *pdev)
> config.of_node = pdata->regulators[i].of_node;
>
> ret = regmap_read(iodev->regmap, regulators[i].enable_reg, &val);
> - max77802->opmode[id] = val >> shift & MAX77802_OPMODE_MASK;
> + val = val >> shift & MAX77802_OPMODE_MASK;
> +
> + /*
> + * If the regulator is disabled and the system warm rebooted,
> + * the hardware reports OFF as the regulator operating mode.
> + * Default to operating mode NORMAL in that case.
> + */
> + if (val == MAX77802_OPMODE_OFF)
> + max77802->opmode[id] = MAX77802_OPMODE_NORMAL;
> + else
> + max77802->opmode[id] = val;
Reviewed-by: Doug Anderson <dianders@...omium.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists