[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C832F8F5D375BD43BFA11E82E0FE9FE00DC2C4F6D2@EXDCVYMBSTM005.EQ1STM.local>
Date: Tue, 18 Oct 2011 11:59:39 +0200
From: Srinidhi KASAGAR <srinidhi.kasagar@...ricsson.com>
To: "rpurdie@...ys.net" <rpurdie@...ys.net>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>
Subject: RE: [PATCH] drivers/leds/leds-lp5521.c: check if reset is successful
Richard,
Did you get a chance to look at this patch?
srinidhi
> -----Original Message-----
> From: Srinidhi KASAGAR
> Sent: Monday, October 10, 2011 5:00 PM
> To: rpurdie@...ys.net
> Cc: linux-kernel@...r.kernel.org; linus.walleij@...aro.org; Srinidhi
> KASAGAR
> Subject: [PATCH] drivers/leds/leds-lp5521.c: check if reset is
> successful
>
> make sure that the reset is successful by issuing a dummy
> read to R channel current register and check its default
> value. On some platforms, without this dummy read, any
> further access to {R/G/B}_EXEC will not have any impact.
>
> Signed-off-by: srinidhi kasagar <srinidhi.kasagar@...ricsson.com>
> Tested-by: Naga Radhesh <naga.radheshy@...ricsson.com>
> Acked-by: Linus Walleij <linus.walleij@...aro.org>
> ---
> drivers/leds/leds-lp5521.c | 19 +++++++++++++++++++
> 1 files changed, 19 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
> index 9fc122c..91a2928 100644
> --- a/drivers/leds/leds-lp5521.c
> +++ b/drivers/leds/leds-lp5521.c
> @@ -97,6 +97,9 @@
> /* Status */
> #define LP5521_EXT_CLK_USED 0x08
>
> +/* default R channel current register value */
> +#define LP5521_REG_R_CURR_DEFAULT 0xAF
> +
> struct lp5521_engine {
> int id;
> u8 mode;
> @@ -643,6 +646,7 @@ static int __devinit lp5521_probe(struct i2c_client
> *client,
> struct lp5521_chip *chip;
> struct lp5521_platform_data *pdata;
> int ret, i, led;
> + u8 buf;
>
> chip = kzalloc(sizeof(*chip), GFP_KERNEL);
> if (!chip)
> @@ -681,6 +685,21 @@ static int __devinit lp5521_probe(struct
> i2c_client *client,
> * Exact value is not available. 10 - 20ms
> * appears to be enough for reset.
> */
> +
> + /*
> + * Make sure that the chip is reset by reading back
> + * r channel current reg. This is a dummy read, otherwise
> + * in some platforms, access to R G B channel program
> + * execution mode to 'Run' in LP5521_REG_ENABLE register
> + * will not have any affect - strange!
> + */
> + lp5521_read(client, LP5521_REG_R_CURRENT, &buf);
> + if (buf != LP5521_REG_R_CURR_DEFAULT) {
> + dev_err(&client->dev, "error in reseting chip\n");
> + goto fail2;
> + }
> + usleep_range(10000, 20000);
> +
> ret = lp5521_detect(client);
>
> if (ret) {
> --
> 1.7.4.3
--
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