diff options
-rw-r--r-- | drivers/video/backlight/lcd.c | 10 | ||||
-rw-r--r-- | include/linux/lcd.h | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 79c1b0d609a8..1c298d5bf3af 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
@@ -32,6 +32,8 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
32 | case FB_EVENT_BLANK: | 32 | case FB_EVENT_BLANK: |
33 | case FB_EVENT_MODE_CHANGE: | 33 | case FB_EVENT_MODE_CHANGE: |
34 | case FB_EVENT_MODE_CHANGE_ALL: | 34 | case FB_EVENT_MODE_CHANGE_ALL: |
35 | case FB_EARLY_EVENT_BLANK: | ||
36 | case FB_R_EARLY_EVENT_BLANK: | ||
35 | break; | 37 | break; |
36 | default: | 38 | default: |
37 | return 0; | 39 | return 0; |
@@ -46,6 +48,14 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
46 | if (event == FB_EVENT_BLANK) { | 48 | if (event == FB_EVENT_BLANK) { |
47 | if (ld->ops->set_power) | 49 | if (ld->ops->set_power) |
48 | ld->ops->set_power(ld, *(int *)evdata->data); | 50 | ld->ops->set_power(ld, *(int *)evdata->data); |
51 | } else if (event == FB_EARLY_EVENT_BLANK) { | ||
52 | if (ld->ops->early_set_power) | ||
53 | ld->ops->early_set_power(ld, | ||
54 | *(int *)evdata->data); | ||
55 | } else if (event == FB_R_EARLY_EVENT_BLANK) { | ||
56 | if (ld->ops->r_early_set_power) | ||
57 | ld->ops->r_early_set_power(ld, | ||
58 | *(int *)evdata->data); | ||
49 | } else { | 59 | } else { |
50 | if (ld->ops->set_mode) | 60 | if (ld->ops->set_mode) |
51 | ld->ops->set_mode(ld, evdata->data); | 61 | ld->ops->set_mode(ld, evdata->data); |
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 8877123f2d6e..e00c3b0ebc6b 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -40,6 +40,16 @@ struct lcd_ops { | |||
40 | /* Get the LCD panel power status (0: full on, 1..3: controller | 40 | /* Get the LCD panel power status (0: full on, 1..3: controller |
41 | power on, flat panel power off, 4: full off), see FB_BLANK_XXX */ | 41 | power on, flat panel power off, 4: full off), see FB_BLANK_XXX */ |
42 | int (*get_power)(struct lcd_device *); | 42 | int (*get_power)(struct lcd_device *); |
43 | /* | ||
44 | * Enable or disable power to the LCD(0: on; 4: off, see FB_BLANK_XXX) | ||
45 | * and this callback would be called proir to fb driver's callback. | ||
46 | * | ||
47 | * P.S. note that if early_set_power is not NULL then early fb notifier | ||
48 | * would be registered. | ||
49 | */ | ||
50 | int (*early_set_power)(struct lcd_device *, int power); | ||
51 | /* revert the effects of the early blank event. */ | ||
52 | int (*r_early_set_power)(struct lcd_device *, int power); | ||
43 | /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ | 53 | /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ |
44 | int (*set_power)(struct lcd_device *, int power); | 54 | int (*set_power)(struct lcd_device *, int power); |
45 | /* Get the current contrast setting (0-max_contrast) */ | 55 | /* Get the current contrast setting (0-max_contrast) */ |