From: Thomas Zimmermann <tzimmermann@suse.de>
To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com,
deller@gmx.de, bonbons@linux-vserver.org, jikos@kernel.org,
bentiss@kernel.org, shc_work@mail.ru, s.hauer@pengutronix.de,
kernel@pengutronix.de, shawnguo@kernel.org, festevam@gmail.com
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-omap@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 27/28] backlight: lcd: Remove struct fb_videomode from set_mode callback
Date: Tue, 20 Aug 2024 11:23:05 +0200 [thread overview]
Message-ID: <20240820093452.68270-28-tzimmermann@suse.de> (raw)
In-Reply-To: <20240820093452.68270-1-tzimmermann@suse.de>
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>
---
drivers/video/backlight/corgi_lcd.c | 5 ++---
drivers/video/backlight/lcd.c | 4 +++-
drivers/video/backlight/tdo24m.c | 5 ++---
include/linux/lcd.h | 7 +++++--
4 files changed, 12 insertions(+), 9 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 269ca9061df4..ed2095d54df9 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -66,8 +66,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);
}
out:
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)
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 8399b5ed48f2..59a80b396a71 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -51,8 +51,11 @@ struct lcd_ops {
int (*get_contrast)(struct lcd_device *);
/* Set LCD panel contrast */
int (*set_contrast)(struct lcd_device *, int contrast);
- /* Set LCD panel mode (resolutions ...) */
- int (*set_mode)(struct lcd_device *, struct fb_videomode *);
+
+ /*
+ * Set LCD panel mode (resolutions ...)
+ */
+ int (*set_mode)(struct lcd_device *lcd, u32 xres, u32 yres);
/*
* Check if the LCD controls the given display device. This
--
2.46.0
next prev parent reply other threads:[~2024-08-20 9:35 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 9:22 [PATCH 00/28] backlight: lcd: Remove fbdev dependencies Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 01/28] backlight: lcd: Rearrange code in fb_notifier_callback() Thomas Zimmermann
2024-09-03 14:54 ` Daniel Thompson
2024-08-20 9:22 ` [PATCH 02/28] backlight: lcd: Test against struct fb_info.lcd_dev Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 03/28] backlight: lcd: Add LCD_POWER_ constants for power states Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 04/28] backlight: corgi_lcd: Use lcd power constants Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 05/28] backlight: hx8357: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 06/28] backlight: ili922x: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 07/28] backlight: ili9320: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 08/28] backlight: jornada720_lcd: Include <linux/io.h> for IOMEM() macro Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 09/28] backlight: jornada720_lcd: Use lcd power constants Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 10/28] backlight: l4f00242t03: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 11/28] backlight: lms283gf05: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 12/28] backlight: lms501kf03: Remove unnecessary include of <linux/backlight.h> Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 13/28] backlight: lms501kf03: Use lcd power constants Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 14/28] backlight: ltv350qv: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 15/28] backlight: otm3225a: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 16/28] backlight: platform_lcd: Remove include statement for <linux/backlight.h> Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 17/28] backlight: platform_lcd: Remove match_fb from struct plat_lcd_data Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 18/28] backlight: platform_lcd: Use lcd power constants Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 19/28] backlight: tdo24m: " Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 20/28] fbdev: clps711x-fb: Replace check_fb in favor of struct fb_info.lcd_dev Thomas Zimmermann
2024-08-20 9:22 ` [PATCH 21/28] fbdev: clps711x-fb: Use lcd power constants Thomas Zimmermann
2024-08-20 9:23 ` [PATCH 22/28] fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev Thomas Zimmermann
2024-08-20 9:23 ` [PATCH 23/28] fbdev: imxfb: Use lcd power constants Thomas Zimmermann
2024-08-20 9:23 ` [PATCH 24/28] fbdev: omap: " Thomas Zimmermann
2024-08-20 9:23 ` [PATCH 25/28] HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev Thomas Zimmermann
2024-08-20 23:09 ` Jiri Kosina
2024-08-20 9:23 ` [PATCH 26/28] backlight: lcd: Replace check_fb with controls_device Thomas Zimmermann
2024-09-03 14:55 ` Daniel Thompson
2024-08-20 9:23 ` Thomas Zimmermann [this message]
2024-08-20 9:23 ` [PATCH 28/28] backlight: lcd: Do not include <linux/fb.h> in lcd header Thomas Zimmermann
2024-09-03 14:58 ` [PATCH 00/28] backlight: lcd: Remove fbdev dependencies Daniel Thompson
2024-09-05 13:35 ` Thomas Zimmermann
2024-09-09 8:25 ` Lee Jones
2024-09-05 13:37 ` Thomas Zimmermann
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=20240820093452.68270-28-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=bentiss@kernel.org \
--cc=bonbons@linux-vserver.org \
--cc=daniel.thompson@linaro.org \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=jikos@kernel.org \
--cc=jingoohan1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=lee@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=shc_work@mail.ru \
/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;
as well as URLs for NNTP newsgroup(s).