linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Jonas Gorski <jonas.gorski@gmail.com>, linux-leds@vger.kernel.org
Cc: "Richard Purdie" <rpurdie@rpsys.net>,
	"Pavel Machek" <pavel@ucw.cz>,
	"Álvaro Fernández Rojas" <noltari@gmail.com>
Subject: Re: [PATCH] leds: bcm6328: fix signal source assignment for leds 4 to 7
Date: Sun, 4 Jun 2017 20:53:40 +0200	[thread overview]
Message-ID: <ebde13b4-f596-2c99-3026-06db9f577a55@gmail.com> (raw)
In-Reply-To: <20170602121705.9645-1-jonas.gorski@gmail.com>

Hi Jonas,

On 06/02/2017 02:17 PM, Jonas Gorski wrote:
> Each nibble represents 4 LEDs, and in case of the higher register, bit 0
> represents LED 4, so we need to use modulus for the LED number as well.
> 
> Fixes: fd7b025a238d0a5440bfa26c585eb78097bf48dc ("leds: add BCM6328 LED driver")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
>  drivers/leds/leds-bcm6328.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/leds/leds-bcm6328.c b/drivers/leds/leds-bcm6328.c
> index 1548259297c1..2cfd9389ee96 100644
> --- a/drivers/leds/leds-bcm6328.c
> +++ b/drivers/leds/leds-bcm6328.c
> @@ -242,7 +242,7 @@ static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
>  
>  		spin_lock_irqsave(lock, flags);
>  		val = bcm6328_led_read(addr);
> -		val |= (BIT(reg) << (((sel % 4) * 4) + 16));
> +		val |= (BIT(reg % 4) << (((sel % 4) * 4) + 16));
>  		bcm6328_led_write(addr, val);
>  		spin_unlock_irqrestore(lock, flags);
>  	}
> @@ -269,7 +269,7 @@ static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
>  
>  		spin_lock_irqsave(lock, flags);
>  		val = bcm6328_led_read(addr);
> -		val |= (BIT(reg) << ((sel % 4) * 4));
> +		val |= (BIT(reg % 4) << ((sel % 4) * 4));
>  		bcm6328_led_write(addr, val);
>  		spin_unlock_irqrestore(lock, flags);
>  	}
> 

Thanks for the patch. Applied.

-- 
Best regards,
Jacek Anaszewski

      parent reply	other threads:[~2017-06-04 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 12:17 [PATCH] leds: bcm6328: fix signal source assignment for leds 4 to 7 Jonas Gorski
2017-06-03  9:27 ` Álvaro Fernández Rojas
2017-06-04 18:53 ` Jacek Anaszewski [this message]

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=ebde13b4-f596-2c99-3026-06db9f577a55@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=noltari@gmail.com \
    --cc=pavel@ucw.cz \
    --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).