From: JinGoo Han <jg1.han@samsung.com>
To: Axel Lin <axel.lin@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Matthew Garrett <mjg@redhat.com>,
JinGoo Han <jg1.han@samsung.com>,
Donghwa Lee <dh09.lee@samsung.com>,
In-Ki Dae <inki.dae@samsung.com>,
Richard Purdie <rpurdie@rpsys.net>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] backlight: Set backlight type and max_brightness before backlights are registered
Date: Tue, 05 Jul 2011 06:07:20 +0000 (GMT) [thread overview]
Message-ID: <11756226.359271309846040127.JavaMail.weblogic@epml17> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 4706 bytes --]
Acked-by: Jingoo Han <jg1.han@samsung.com>
The ams369fg06 driver is tested.
> -----Original Message-----
> From: Axel Lin [mailto:axel.lin@gmail.com]
> Sent: Tuesday, July 05, 2011 1:38 PM
> To: linux-kernel@vger.kernel.org
> Cc: Matthew Garrett; Jingoo Han; Donghwa Lee; InKi Dae; Richard Purdie;
> Andrew Morton
> Subject: [PATCH] backlight: Set backlight type and max_brightness before
> backlights are registered
>
> Since commit a19a6ee "backlight: Allow properties to be passed at
> registration"
> and commit bb7ca74 "backlight: add backlight type",
> we can set backlight type and max_brightness before backlights are
> registered.
> Some newly added drivers did not set it properly, let's fix it.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> Cc: Matthew Garrett <mjg@redhat.com>
> Cc: Jingoo Han <jg1.han@samsung.com>
> Cc: Donghwa Lee <dh09.lee@samsung.com>
> Cc: InKi Dae <inki.dae@samsung.com>
> ---
> drivers/video/backlight/ams369fg06.c | 9 ++++++---
> drivers/video/backlight/ld9040.c | 8 ++++++--
> drivers/video/backlight/s6e63m0.c | 9 ++++++---
> 3 files changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/video/backlight/ams369fg06.c
> b/drivers/video/backlight/ams369fg06.c
> index 6462d05..201a593 100644
> --- a/drivers/video/backlight/ams369fg06.c
> +++ b/drivers/video/backlight/ams369fg06.c
> @@ -479,6 +479,7 @@ static int __init ams369fg06_probe(struct spi_device
> *spi)
> struct ams369fg06 *lcd = NULL;
> struct lcd_device *ld = NULL;
> struct backlight_device *bd = NULL;
> + struct backlight_properties props;
>
> lcd = kzalloc(sizeof(struct ams369fg06), GFP_KERNEL);
> if (!lcd)
> @@ -511,16 +512,18 @@ static int __init ams369fg06_probe(struct spi_device
> *spi)
>
> lcd->ld = ld;
>
> + memset(&props, 0, sizeof(struct backlight_properties));
> + props.type = BACKLIGHT_RAW;
> + props.max_brightness = MAX_BRIGHTNESS;
> +
> bd = backlight_device_register("ams369fg06-bl", &spi->dev, lcd,
> - &ams369fg06_backlight_ops, NULL);
> + &ams369fg06_backlight_ops, &props);
> if (IS_ERR(bd)) {
> ret = PTR_ERR(bd);
> goto out_lcd_unregister;
> }
>
> - bd->props.max_brightness = MAX_BRIGHTNESS;
> bd->props.brightness = DEFAULT_BRIGHTNESS;
> - bd->props.type = BACKLIGHT_RAW;
> lcd->bd = bd;
>
> if (!lcd->lcd_pd->lcd_enabled) {
> diff --git a/drivers/video/backlight/ld9040.c
> b/drivers/video/backlight/ld9040.c
> index 62bcde3..5934655 100644
> --- a/drivers/video/backlight/ld9040.c
> +++ b/drivers/video/backlight/ld9040.c
> @@ -668,6 +668,7 @@ static int ld9040_probe(struct spi_device *spi)
> struct ld9040 *lcd = NULL;
> struct lcd_device *ld = NULL;
> struct backlight_device *bd = NULL;
> + struct backlight_properties props;
>
> lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL);
> if (!lcd)
> @@ -699,14 +700,17 @@ static int ld9040_probe(struct spi_device *spi)
>
> lcd->ld = ld;
>
> + memset(&props, 0, sizeof(struct backlight_properties));
> + props.type = BACKLIGHT_RAW;
> + props.max_brightness = MAX_BRIGHTNESS;
> +
> bd = backlight_device_register("ld9040-bl", &spi->dev,
> - lcd, &ld9040_backlight_ops, NULL);
> + lcd, &ld9040_backlight_ops, &props);
> if (IS_ERR(bd)) {
> ret = PTR_ERR(bd);
> goto out_unregister_lcd;
> }
>
> - bd->props.max_brightness = MAX_BRIGHTNESS;
> bd->props.brightness = MAX_BRIGHTNESS;
> lcd->bd = bd;
>
> diff --git a/drivers/video/backlight/s6e63m0.c
> b/drivers/video/backlight/s6e63m0.c
> index e1803ba..694e5aa 100644
> --- a/drivers/video/backlight/s6e63m0.c
> +++ b/drivers/video/backlight/s6e63m0.c
> @@ -738,6 +738,7 @@ static int __devinit s6e63m0_probe(struct spi_device
> *spi)
> struct s6e63m0 *lcd = NULL;
> struct lcd_device *ld = NULL;
> struct backlight_device *bd = NULL;
> + struct backlight_properties props;
>
> lcd = kzalloc(sizeof(struct s6e63m0), GFP_KERNEL);
> if (!lcd)
> @@ -769,16 +770,18 @@ static int __devinit s6e63m0_probe(struct spi_device
> *spi)
>
> lcd->ld = ld;
>
> + memset(&props, 0, sizeof(struct backlight_properties));
> + props.type = BACKLIGHT_RAW;
> + props.max_brightness = MAX_BRIGHTNESS;
> +
> bd = backlight_device_register("s6e63m0bl-bl", &spi->dev, lcd,
> - &s6e63m0_backlight_ops, NULL);
> + &s6e63m0_backlight_ops, &props);
> if (IS_ERR(bd)) {
> ret = PTR_ERR(bd);
> goto out_lcd_unregister;
> }
>
> - bd->props.max_brightness = MAX_BRIGHTNESS;
> bd->props.brightness = MAX_BRIGHTNESS;
> - bd->props.type = BACKLIGHT_RAW;
> lcd->bd = bd;
>
> /*
> --
> 1.7.4.1
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next reply other threads:[~2011-07-05 6:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 6:07 JinGoo Han [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-07-05 4:37 [PATCH] backlight: Set backlight type and max_brightness before backlights are registered Axel Lin
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=11756226.359271309846040127.JavaMail.weblogic@epml17 \
--to=jg1.han@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=axel.lin@gmail.com \
--cc=dh09.lee@samsung.com \
--cc=inki.dae@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.com \
--cc=rpurdie@rpsys.net \
/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