From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Jean-Jacques Hiblot <jjhiblot@ti.com>, pavel@ucw.cz, dmurphy@ti.com
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH] leds: tlc591xx: update the maximum brightness
Date: Tue, 24 Sep 2019 21:26:25 +0200 [thread overview]
Message-ID: <91864098-a6e8-e275-4b07-e4bb15469f78@gmail.com> (raw)
In-Reply-To: <20190923100250.22326-1-jjhiblot@ti.com>
Hi Jean,
Thank you for the patch.
On 9/23/19 12:02 PM, Jean-Jacques Hiblot wrote:
> The TLC chips actually offer 257 levels:
> - 0: led OFF
> - 1-255: Led dimmed is using a PWM. The duty cycle range from 0.4% to 99.6%
> - 256: led fully ON
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
> drivers/leds/leds-tlc591xx.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
> index 8eadb673dc2e..a8911ebd30e5 100644
> --- a/drivers/leds/leds-tlc591xx.c
> +++ b/drivers/leds/leds-tlc591xx.c
> @@ -13,6 +13,7 @@
> #include <linux/slab.h>
>
> #define TLC591XX_MAX_LEDS 16
> +#define TLC591XX_MAX_BRIGHTNESS 256
>
> #define TLC591XX_REG_MODE1 0x00
> #define MODE1_RESPON_ADDR_MASK 0xF0
> @@ -112,11 +113,11 @@ tlc591xx_brightness_set(struct led_classdev *led_cdev,
> struct tlc591xx_priv *priv = led->priv;
> int err;
>
> - switch (brightness) {
> + switch ((int)brightness) {
> case 0:
> err = tlc591xx_set_ledout(priv, led, LEDOUT_OFF);
> break;
> - case LED_FULL:
> + case TLC591XX_MAX_BRIGHTNESS:
> err = tlc591xx_set_ledout(priv, led, LEDOUT_ON);
> break;
> default:
> @@ -209,7 +210,7 @@ tlc591xx_probe(struct i2c_client *client,
> led->priv = priv;
> led->led_no = reg;
> led->ldev.brightness_set_blocking = tlc591xx_brightness_set;
> - led->ldev.max_brightness = LED_FULL;
> + led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS;
> err = devm_led_classdev_register_ext(dev, &led->ldev,
> &init_data);
> if (err < 0) {
>
Added tag:
Fixes: e370d010a5fe ("leds: tlc591xx: Driver for the TI 8/16 Channel i2c
LED driver")
and applied to the for-5.5 branch.
It is also a good habit to cc the author of the driver.
Cc Andrew.
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2019-09-24 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 10:02 [PATCH] leds: tlc591xx: update the maximum brightness Jean-Jacques Hiblot
2019-09-24 19:26 ` Jacek Anaszewski [this message]
2019-10-13 11:45 ` Pavel Machek
2019-10-13 16:36 ` Jacek Anaszewski
2019-10-14 10:37 ` Jean-Jacques Hiblot
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=91864098-a6e8-e275-4b07-e4bb15469f78@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=andrew@lunn.ch \
--cc=dmurphy@ti.com \
--cc=jjhiblot@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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