All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver
@ 2009-09-17 19:27 getarunks
  2009-09-18  9:10 ` Eric Miao
  0 siblings, 1 reply; 7+ messages in thread
From: getarunks @ 2009-09-17 19:27 UTC (permalink / raw)
  To: linux-kernel, rpurdie; +Cc: eric.miao, mike, eric.y.miao, Arun KS

From: Arun KS <getarunks@gmail.com>

Signed-off-by: Arun KS <getarunks@gmail.com>
---
 drivers/video/backlight/Kconfig     |    2 +-
 drivers/video/backlight/da903x_bl.c |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 90861cd..1607bc9 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -203,7 +203,7 @@ config BACKLIGHT_DA903X
 	depends on BACKLIGHT_CLASS_DEVICE && PMIC_DA903X
 	help
 	  If you have a LCD backlight connected to the WLED output of DA9030
-	  or DA9034 WLED output, say Y here to enable this driver.
+	  or DA9034 WLED, LED1, LED2 outputs, say Y here to enable this driver.
 
 config BACKLIGHT_MBP_NVIDIA
        tristate "MacBook Pro Nvidia Backlight Driver"
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c
index 93bb434..c6ceb76 100644
--- a/drivers/video/backlight/da903x_bl.c
+++ b/drivers/video/backlight/da903x_bl.c
@@ -23,6 +23,8 @@
 #define DA9030_WLED_CP_EN	(1 << 6)
 #define DA9030_WLED_TRIM(x)	((x) & 0x7)
 
+#define DA9034_LED1_CONTROL	0x35
+#define DA9034_LED2_CONTROL	0x36
 #define DA9034_WLED_CONTROL1	0x3C
 #define DA9034_WLED_CONTROL2	0x3D
 
@@ -66,6 +68,14 @@ static int da903x_backlight_set(struct backlight_device *bl, int brightness)
 		val |= brightness ? DA9030_WLED_CP_EN : 0;
 		ret = da903x_write(dev, DA9030_WLED_CONTROL, val);
 		break;
+	case DA9034_ID_LED_1:
+		ret = da903x_update(dev, DA9034_LED1_CONTROL,
+				brightness, 0x7f);
+		break;
+	case DA9034_ID_LED_2:
+		ret = da903x_update(dev, DA9034_LED2_CONTROL,
+				brightness, 0x7f);
+		break;
 	}
 
 	if (ret)
@@ -114,6 +124,8 @@ static int da903x_backlight_probe(struct platform_device *pdev)
 		max_brightness = DA9030_MAX_BRIGHTNESS;
 		break;
 	case DA9034_ID_WLED:
+	case DA9034_ID_LED_1:
+	case DA9034_ID_LED_2:
 		max_brightness = DA9034_MAX_BRIGHTNESS;
 		break;
 	default:
-- 
1.5.4.3


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

* Re: [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver
  2009-09-17 19:27 [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver getarunks
@ 2009-09-18  9:10 ` Eric Miao
       [not found]   ` <771cded00909210049g6c7c8075pe4ca331184e39415@mail.gmail.com>
  2009-09-21 21:10   ` Richard Purdie
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Miao @ 2009-09-18  9:10 UTC (permalink / raw)
  To: 庄浩坚 (Haojian), getarunks
  Cc: linux-kernel, rpurdie, eric.miao, mike

Haojian,

Could you please help check if the patch below applies for micco?

Thanks
- eric

On Fri, Sep 18, 2009 at 3:27 AM,  <getarunks@gmail.com> wrote:
> From: Arun KS <getarunks@gmail.com>
>
> Signed-off-by: Arun KS <getarunks@gmail.com>
> ---
>  drivers/video/backlight/Kconfig     |    2 +-
>  drivers/video/backlight/da903x_bl.c |   12 ++++++++++++
>  2 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
> index 90861cd..1607bc9 100644
> --- a/drivers/video/backlight/Kconfig
> +++ b/drivers/video/backlight/Kconfig
> @@ -203,7 +203,7 @@ config BACKLIGHT_DA903X
>        depends on BACKLIGHT_CLASS_DEVICE && PMIC_DA903X
>        help
>          If you have a LCD backlight connected to the WLED output of DA9030
> -         or DA9034 WLED output, say Y here to enable this driver.
> +         or DA9034 WLED, LED1, LED2 outputs, say Y here to enable this driver.
>
>  config BACKLIGHT_MBP_NVIDIA
>        tristate "MacBook Pro Nvidia Backlight Driver"
> diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c
> index 93bb434..c6ceb76 100644
> --- a/drivers/video/backlight/da903x_bl.c
> +++ b/drivers/video/backlight/da903x_bl.c
> @@ -23,6 +23,8 @@
>  #define DA9030_WLED_CP_EN      (1 << 6)
>  #define DA9030_WLED_TRIM(x)    ((x) & 0x7)
>
> +#define DA9034_LED1_CONTROL    0x35
> +#define DA9034_LED2_CONTROL    0x36
>  #define DA9034_WLED_CONTROL1   0x3C
>  #define DA9034_WLED_CONTROL2   0x3D
>
> @@ -66,6 +68,14 @@ static int da903x_backlight_set(struct backlight_device *bl, int brightness)
>                val |= brightness ? DA9030_WLED_CP_EN : 0;
>                ret = da903x_write(dev, DA9030_WLED_CONTROL, val);
>                break;
> +       case DA9034_ID_LED_1:
> +               ret = da903x_update(dev, DA9034_LED1_CONTROL,
> +                               brightness, 0x7f);
> +               break;
> +       case DA9034_ID_LED_2:
> +               ret = da903x_update(dev, DA9034_LED2_CONTROL,
> +                               brightness, 0x7f);
> +               break;
>        }
>
>        if (ret)
> @@ -114,6 +124,8 @@ static int da903x_backlight_probe(struct platform_device *pdev)
>                max_brightness = DA9030_MAX_BRIGHTNESS;
>                break;
>        case DA9034_ID_WLED:
> +       case DA9034_ID_LED_1:
> +       case DA9034_ID_LED_2:
>                max_brightness = DA9034_MAX_BRIGHTNESS;
>                break;
>        default:
> --
> 1.5.4.3
>
>

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

