linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Gruber <clemens.gruber@pqgruber.com>
To: Lionel Vitte <lionel.vitte@gmail.com>
Cc: linux-pwm@vger.kernel.org, thierry.reding@gmail.com
Subject: Re: [PATCH] pwm: pca9685: Set ALL_LED_OFF_L to POR value
Date: Sat, 22 Jan 2022 14:19:20 +0100	[thread overview]
Message-ID: <YewEWDGWhXiqPCvT@workstation> (raw)
In-Reply-To: <20220122065819.69150-1-lionel.vitte@free.fr>

On Sat, Jan 22, 2022 at 07:58:19AM +0100, Lionel Vitte wrote:
> During the driver probe, registers are not set to their POR value.
> 
> Signed-off-by: Lionel Vitte <lionel.vitte@free.fr>
> ---
>  drivers/pwm/pwm-pca9685.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c
> index c56001a790d0..c91fa7f9e33d 100644
> --- a/drivers/pwm/pwm-pca9685.c
> +++ b/drivers/pwm/pwm-pca9685.c
> @@ -560,10 +560,10 @@ static int pca9685_pwm_probe(struct i2c_client *client,
>  	pca9685_write_reg(pca, PCA9685_MODE1, reg);
>  
>  	/* Reset OFF/ON registers to POR default */
> -	pca9685_write_reg(pca, PCA9685_ALL_LED_OFF_L, LED_FULL);
> +	pca9685_write_reg(pca, PCA9685_ALL_LED_OFF_L, 0);
>  	pca9685_write_reg(pca, PCA9685_ALL_LED_OFF_H, LED_FULL);
>  	pca9685_write_reg(pca, PCA9685_ALL_LED_ON_L, 0);
> -	pca9685_write_reg(pca, PCA9685_ALL_LED_ON_H, 0);
> +	pca9685_write_reg(pca, PCA9685_ALL_LED_ON_H, LED_FULL);
>  
>  	pca->chip.ops = &pca9685_pwm_ops;
>  	/* Add an extra channel for ALL_LED */
> -- 
> 2.34.1
>

Good catch! Resetting the ON registers to 0 is no longer necessary and
the ALL_LED_OFF_L write with LED_FULL was a mistake.

Maybe you could have chosen another subject as you are not only fixing
the ALL_LED_OFF_L mistake. Maybe ".. Fix OFF/ON register reset to POR"
or something similar.

Other than that:

Acked-by: Clemens Gruber <clemens.gruber@pqgruber.com>

Regards,
Clemens

  reply	other threads:[~2022-01-22 13:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22  6:58 [PATCH] pwm: pca9685: Set ALL_LED_OFF_L to POR value Lionel Vitte
2022-01-22 13:19 ` Clemens Gruber [this message]
2022-02-24 13:02 ` Thierry Reding

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=YewEWDGWhXiqPCvT@workstation \
    --to=clemens.gruber@pqgruber.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=lionel.vitte@gmail.com \
    --cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).