linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/7] leds-lm3530: add 'name' in lm3530_platform_data
@ 2012-01-20  1:47 ` Kim, Milo
  2012-01-23 19:09   ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Kim, Milo @ 2012-01-20  1:47 UTC (permalink / raw)
  To: Linus Walleij, shreshthakumar.sahu; +Cc: linux-kernel, rpurdie

The led device name can be configurable.
For the compatibility, the name is set to default value(LM3530_LED_DEV)
when 'name' is not defined.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>

diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c
index 3135734..963a1db 100644
--- a/drivers/leds/leds-lm3530.c
+++ b/drivers/leds/leds-lm3530.c
@@ -341,7 +341,7 @@ static int __devinit lm3530_probe(struct i2c_client *client,
 	drvdata->pdata = pdata;
 	drvdata->brightness = LED_OFF;
 	drvdata->enable = false;
-	drvdata->led_dev.name = LM3530_LED_DEV;
+	drvdata->led_dev.name = pdata->name ? pdata->name : LM3530_LED_DEV;
 	drvdata->led_dev.brightness_set = lm3530_brightness_set;
 
 	i2c_set_clientdata(client, drvdata);
diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h
index 5534d1e..513e9c3 100644
--- a/include/linux/led-lm3530.h
+++ b/include/linux/led-lm3530.h
@@ -91,6 +91,7 @@ struct lm3530_pwm_data {
  * @als1_resistor_sel: internal resistance from ALS1 input to ground
  * @als2_resistor_sel: internal resistance from ALS2 input to ground
  * @brt_val: brightness value (0-255)
+ * @name: led device name
  * @pwm_data: PWM control functions. only valid when the mode is PWM.
  */
 struct lm3530_platform_data {
@@ -110,6 +111,7 @@ struct lm3530_platform_data {
 
 	u8 brt_val;
 
+	const char *name;
 	struct lm3530_pwm_data pwm_data;
 };
 
-- 
1.7.4.1


Best Regards,
Milo (Woogyom) Kim
Texas Instruments Incorporated



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

* Re: [PATCH 2/7] leds-lm3530: add 'name' in lm3530_platform_data
  2012-01-20  1:47 ` [PATCH 2/7] leds-lm3530: add 'name' in lm3530_platform_data Kim, Milo
@ 2012-01-23 19:09   ` Linus Walleij
  2012-01-25  2:26     ` Kim, Milo
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2012-01-23 19:09 UTC (permalink / raw)
  To: Kim, Milo; +Cc: shreshthakumar.sahu, linux-kernel, rpurdie

On Fri, Jan 20, 2012 at 2:47 AM, Kim, Milo <Milo.Kim@ti.com> wrote:

> The led device name can be configurable.

OK, why?

> For the compatibility, the name is set to default value(LM3530_LED_DEV)
> when 'name' is not defined.
>
> Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>

Anyway, it doesn't hurt so for me it's:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij

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

* RE: [PATCH 2/7] leds-lm3530: add 'name' in lm3530_platform_data
  2012-01-23 19:09   ` Linus Walleij
@ 2012-01-25  2:26     ` Kim, Milo
  0 siblings, 0 replies; 3+ messages in thread
From: Kim, Milo @ 2012-01-25  2:26 UTC (permalink / raw)
  To: Linus Walleij; +Cc: shreshthakumar.sahu, linux-kernel, rpurdie


-----Original Message-----
From: Linus Walleij [mailto:linus.walleij@linaro.org] 
Sent: Tuesday, January 24, 2012 4:09 AM
To: Kim, Milo
Cc: shreshthakumar.sahu@stericsson.com; linux-kernel@vger.kernel.org; rpurdie@rpsys.net
Subject: Re: [PATCH 2/7] leds-lm3530: add 'name' in lm3530_platform_data

On Fri, Jan 20, 2012 at 2:47 AM, Kim, Milo <Milo.Kim@ti.com> wrote:

>> The led device name can be configurable.

> OK, why?

For example, there are two platforms with the lm3530.
In project A, the name of led is used as 'lcd-backlight'.
And in project B, the led name is set to 'lcd-bl'.
If an user-space accesses different name each project/platform, then lm3530 led name should be changed.

If the name can be configurable in the platform data, then no driver change needed.

Thanks & BR
Milo -


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

end of thread, other threads:[~2012-01-25  2:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AczXFXB5tuUxDiyyTP+0MvKxJb7yTg==>
2012-01-20  1:47 ` [PATCH 2/7] leds-lm3530: add 'name' in lm3530_platform_data Kim, Milo
2012-01-23 19:09   ` Linus Walleij
2012-01-25  2:26     ` Kim, Milo

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