Skip to content

Commit

Permalink
backlight: drop EARLY_EVENT_BLANK support
Browse files Browse the repository at this point in the history
There was no users left - so drop the code to support EARLY_EVENT_BLANK.
This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_EVENT_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

v2:
- Fix changelog to say "EARLY_EVENT_BLANK" (Daniel)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Peter Rosin <peda@axentia.se>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190725143224.GB31803@ravnborg.org
  • Loading branch information
Sam Ravnborg committed Aug 5, 2019
1 parent 5156eb8 commit e7642f3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.
8 changes: 0 additions & 8 deletions drivers/video/backlight/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ static int fb_notifier_callback(struct notifier_block *self,
if (event == FB_EVENT_BLANK) {
if (ld->ops->set_power)
ld->ops->set_power(ld, *(int *)evdata->data);
} else if (event == FB_EARLY_EVENT_BLANK) {
if (ld->ops->early_set_power)
ld->ops->early_set_power(ld,
*(int *)evdata->data);
} else if (event == FB_R_EARLY_EVENT_BLANK) {
if (ld->ops->r_early_set_power)
ld->ops->r_early_set_power(ld,
*(int *)evdata->data);
} else {
if (ld->ops->set_mode)
ld->ops->set_mode(ld, evdata->data);
Expand Down
12 changes: 1 addition & 11 deletions drivers/video/fbdev/core/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,29 +1058,19 @@ int
fb_blank(struct fb_info *info, int blank)
{
struct fb_event event;
int ret = -EINVAL, early_ret;
int ret = -EINVAL;

if (blank > FB_BLANK_POWERDOWN)
blank = FB_BLANK_POWERDOWN;

event.info = info;
event.data = &blank;

early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);

if (info->fbops->fb_blank)
ret = info->fbops->fb_blank(blank, info);

if (!ret)
fb_notifier_call_chain(FB_EVENT_BLANK, &event);
else {
/*
* if fb_blank is failed then revert effects of
* the early blank event.
*/
if (!early_ret)
fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
}

return ret;
}
Expand Down
4 changes: 0 additions & 4 deletions include/linux/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ struct fb_cursor_user {

/* A display blank is requested */
#define FB_EVENT_BLANK 0x09
/* A hardware display blank early change occurred */
#define FB_EARLY_EVENT_BLANK 0x10
/* A hardware display blank revert early change occurred */
#define FB_R_EARLY_EVENT_BLANK 0x11

struct fb_event {
struct fb_info *info;
Expand Down
10 changes: 0 additions & 10 deletions include/linux/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ struct lcd_ops {
/* Get the LCD panel power status (0: full on, 1..3: controller
power on, flat panel power off, 4: full off), see FB_BLANK_XXX */
int (*get_power)(struct lcd_device *);
/*
* Enable or disable power to the LCD(0: on; 4: off, see FB_BLANK_XXX)
* and this callback would be called proir to fb driver's callback.
*
* P.S. note that if early_set_power is not NULL then early fb notifier
* would be registered.
*/
int (*early_set_power)(struct lcd_device *, int power);
/* revert the effects of the early blank event. */
int (*r_early_set_power)(struct lcd_device *, int power);
/* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */
int (*set_power)(struct lcd_device *, int power);
/* Get the current contrast setting (0-max_contrast) */
Expand Down

0 comments on commit e7642f3

Please sign in to comment.