linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] leds-lm3530: comment correction about the range of brightness
@ 2012-04-19  6:40 Kim, Milo
  2012-04-19 17:25 ` Linus Walleij
  2012-04-20  7:28 ` Shreshtha Kumar SAHU
  0 siblings, 2 replies; 5+ messages in thread
From: Kim, Milo @ 2012-04-19  6:40 UTC (permalink / raw)
  To: Andrew Morton
  Cc: shreshthakumar.sahu, linus.walleij, Richard Purdie, linux-kernel

max brightness is 127, so the range of brt_val should be from 0 to 127

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
---
 include/linux/led-lm3530.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h
index eeae6e7..4b13347 100644
--- a/include/linux/led-lm3530.h
+++ b/include/linux/led-lm3530.h
@@ -92,7 +92,7 @@ struct lm3530_pwm_data {
  * @als2_resistor_sel: internal resistance from ALS2 input to ground
  * @als_vmin: als input voltage calibrated for max brightness in mV
  * @als_vmax: als input voltage calibrated for min brightness in mV
- * @brt_val: brightness value (0-255)
+ * @brt_val: brightness value (0-127)
  * @pwm_data: PWM control functions (only valid when the mode is PWM)
  */
 struct lm3530_platform_data {
-- 
1.7.4.1


Best Regards,
Milo (Woogyom) Kim



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] leds-lm3530: comment correction about the range of brightness
  2012-04-19  6:40 [PATCH 1/2] leds-lm3530: comment correction about the range of brightness Kim, Milo
@ 2012-04-19 17:25 ` Linus Walleij
  2012-04-20  7:28 ` Shreshtha Kumar SAHU
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2012-04-19 17:25 UTC (permalink / raw)
  To: Kim, Milo
  Cc: Andrew Morton, shreshthakumar.sahu, Richard Purdie, linux-kernel

On Thu, Apr 19, 2012 at 8:40 AM, Kim, Milo <Milo.Kim@ti.com> wrote:

> max brightness is 127, so the range of brt_val should be from 0 to 127
>
> Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2] leds-lm3530: comment correction about the range of brightness
  2012-04-19  6:40 [PATCH 1/2] leds-lm3530: comment correction about the range of brightness Kim, Milo
  2012-04-19 17:25 ` Linus Walleij
@ 2012-04-20  7:28 ` Shreshtha Kumar SAHU
  2012-04-20  8:44   ` Kim, Milo
  1 sibling, 1 reply; 5+ messages in thread
From: Shreshtha Kumar SAHU @ 2012-04-20  7:28 UTC (permalink / raw)
  To: Kim, Milo; +Cc: linus.walleij, Richard Purdie, linux-kernel, Andrew Morton

I feel driver should take care of range provided by hardware by 
scaling the value provided by user, instead of limiting the max 
brightness to user.

For .e.g. here it can be something like this -
                err = i2c_smbus_write_byte_data(drvdata->client,
                                LM3530_BRT_CTRL_REG, brt_val / 2);

I am not sure if application really use/check max brightness in before 
calculating/setting new brightness values.

-----Original Message-----
From: Kim, Milo [mailto:Milo.Kim@ti.com] 
Sent: Thursday, April 19, 2012 12:11 PM
To: Andrew Morton
Cc: Shreshtha Kumar SAHU; linus.walleij@linaro.org; Richard Purdie; linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] leds-lm3530: comment correction about the range of brightness

max brightness is 127, so the range of brt_val should be from 0 to 127

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
---
 include/linux/led-lm3530.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h
index eeae6e7..4b13347 100644
--- a/include/linux/led-lm3530.h
+++ b/include/linux/led-lm3530.h
@@ -92,7 +92,7 @@ struct lm3530_pwm_data {
  * @als2_resistor_sel: internal resistance from ALS2 input to ground
  * @als_vmin: als input voltage calibrated for max brightness in mV
  * @als_vmax: als input voltage calibrated for min brightness in mV
- * @brt_val: brightness value (0-255)
+ * @brt_val: brightness value (0-127)
  * @pwm_data: PWM control functions (only valid when the mode is PWM)
  */
 struct lm3530_platform_data {
-- 
1.7.4.1


Best Regards,
Milo (Woogyom) Kim



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2] leds-lm3530: comment correction about the range of brightness
  2012-04-20  7:28 ` Shreshtha Kumar SAHU
@ 2012-04-20  8:44   ` Kim, Milo
  2012-04-20 10:24     ` Shreshtha Kumar SAHU
  0 siblings, 1 reply; 5+ messages in thread
From: Kim, Milo @ 2012-04-20  8:44 UTC (permalink / raw)
  To: Shreshtha Kumar SAHU
  Cc: linus.walleij, Richard Purdie, linux-kernel, Andrew Morton


In the previous patch, max brightness was limited to 127 because only 7 bits are used in the brightness register.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=bbe6453204c568723679212f6d0653b92b3d6244

With this patch, 128 ~ 255 is invalid range of brightness, so comment needs to be corrected.
(Even if the brt_val is greater than 127, the brightness will be set as max_brightness - 127)

Thanks & BR
Milo -

