Re: [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver

From: Eric Miao
Date: Fri Sep 18 2009 - 05:10:32 EST


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@xxxxxxxxx> wrote:
> From: Arun KS <getarunks@xxxxxxxxx>
>
> Signed-off-by: Arun KS <getarunks@xxxxxxxxx>
> ---
> Â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
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/