* Re: [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver
       [not found]     ` <dfeb90390909211003h3b16e984q1fdf94450bdb39@mail.gmail.com>
@ 2009-09-21 17:08       ` Eric Miao
  2009-09-21 18:07         ` Arun KS
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Miao @ 2009-09-21 17:08 UTC (permalink / raw)
  To: Arun KS; +Cc: Haojian Zhuang, linux-kernel, rpurdie, eric.miao, mike

> Apparently there is a bug in the hardware design on my custom board. We are
> using LED1 for backlight control.
> Thanks Haojian for clarification.
>

Now you know that :-)

Either let your hardware engineer change the design, or there are still
workarounds, you can control the LED1/2 through the sysfs entries.

- eric

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

* Re: [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver
  2009-09-21 17:08       ` Eric Miao
@ 2009-09-21 18:07         ` Arun KS
  0 siblings, 0 replies; 7+ messages in thread
From: Arun KS @ 2009-09-21 18:07 UTC (permalink / raw)
  To: Eric Miao; +Cc: Haojian Zhuang, linux-kernel, rpurdie, eric.miao, mike

On Mon, Sep 21, 2009 at 10:08 AM, Eric Miao <eric.y.miao@gmail.com> wrote:
>
> > Apparently there is a bug in the hardware design on my custom board. We are
> > using LED1 for backlight control.
> > Thanks Haojian for clarification.
> >
>
> Now you know that :-)
>
> Either let your hardware engineer change the design, or there are still
> workarounds, you can control the LED1/2 through the sysfs entries.

If I apply the patch which I send, backlight driver is working well
through the da093x_bl.c driver.
Because LED1 driver is same as the WLED driver apart from current
level it can provide. WLED can provide max of 32mA but LED can only
provide current <500uA.

Thanks for your concern.

Arun

>
> - eric

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

* Re: [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver
  2009-09-18  9:10 ` Eric Miao
       [not found]   ` <771cded00909210049g6c7c8075pe4ca331184e39415@mail.gmail.com>
@ 2009-09-21 21:10   ` Richard Purdie
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2009-09-21 21:10 UTC (permalink / raw)
  To: Eric Miao
  Cc: 庄浩坚 (Haojian),
	getarunks, linux-kernel, eric.miao, mike

On Fri, 2009-09-18 at 17:10 +0800, Eric Miao wrote:
> Could you please help check if the patch below applies for micco?

Eric/Haojian: Please let me know if you want me to take this patch or
not...

Cheers,

Richard

> On Fri, Sep 18, 2009 at 3:27 AM,  <getarunks@gmail.com> wrote:
> > From: Arun KS <getarunks@gmail.com>
> >
> > Signed-off-by: Arun KS <getarunks@gmail.com>
> > ---
> >  drivers/video/backlight/Kconfig     |    2 +-
> >  drivers/video/backlight/da903x_bl.c |   12 ++++++++++++
> >  2 files changed, 13 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
> > index 90861cd..1607bc9 100644
> > --- a/drivers/video/backlight/Kconfig
> > +++ b/drivers/video/backlight/Kconfig
> > @@ -203,7 +203,7 @@ config BACKLIGHT_DA903X
> >        depends on BACKLIGHT_CLASS_DEVICE && PMIC_DA903X
> >        help
> >          If you have a LCD backlight connected to the WLED output of DA9030
> > -         or DA9034 WLED output, say Y here to enable this driver.
> > +         or DA9034 WLED, LED1, LED2 outputs, say Y here to enable this driver.
> >
> >  config BACKLIGHT_MBP_NVIDIA
> >        tristate "MacBook Pro Nvidia Backlight Driver"
> 


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

* [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver
@ 2009-09-17 19:30 getarunks
  0 siblings, 0 replies; 7+ messages in thread
From: getarunks @ 2009-09-17 19:30 UTC (permalink / raw)
  To: linux-kernel, rpurdie; +Cc: eric.miao, mike, eric.y.miao, Arun KS

From: Arun KS <getarunks@gmail.com>

Signed-off-by: Arun KS <getarunks@gmail.com>
---
 drivers/video/backlight/Kconfig     |    2 +-
 drivers/video/backlight/da903x_bl.c |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 90861cd..1607bc9 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -203,7 +203,7 @@ config BACKLIGHT_DA903X
 	depends on BACKLIGHT_CLASS_DEVICE && PMIC_DA903X
 	help
 	  If you have a LCD backlight connected to the WLED output of DA9030
-	  or DA9034 WLED output, say Y here to enable this driver.
+	  or DA9034 WLED, LED1, LED2 outputs, say Y here to enable this driver.
 
 config BACKLIGHT_MBP_NVIDIA
        tristate "MacBook Pro Nvidia Backlight Driver"
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c
index 93bb434..c6ceb76 100644
--- a/drivers/video/backlight/da903x_bl.c
+++ b/drivers/video/backlight/da903x_bl.c
@@ -23,6 +23,8 @@
 #define DA9030_WLED_CP_EN	(1 << 6)
 #define DA9030_WLED_TRIM(x)	((x) & 0x7)
 
+#define DA9034_LED1_CONTROL	0x35
+#define DA9034_LED2_CONTROL	0x36
 #define DA9034_WLED_CONTROL1	0x3C
 #define DA9034_WLED_CONTROL2	0x3D
 
@@ -66,6 +68,14 @@ static int da903x_backlight_set(struct backlight_device *bl, int brightness)
 		val |= brightness ? DA9030_WLED_CP_EN : 0;
 		ret = da903x_write(dev, DA9030_WLED_CONTROL, val);
 		break;
+	case DA9034_ID_LED_1:
+		ret = da903x_update(dev, DA9034_LED1_CONTROL,
+				brightness, 0x7f);
+		break;
+	case DA9034_ID_LED_2:
+		ret = da903x_update(dev, DA9034_LED2_CONTROL,
+				brightness, 0x7f);
+		break;
 	}
 
 	if (ret)
@@ -114,6 +124,8 @@ static int da903x_backlight_probe(struct platform_device *pdev)
 		max_brightness = DA9030_MAX_BRIGHTNESS;
 		break;
 	case DA9034_ID_WLED:
+	case DA9034_ID_LED_1:
+	case DA9034_ID_LED_2:
 		max_brightness = DA9034_MAX_BRIGHTNESS;
 		break;
 	default:
-- 
1.5.4.3


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

* [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver
@ 2009-09-17 18:56 getarunks
  0 siblings, 0 replies; 7+ messages in thread
From: getarunks @ 2009-09-17 18:56 UTC (permalink / raw)
  To: linux-kernel, rpurdie; +Cc: eric.miao, mike, Arun KS

From: Arun KS <getarunks@gmail.com>

Signed-off-by: Arun KS <getarunks@gmail.com>
---
 drivers/video/backlight/da903x_bl.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c
index 93bb434..a056074 100644
--- a/drivers/video/backlight/da903x_bl.c
+++ b/drivers/video/backlight/da903x_bl.c
@@ -23,6 +23,8 @@
 #define DA9030_WLED_CP_EN	(1 << 6)
 #define DA9030_WLED_TRIM(x)	((x) & 0x7)
 
+#define DA9034_LED1_CONTROL	0x35
+#define DA9034_LED1_CONTROL	0x36
 #define DA9034_WLED_CONTROL1	0x3C
 #define DA9034_WLED_CONTROL2	0x3D
 
@@ -66,6 +68,14 @@ static int da903x_backlight_set(struct backlight_device *bl, int brightness)
 		val |= brightness ? DA9030_WLED_CP_EN : 0;
 		ret = da903x_write(dev, DA9030_WLED_CONTROL, val);
 		break;
+	case DA9034_ID_LED_1:
+		ret = da903x_update(dev, DA9034_LED1_CONTROL,
+				brightness, 0x7f);
+		break;
+	case DA9034_ID_LED_2:
+		ret = da903x_update(dev, DA9034_LED2_CONTROL,
+				brightness, 0x7f);
+		break;
 	}
 
 	if (ret)
@@ -114,6 +124,8 @@ static int da903x_backlight_probe(struct platform_device *pdev)
 		max_brightness = DA9030_MAX_BRIGHTNESS;
 		break;
 	case DA9034_ID_WLED:
+	case DA9034_ID_LED_1:
+	case DA9034_ID_LED_2:
 		max_brightness = DA9034_MAX_BRIGHTNESS;
 		break;
 	default:
-- 
1.5.4.3


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

end of thread, other threads:[~2009-09-22 14:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-17 19:27 [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver getarunks
2009-09-18  9:10 ` Eric Miao
     [not found]   ` <771cded00909210049g6c7c8075pe4ca331184e39415@mail.gmail.com>
     [not found]     ` <dfeb90390909211003h3b16e984q1fdf94450bdb39@mail.gmail.com>
2009-09-21 17:08       ` Eric Miao
2009-09-21 18:07         ` Arun KS
2009-09-21 21:10   ` Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2009-09-17 19:30 getarunks
2009-09-17 18:56 getarunks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.