> -----Original Message-----
> From: Shreshtha Kumar SAHU [mailto:shreshthakumar.sahu@stericsson.com]
> Sent: Friday, April 20, 2012 4:29 PM
> To: Kim, Milo
> Cc: linus.walleij@linaro.org; Richard Purdie; linux-
> kernel@vger.kernel.org; Andrew Morton
> Subject: RE: [PATCH 1/2] leds-lm3530: comment correction about the
> range of brightness
> 
> I feel driver should take care of range provided by hardware by
> scaling the value provided by user, instead of limiting the max
> brightness to user.
> 
> For .e.g. here it can be something like this -
>                 err = i2c_smbus_write_byte_data(drvdata->client,
>                                 LM3530_BRT_CTRL_REG, brt_val / 2);
> 
> I am not sure if application really use/check max brightness in before
> calculating/setting new brightness values.
> 
> -----Original Message-----
> From: Kim, Milo [mailto:Milo.Kim@ti.com]
> Sent: Thursday, April 19, 2012 12:11 PM
> To: Andrew Morton
> Cc: Shreshtha Kumar SAHU; linus.walleij@linaro.org; Richard Purdie;
> linux-kernel@vger.kernel.org
> Subject: [PATCH 1/2] leds-lm3530: comment correction about the range of
> brightness
> 
> max brightness is 127, so the range of brt_val should be from 0 to 127
> 
> Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
> ---
>  include/linux/led-lm3530.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h
> index eeae6e7..4b13347 100644
> --- a/include/linux/led-lm3530.h
> +++ b/include/linux/led-lm3530.h
> @@ -92,7 +92,7 @@ struct lm3530_pwm_data {
>   * @als2_resistor_sel: internal resistance from ALS2 input to ground
>   * @als_vmin: als input voltage calibrated for max brightness in mV
>   * @als_vmax: als input voltage calibrated for min brightness in mV
> - * @brt_val: brightness value (0-255)
> + * @brt_val: brightness value (0-127)
>   * @pwm_data: PWM control functions (only valid when the mode is PWM)
>   */
>  struct lm3530_platform_data {
> --
> 1.7.4.1
> 
> 
> Best Regards,
> Milo (Woogyom) Kim
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2] leds-lm3530: comment correction about the range of brightness
  2012-04-20  8:44   ` Kim, Milo
@ 2012-04-20 10:24     ` Shreshtha Kumar SAHU
  0 siblings, 0 replies; 5+ messages in thread
From: Shreshtha Kumar SAHU @ 2012-04-20 10:24 UTC (permalink / raw)
  To: Kim, Milo; +Cc: linus.walleij, Richard Purdie, linux-kernel, Andrew Morton

IMHO it should be hidden inside driver. For example if hardware supports >8 bits for 
brightness then too we scale/map 0-255 to supported range in hardware.

BR
Shreshtha

-----Original Message-----
From: Kim, Milo [mailto:Milo.Kim@ti.com] 
Sent: Friday, April 20, 2012 2:14 PM
To: Shreshtha Kumar SAHU
Cc: linus.walleij@linaro.org; Richard Purdie; linux-kernel@vger.kernel.org; Andrew Morton
Subject: RE: [PATCH 1/2] leds-lm3530: comment correction about the range of brightness


In the previous patch, max brightness was limited to 127 because only 7 bits are used in the brightness register.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=bbe6453204c568723679212f6d0653b92b3d6244

With this patch, 128 ~ 255 is invalid range of brightness, so comment needs to be corrected.
(Even if the brt_val is greater than 127, the brightness will be set as max_brightness - 127)

Thanks & BR
Milo -

> -----Original Message-----
> From: Shreshtha Kumar SAHU [mailto:shreshthakumar.sahu@stericsson.com]
> Sent: Friday, April 20, 2012 4:29 PM
> To: Kim, Milo
> Cc: linus.walleij@linaro.org; Richard Purdie; linux-
> kernel@vger.kernel.org; Andrew Morton
> Subject: RE: [PATCH 1/2] leds-lm3530: comment correction about the
> range of brightness
> 
> I feel driver should take care of range provided by hardware by
> scaling the value provided by user, instead of limiting the max
> brightness to user.
> 
> For .e.g. here it can be something like this -
>                 err = i2c_smbus_write_byte_data(drvdata->client,
>                                 LM3530_BRT_CTRL_REG, brt_val / 2);
> 
> I am not sure if application really use/check max brightness in before
> calculating/setting new brightness values.
> 
> -----Original Message-----
> From: Kim, Milo [mailto:Milo.Kim@ti.com]
> Sent: Thursday, April 19, 2012 12:11 PM
> To: Andrew Morton
> Cc: Shreshtha Kumar SAHU; linus.walleij@linaro.org; Richard Purdie;
> linux-kernel@vger.kernel.org
> Subject: [PATCH 1/2] leds-lm3530: comment correction about the range of
> brightness
> 
> max brightness is 127, so the range of brt_val should be from 0 to 127
> 
> Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
> ---
>  include/linux/led-lm3530.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h
> index eeae6e7..4b13347 100644
> --- a/include/linux/led-lm3530.h
> +++ b/include/linux/led-lm3530.h
> @@ -92,7 +92,7 @@ struct lm3530_pwm_data {
>   * @als2_resistor_sel: internal resistance from ALS2 input to ground
>   * @als_vmin: als input voltage calibrated for max brightness in mV
>   * @als_vmax: als input voltage calibrated for min brightness in mV
> - * @brt_val: brightness value (0-255)
> + * @brt_val: brightness value (0-127)
>   * @pwm_data: PWM control functions (only valid when the mode is PWM)
>   */
>  struct lm3530_platform_data {
> --
> 1.7.4.1
> 
> 
> Best Regards,
> Milo (Woogyom) Kim
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-20 10:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19  6:40 [PATCH 1/2] leds-lm3530: comment correction about the range of brightness Kim, Milo
2012-04-19 17:25 ` Linus Walleij
2012-04-20  7:28 ` Shreshtha Kumar SAHU
2012-04-20  8:44   ` Kim, Milo
2012-04-20 10:24     ` Shreshtha Kumar SAHU

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).