linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@gmail.com>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Linux LED Subsystem <linux-leds@vger.kernel.org>,
	"rpurdie@rpsys.net" <rpurdie@rpsys.net>
Subject: Re: [PATCH 2/2] leds:pca963x: Always initialize MODE2 register
Date: Wed, 2 Jul 2014 16:42:29 -0700	[thread overview]
Message-ID: <CAK5ve-+9eP=k4UHDGD2FX6NOOSWMHitq1zFLoffeedA6vBWjNg@mail.gmail.com> (raw)
In-Reply-To: <1404288046-26661-2-git-send-email-pmeerw@pmeerw.net>

On Wed, Jul 2, 2014 at 1:00 AM, Peter Meerwald <pmeerw@pmeerw.net> wrote:
> From: Peter Meerwald <p.meerwald@bct-electronic.com>
>
> PCA9632 defaults to open-drain
> PCA9633/4/5 defaults to totem-pole
>
> the driver assumed that totem-pole default and didn't actively set
> the value; the MODE2 register is now written if platform
> data indicating the mode is given
>

This one looks good to me.

-Bryan

> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> ---
>  drivers/leds/leds-pca963x.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/leds/leds-pca963x.c b/drivers/leds/leds-pca963x.c
> index 70e3825..2214648 100644
> --- a/drivers/leds/leds-pca963x.c
> +++ b/drivers/leds/leds-pca963x.c
> @@ -423,9 +423,13 @@ static int pca963x_probe(struct i2c_client *client,
>         /* Disable LED all-call address and set normal mode */
>         i2c_smbus_write_byte_data(client, PCA963X_MODE1, 0x00);
>
> -       /* Configure output: open-drain or totem pole (push-pull) */
> -       if (pdata && pdata->outdrv == PCA963X_OPEN_DRAIN)
> -               i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x01);
> +       if (pdata) {
> +               /* Configure output: open-drain or totem pole (push-pull) */
> +               if (pdata->outdrv == PCA963X_OPEN_DRAIN)
> +                       i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x01);
> +               else
> +                       i2c_smbus_write_byte_data(client, PCA963X_MODE2, 0x05);
> +       }
>
>         return 0;
>
> --
> 1.7.9.5
>

  reply	other threads:[~2014-07-02 23:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02  8:00 [PATCH 1/2] leds:pca963x: Add support for PCA9635 LED driver chip Peter Meerwald
2014-07-02  8:00 ` [PATCH 2/2] leds:pca963x: Always initialize MODE2 register Peter Meerwald
2014-07-02 23:42   ` Bryan Wu [this message]
2014-07-02  8:00 ` [PATCH 3/3] leds:pca963x: Update for PCA9635 and correct statement about MODE2 OUTDRV default Peter Meerwald
2014-07-02 23:44   ` Bryan Wu
2014-07-02 23:40 ` [PATCH 1/2] leds:pca963x: Add support for PCA9635 LED driver chip Bryan Wu
2014-07-03  5:38   ` Peter Meerwald

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='CAK5ve-+9eP=k4UHDGD2FX6NOOSWMHitq1zFLoffeedA6vBWjNg@mail.gmail.com' \
    --to=cooloney@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=rpurdie@rpsys.net \
    /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;
as well as URLs for NNTP newsgroup(s).