소스 검색

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>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Axel Lin 14 년 전
부모
커밋
ef22f6a70c
3개의 변경된 파일18개의 추가작업 그리고 8개의 파일을 삭제
  1. 6 3
      drivers/video/backlight/ams369fg06.c
  2. 6 2
      drivers/video/backlight/ld9040.c
  3. 6 3
      drivers/video/backlight/s6e63m0.c

+ 6 - 3
drivers/video/backlight/ams369fg06.c

@@ -479,6 +479,7 @@ static int __devinit ams369fg06_probe(struct spi_device *spi)
 	struct ams369fg06 *lcd = NULL;
 	struct ams369fg06 *lcd = NULL;
 	struct lcd_device *ld = NULL;
 	struct lcd_device *ld = NULL;
 	struct backlight_device *bd = NULL;
 	struct backlight_device *bd = NULL;
+	struct backlight_properties props;
 
 
 	lcd = kzalloc(sizeof(struct ams369fg06), GFP_KERNEL);
 	lcd = kzalloc(sizeof(struct ams369fg06), GFP_KERNEL);
 	if (!lcd)
 	if (!lcd)
@@ -511,16 +512,18 @@ static int __devinit ams369fg06_probe(struct spi_device *spi)
 
 
 	lcd->ld = ld;
 	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,
 	bd = backlight_device_register("ams369fg06-bl", &spi->dev, lcd,
-		&ams369fg06_backlight_ops, NULL);
+		&ams369fg06_backlight_ops, &props);
 	if (IS_ERR(bd)) {
 	if (IS_ERR(bd)) {
 		ret =  PTR_ERR(bd);
 		ret =  PTR_ERR(bd);
 		goto out_lcd_unregister;
 		goto out_lcd_unregister;
 	}
 	}
 
 
-	bd->props.max_brightness = MAX_BRIGHTNESS;
 	bd->props.brightness = DEFAULT_BRIGHTNESS;
 	bd->props.brightness = DEFAULT_BRIGHTNESS;
-	bd->props.type = BACKLIGHT_RAW;
 	lcd->bd = bd;
 	lcd->bd = bd;
 
 
 	if (!lcd->lcd_pd->lcd_enabled) {
 	if (!lcd->lcd_pd->lcd_enabled) {

+ 6 - 2
drivers/video/backlight/ld9040.c

@@ -668,6 +668,7 @@ static int ld9040_probe(struct spi_device *spi)
 	struct ld9040 *lcd = NULL;
 	struct ld9040 *lcd = NULL;
 	struct lcd_device *ld = NULL;
 	struct lcd_device *ld = NULL;
 	struct backlight_device *bd = NULL;
 	struct backlight_device *bd = NULL;
+	struct backlight_properties props;
 
 
 	lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL);
 	lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL);
 	if (!lcd)
 	if (!lcd)
@@ -699,14 +700,17 @@ static int ld9040_probe(struct spi_device *spi)
 
 
 	lcd->ld = ld;
 	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,
 	bd = backlight_device_register("ld9040-bl", &spi->dev,
-		lcd, &ld9040_backlight_ops, NULL);
+		lcd, &ld9040_backlight_ops, &props);
 	if (IS_ERR(bd)) {
 	if (IS_ERR(bd)) {
 		ret = PTR_ERR(bd);
 		ret = PTR_ERR(bd);
 		goto out_unregister_lcd;
 		goto out_unregister_lcd;
 	}
 	}
 
 
-	bd->props.max_brightness = MAX_BRIGHTNESS;
 	bd->props.brightness = MAX_BRIGHTNESS;
 	bd->props.brightness = MAX_BRIGHTNESS;
 	lcd->bd = bd;
 	lcd->bd = bd;
 
 

+ 6 - 3
drivers/video/backlight/s6e63m0.c

@@ -738,6 +738,7 @@ static int __devinit s6e63m0_probe(struct spi_device *spi)
 	struct s6e63m0 *lcd = NULL;
 	struct s6e63m0 *lcd = NULL;
 	struct lcd_device *ld = NULL;
 	struct lcd_device *ld = NULL;
 	struct backlight_device *bd = NULL;
 	struct backlight_device *bd = NULL;
+	struct backlight_properties props;
 
 
 	lcd = kzalloc(sizeof(struct s6e63m0), GFP_KERNEL);
 	lcd = kzalloc(sizeof(struct s6e63m0), GFP_KERNEL);
 	if (!lcd)
 	if (!lcd)
@@ -769,16 +770,18 @@ static int __devinit s6e63m0_probe(struct spi_device *spi)
 
 
 	lcd->ld = ld;
 	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,
 	bd = backlight_device_register("s6e63m0bl-bl", &spi->dev, lcd,
-		&s6e63m0_backlight_ops, NULL);
+		&s6e63m0_backlight_ops, &props);
 	if (IS_ERR(bd)) {
 	if (IS_ERR(bd)) {
 		ret =  PTR_ERR(bd);
 		ret =  PTR_ERR(bd);
 		goto out_lcd_unregister;
 		goto out_lcd_unregister;
 	}
 	}
 
 
-	bd->props.max_brightness = MAX_BRIGHTNESS;
 	bd->props.brightness = MAX_BRIGHTNESS;
 	bd->props.brightness = MAX_BRIGHTNESS;
-	bd->props.type = BACKLIGHT_RAW;
 	lcd->bd = bd;
 	lcd->bd = bd;
 
 
 	/*
 	/*