From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: Jonas Gorski <jonas.gorski@gmail.com>, linux-leds@vger.kernel.org
Cc: Richard Purdie <rpurdie@rpsys.net>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH] leds: bcm6328: fix signal source assignment for leds 4 to 7
Date: Sat, 3 Jun 2017 11:27:39 +0200 [thread overview]
Message-ID: <447ffd3d-ae9b-ec02-83d2-9cba3f4c39a3@gmail.com> (raw)
In-Reply-To: <20170602121705.9645-1-jonas.gorski@gmail.com>
Acked-by: Álvaro Fernández Rojas <noltari@gmail.com>
El 02/06/2017 a las 14:17, Jonas Gorski escribió:
> 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);
> }
>
next prev parent reply other threads:[~2017-06-03 9:27 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 [this message]
2017-06-04 18:53 ` Jacek Anaszewski
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=447ffd3d-ae9b-ec02-83d2-9cba3f4c39a3@gmail.com \
--to=noltari@gmail.com \
--cc=jacek.anaszewski@gmail.com \
--cc=jonas.gorski@gmail.com \
--cc=linux-leds@vger.kernel.org \
--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).