From: Andrew Morton <akpm@linux-foundation.org>
To: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Cc: rpurdie@rpsys.net, linux-kernel@vger.kernel.org,
linus.walleij@linaro.org
Subject: Re: [PATCH] drivers/leds/leds-lp5521.c: check if reset is successful
Date: Tue, 18 Oct 2011 14:10:48 -0700 [thread overview]
Message-ID: <20111018141048.1f38b211.akpm@linux-foundation.org> (raw)
In-Reply-To: <1318246202-2476-1-git-send-email-srinidhi.kasagar@stericsson.com>
On Mon, 10 Oct 2011 17:00:02 +0530
Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> wrote:
> 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.
>
> ...
>
> @@ -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);
Sorry, but I found that comment very hard to follow.
Is this version accurate and complete?
/*
* Make sure that the chip is reset by reading back the r channel
* current reg. This dummy read is required on some platforms -
* otherwise further access to the R G B channels in the
* LP5521_REG_ENABLE register will not have any effect - strange!
*/
next prev parent reply other threads:[~2011-10-18 21:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 11:30 Srinidhi KASAGAR
2011-10-18 9:59 ` Srinidhi KASAGAR
2011-10-18 21:10 ` Andrew Morton [this message]
2011-10-19 4:33 ` Srinidhi KASAGAR
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111018141048.1f38b211.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--cc=srinidhi.kasagar@stericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®