diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2024-09-06 09:52:41 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-09-30 16:49:42 +0100 |
commit | 02e224d096ef58fe59e96609de6018e133f33512 (patch) | |
tree | ffd802c4c4ccc97f4110629ca5c7cc8937936241 /drivers/video | |
parent | 43e1120deb3768c86aa3875c7073658e44a30ea5 (diff) |
backlight: lcd: Remove struct fb_videomode from set_mode callback
Implementations of struct lcd_ops.set_mode only require the resolution
from struct fb_videomode. Pass the xres and yres fields, but remove the
dependency on the fbdev data structure.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20240906075439.98476-28-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/corgi_lcd.c | 5 | ||||
-rw-r--r-- | drivers/video/backlight/lcd.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/tdo24m.c | 5 |
3 files changed, 7 insertions, 7 deletions
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index 35c3fd3281ca..69f49371ea35 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c @@ -17,7 +17,6 @@ #include <linux/init.h> #include <linux/delay.h> #include <linux/gpio/consumer.h> -#include <linux/fb.h> #include <linux/lcd.h> #include <linux/spi/spi.h> #include <linux/spi/corgi_lcd.h> @@ -332,12 +331,12 @@ static void corgi_lcd_power_off(struct corgi_lcd *lcd) POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF); } -static int corgi_lcd_set_mode(struct lcd_device *ld, struct fb_videomode *m) +static int corgi_lcd_set_mode(struct lcd_device *ld, u32 xres, u32 yres) { struct corgi_lcd *lcd = lcd_get_data(ld); int mode = CORGI_LCD_MODE_QVGA; - if (m->xres == 640 || m->xres == 480) + if (xres == 640 || xres == 480) mode = CORGI_LCD_MODE_VGA; if (lcd->mode == mode) diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index dd175b446180..3267acf8dc5b 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -65,8 +65,10 @@ static int fb_notifier_callback(struct notifier_block *self, if (ld->ops->set_power) ld->ops->set_power(ld, power); } else { + const struct fb_videomode *videomode = evdata->data; + if (ld->ops->set_mode) - ld->ops->set_mode(ld, evdata->data); + ld->ops->set_mode(ld, videomode->xres, videomode->yres); } return 0; diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c index a14a94114e9d..c04ee3d04d87 100644 --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c @@ -12,7 +12,6 @@ #include <linux/device.h> #include <linux/spi/spi.h> #include <linux/spi/tdo24m.h> -#include <linux/fb.h> #include <linux/lcd.h> #include <linux/slab.h> @@ -308,12 +307,12 @@ static int tdo24m_get_power(struct lcd_device *ld) return lcd->power; } -static int tdo24m_set_mode(struct lcd_device *ld, struct fb_videomode *m) +static int tdo24m_set_mode(struct lcd_device *ld, u32 xres, u32 yres) { struct tdo24m *lcd = lcd_get_data(ld); int mode = MODE_QVGA; - if (m->xres == 640 || m->xres == 480) + if (xres == 640 || xres == 480) mode = MODE_VGA; if (lcd->mode == mode) |