From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:45
This series removes most dependencies on fbdev from the lcd subsystem
and its drivers.
Patches 1 to 3 rework the fbdev notifier, the fbdev's fb_info can
now refer to a dedicated lcd device, and lcd defines constants for
power states. These changes resemble similar changes to the backlight
code.
Patches 4 to 19 update lcd drivers to the new interfaces and perform
minor cleanups during the process. Patches 20 to 24 update fbdev
drivers and patch 25 updates the picolcd driver from the hid subsystem.
Patches 25 to 28 finally clean up various lcd interfaces and files.
This patchset is part of a larger effort to implement the lcd code
without depending on fbdev. Similar patches have been sent out for
the backlight subsystem, such as in [1] and [2].
Hopefully this series can be merged at once through the lcd tree.
v2:
- use guard(mutex) (Daniel)
- fix typos in various commit descriptions (Daniel)
[1] https://patchwork.freedesktop.org/series/129782/
[2] https://patchwork.freedesktop.org/series/134718/
Thomas Zimmermann (28):
backlight: lcd: Rearrange code in fb_notifier_callback()
backlight: lcd: Test against struct fb_info.lcd_dev
backlight: lcd: Add LCD_POWER_ constants for power states
backlight: corgi_lcd: Use lcd power constants
backlight: hx8357: Use lcd power constants
backlight: ili922x: Use lcd power constants
backlight: ili9320: Use lcd power constants
backlight: jornada720_lcd: Include <linux/io.h> for IOMEM() macro
backlight: jornada720_lcd: Use lcd power constants
backlight: l4f00242t03: Use lcd power constants
backlight: lms283gf05: Use lcd power constants
backlight: lms501kf03: Remove unnecessary include of
<linux/backlight.h>
backlight: lms501kf03: Use lcd power constants
backlight: ltv350qv: Use lcd power constants
backlight: otm3225a: Use lcd power constants
backlight: platform_lcd: Remove include statement for
<linux/backlight.h>
backlight: platform_lcd: Remove match_fb from struct plat_lcd_data
backlight: platform_lcd: Use lcd power constants
backlight: tdo24m: Use lcd power constants
fbdev: clps711x-fb: Replace check_fb in favor of struct
fb_info.lcd_dev
fbdev: clps711x-fb: Use lcd power constants
fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev
fbdev: imxfb: Use lcd power constants
fbdev: omap: Use lcd power constants
HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev
backlight: lcd: Replace check_fb with controls_device
backlight: lcd: Remove struct fb_videomode from set_mode callback
backlight: lcd: Do not include <linux/fb.h> in lcd header
drivers/hid/hid-picolcd_fb.c | 4 ++
drivers/hid/hid-picolcd_lcd.c | 6 ---
drivers/video/backlight/corgi_lcd.c | 17 ++++----
drivers/video/backlight/hx8357.c | 2 +-
drivers/video/backlight/ili922x.c | 7 ++--
drivers/video/backlight/ili9320.c | 15 ++++---
drivers/video/backlight/jornada720_lcd.c | 10 ++---
drivers/video/backlight/l4f00242t03.c | 32 +++++++--------
drivers/video/backlight/lcd.c | 50 ++++++++++++++++++------
drivers/video/backlight/lms283gf05.c | 2 +-
drivers/video/backlight/lms501kf03.c | 24 ++++++------
drivers/video/backlight/ltv350qv.c | 15 ++++---
drivers/video/backlight/otm3225a.c | 2 +-
drivers/video/backlight/platform_lcd.c | 20 ++++------
drivers/video/backlight/tdo24m.c | 19 +++++----
drivers/video/fbdev/clps711x-fb.c | 29 ++++++--------
drivers/video/fbdev/imxfb.c | 32 ++++++---------
drivers/video/fbdev/omap/lcd_ams_delta.c | 8 ++--
include/linux/fb.h | 13 ++++++
include/linux/lcd.h | 29 ++++++++++----
include/video/platform_lcd.h | 3 --
21 files changed, 181 insertions(+), 158 deletions(-)
--
2.46.0
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:45
First acquire the ops_lock and do all tests while holding it. Rearranges
the code in lcd's fb_notifier_callback() to resemble the callback in
the backlight module. This will simplify later changes to these tests.
v2:
- avoid gotos by using guard(mutex) (Daniel)
- fix typos in commit description (Daniel)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/lcd.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:47
Add struct fb_info.lcd_dev for fbdev drivers to store a reference to
their lcd device. Update the lcd's fb_notifier_callback() to test for
this field. The lcd module can now detect if an lcd device belongs to
an fbdev device.
This works similar to the bl_dev for backlights and will allow for
the removal of the check_fb callback from several fbdev driver's lcd
devices.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/lcd.c | 3 +++
include/linux/fb.h | 13 +++++++++++++
2 files changed, 16 insertions(+)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:48
Duplicate FB_BLANK_ constants as LCD_POWER_ constants in the lcd
header file. Allows lcd drivers to avoid including the fbdev header
file and removes a compile-time dependency between the two subsystems.
The new LCD_POWER_ constants have the same values as their
FB_BLANK_ counterparts. Hence semantics does not change and the lcd
drivers can be converted one by one. Each instance of FB_BLANK_UNBLANK
becomes LCD_POWER_ON, each of FB_BLANK_POWERDOWN becomes LCD_POWER_OFF,
FB_BLANK_NORMAL becomes LCD_POWER_REDUCED and FB_BLANK_VSYNC_SUSPEND
becomes LCD_POWER_REDUCED_VSYNC_SUSPEND.
Lcd code or drivers do not use FB_BLANK_HSYNC_SUSPEND, so no
new constants for this is being added. The tokens LCD_POWER_REDUCED
and LCD_POWER_REDUCED_VSYNC_SUSPEND are deprecated and drivers should
replace them with LCD_POWER_ON and LCD_POWER_OFF.
See also commit a1cacb8a8e70 ("backlight: Add BACKLIGHT_POWER_ constants
for power states"), which added similar constants for backlight drivers.
v2:
- fix typo in commit description
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/lcd.c | 22 +++++++++++++++++++++-
include/linux/lcd.h | 5 +++++
2 files changed, 26 insertions(+), 1 deletion(-)
@@ -20,6 +20,24 @@#if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \defined(CONFIG_LCD_CLASS_DEVICE_MODULE))+staticintto_lcd_power(intfb_blank)+{+switch(fb_blank){+caseFB_BLANK_UNBLANK:+returnLCD_POWER_ON;+/* deprecated; TODO: should become 'off' */+caseFB_BLANK_NORMAL:+returnLCD_POWER_REDUCED;+caseFB_BLANK_VSYNC_SUSPEND:+returnLCD_POWER_REDUCED_VSYNC_SUSPEND;+/* 'off' */+caseFB_BLANK_HSYNC_SUSPEND:+caseFB_BLANK_POWERDOWN:+default:+returnLCD_POWER_OFF;+}+}+/* This callback gets called when something important happens inside a*framebufferdriver.We'relookingifthatimportanteventisblanking,*andifitis,we'reswitchinglcdpoweraswell...
@@ -42,8 +60,10 @@ static int fb_notifier_callback(struct notifier_block *self,return0;if(event==FB_EVENT_BLANK){+intpower=to_lcd_power(*(int*)evdata->data);+if(ld->ops->set_power)-ld->ops->set_power(ld,*(int*)evdata->data);+ld->ops->set_power(ld,power);}else{if(ld->ops->set_mode)ld->ops->set_mode(ld,evdata->data);
@@ -14,6 +14,11 @@#include<linux/notifier.h>#include<linux/fb.h>+#define LCD_POWER_ON (0)+#define LCD_POWER_REDUCED (1) // deprecated; don't use in new code+#define LCD_POWER_REDUCED_VSYNC_SUSPEND (2) // deprecated; don't use in new code+#define LCD_POWER_OFF (4)+/* Notes on locking:**lcd_device->ops_lockisaninternalbacklightlockprotectingtheops
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:49
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/corgi_lcd.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:50
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/l4f00242t03.c | 32 +++++++++++++--------------
1 file changed, 16 insertions(+), 16 deletions(-)
@@ -112,40 +112,40 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)constu16slpin=0x10;constu16disoff=0x28;-if(power<=FB_BLANK_NORMAL){-if(priv->lcd_state<=FB_BLANK_NORMAL){+if(power<=LCD_POWER_REDUCED){+if(priv->lcd_state<=LCD_POWER_REDUCED){/* Do nothing, the LCD is running */-}elseif(priv->lcd_state<FB_BLANK_POWERDOWN){+}elseif(priv->lcd_state<LCD_POWER_OFF){dev_dbg(&spi->dev,"Resuming LCD\n");spi_write(spi,(constu8*)&slpout,sizeof(u16));msleep(60);spi_write(spi,(constu8*)&dison,sizeof(u16));}else{-/* priv->lcd_state == FB_BLANK_POWERDOWN */+/* priv->lcd_state == LCD_POWER_OFF */l4f00242t03_lcd_init(spi);-priv->lcd_state=FB_BLANK_VSYNC_SUSPEND;+priv->lcd_state=LCD_POWER_REDUCED_VSYNC_SUSPEND;l4f00242t03_lcd_power_set(priv->ld,power);}-}elseif(power<FB_BLANK_POWERDOWN){-if(priv->lcd_state<=FB_BLANK_NORMAL){+}elseif(power<LCD_POWER_OFF){+if(priv->lcd_state<=LCD_POWER_REDUCED){/* Send the display in standby */dev_dbg(&spi->dev,"Standby the LCD\n");spi_write(spi,(constu8*)&disoff,sizeof(u16));msleep(60);spi_write(spi,(constu8*)&slpin,sizeof(u16));-}elseif(priv->lcd_state<FB_BLANK_POWERDOWN){+}elseif(priv->lcd_state<LCD_POWER_OFF){/* Do nothing, the LCD is already in standby */}else{-/* priv->lcd_state == FB_BLANK_POWERDOWN */+/* priv->lcd_state == LCD_POWER_OFF */l4f00242t03_lcd_init(spi);-priv->lcd_state=FB_BLANK_UNBLANK;+priv->lcd_state=LCD_POWER_ON;l4f00242t03_lcd_power_set(ld,power);}}else{-/* power == FB_BLANK_POWERDOWN */-if(priv->lcd_state!=FB_BLANK_POWERDOWN){+/* power == LCD_POWER_OFF */+if(priv->lcd_state!=LCD_POWER_OFF){/* Clear the screen before shutting down */spi_write(spi,(constu8*)&disoff,sizeof(u16));msleep(60);
@@ -209,8 +209,8 @@ static int l4f00242t03_probe(struct spi_device *spi)/* Init the LCD */l4f00242t03_lcd_init(spi);-priv->lcd_state=FB_BLANK_VSYNC_SUSPEND;-l4f00242t03_lcd_power_set(priv->ld,FB_BLANK_UNBLANK);+priv->lcd_state=LCD_POWER_REDUCED_VSYNC_SUSPEND;+l4f00242t03_lcd_power_set(priv->ld,LCD_POWER_ON);dev_info(&spi->dev,"Epson l4f00242t03 lcd probed.\n");
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:51
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/ili922x.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:52
This lcd driver is independent from the backlight code.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/lms501kf03.c | 1 -
1 file changed, 1 deletion(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:53
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/ili9320.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
@@ -223,7 +222,7 @@ int ili9320_probe_spi(struct spi_device *spi,ili->dev=dev;ili->client=client;-ili->power=FB_BLANK_POWERDOWN;+ili->power=LCD_POWER_OFF;ili->platdata=cfg;spi_set_drvdata(spi,ili);
@@ -241,7 +240,7 @@ int ili9320_probe_spi(struct spi_device *spi,dev_info(dev,"initialising %s\n",client->name);-ret=ili9320_power(ili,FB_BLANK_UNBLANK);+ret=ili9320_power(ili,LCD_POWER_ON);if(ret!=0){dev_err(dev,"failed to set lcd power state\n");returnret;
@@ -262,7 +261,7 @@ int ili9320_suspend(struct ili9320 *lcd){intret;-ret=ili9320_power(lcd,FB_BLANK_POWERDOWN);+ret=ili9320_power(lcd,LCD_POWER_OFF);if(lcd->platdata->suspend==ILI9320_SUSPEND_DEEP){ili9320_write(lcd,ILI9320_POWER1,lcd->power1|
@@ -282,7 +281,7 @@ int ili9320_resume(struct ili9320 *lcd)if(lcd->platdata->suspend==ILI9320_SUSPEND_DEEP)ili9320_write(lcd,ILI9320_POWER1,0x00);-returnili9320_power(lcd,FB_BLANK_UNBLANK);+returnili9320_power(lcd,LCD_POWER_ON);}EXPORT_SYMBOL_GPL(ili9320_resume);#endif
@@ -290,7 +289,7 @@ EXPORT_SYMBOL_GPL(ili9320_resume);/* Power down all displays on reboot, poweroff or halt */voidili9320_shutdown(structili9320*lcd){-ili9320_power(lcd,FB_BLANK_POWERDOWN);+ili9320_power(lcd,LCD_POWER_OFF);}EXPORT_SYMBOL_GPL(ili9320_shutdown);
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:54
Avoids the proxy include via <linux/fb.h>.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/jornada720_lcd.c | 1 +
1 file changed, 1 insertion(+)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:55
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/hx8357.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:56
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/lms283gf05.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:57
This lcd driver does not depend on backlight interfaces. Remove the
include statement.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/platform_lcd.c | 1 -
1 file changed, 1 deletion(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:54:58
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/otm3225a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:00
Store the lcd device in struct fb_info.lcd_dev. The lcd subsystem can
now detect the lcd's fbdev device from this field.
This makes the implementation of check_fb in imxfb_lcd_ops obsolete.
Remove it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/fbdev/imxfb.c | 26 ++++++++------------------
1 file changed, 8 insertions(+), 18 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:00
Rename check_fb in struct lcd_ops to controls_device. The callback
is now independent from fbdev's struct fb_info and tests if an lcd
device controls a hardware display device. The new naming and semantics
follow similar functionality for backlight devices.
v2:
- fix typos in commit description (Daniel)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/lcd.c | 2 +-
drivers/video/backlight/platform_lcd.c | 11 +++++------
include/linux/lcd.h | 16 ++++++++++++----
3 files changed, 18 insertions(+), 11 deletions(-)
@@ -35,7 +35,6 @@*/structlcd_device;-structfb_info;structlcd_properties{/* The maximum value for contrast (read-only) */
@@ -54,9 +53,18 @@ struct lcd_ops {int(*set_contrast)(structlcd_device*,intcontrast);/* Set LCD panel mode (resolutions ...) */int(*set_mode)(structlcd_device*,structfb_videomode*);-/* Check if given framebuffer device is the one LCD is bound to;-return0ifnot,!=0ifitis.IfNULL,lcdalwaysmatchesthefb.*/-int(*check_fb)(structlcd_device*,structfb_info*);++/*+*CheckiftheLCDcontrolsthegivendisplaydevice.This+*operationisoptionalandifnotimplementeditisassumedthat+*thedisplayisalwaystheonecontrolledbytheLCD.+*+*RETURNS:+*+*Ifdisplay_devisNULLordisplay_devmatchesthedevicecontrolledby+*theLCD,returntrue.Otherwisereturnfalse.+*/+bool(*controls_device)(structlcd_device*lcd,structdevice*display_device);};structlcd_device{
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:02
With the exception of fb_notifier_callback(), none of the lcd code
uses fbdev; especially not the lcd drivers. Remove the include
statement for <linux/fb.h> from the public lcd header.
v2:
- fix typos in commit description
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
include/linux/lcd.h | 1 -
1 file changed, 1 deletion(-)
@@ -12,7 +12,6 @@#include<linux/device.h>#include<linux/mutex.h>#include<linux/notifier.h>-#include<linux/fb.h>#define LCD_POWER_ON (0)#define LCD_POWER_REDUCED (1) // deprecated; don't use in new code
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:03
Store the lcd device in struct fb_info.lcd_dev. The lcd subsystem can
now detect the lcd's fbdev device from this field.
This makes the implementation of check_fb in picolcd_lcdops obsolete.
Remove it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
Acked-by: Jiri Kosina <redacted>
---
drivers/hid/hid-picolcd_fb.c | 4 ++++
drivers/hid/hid-picolcd_lcd.c | 6 ------
2 files changed, 4 insertions(+), 6 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:03
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/platform_lcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:04
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/lms501kf03.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
@@ -205,7 +204,7 @@ static int lms501kf03_ldi_disable(struct lms501kf03 *lcd)staticintlms501kf03_power_is_on(intpower){-return(power)<=FB_BLANK_NORMAL;+return(power)<=LCD_POWER_REDUCED;}staticintlms501kf03_power_on(structlms501kf03*lcd)
@@ -294,8 +293,8 @@ static int lms501kf03_set_power(struct lcd_device *ld, int power){structlms501kf03*lcd=lcd_get_data(ld);-if(power!=FB_BLANK_UNBLANK&&power!=FB_BLANK_POWERDOWN&&-power!=FB_BLANK_NORMAL){+if(power!=LCD_POWER_ON&&power!=LCD_POWER_OFF&&+power!=LCD_POWER_REDUCED){dev_err(lcd->dev,"power value should be 0, 1 or 4.\n");return-EINVAL;}
@@ -349,11 +348,11 @@ static int lms501kf03_probe(struct spi_device *spi)*currentlcdstatusispowerdownandthen*itenableslcdpanel.*/-lcd->power=FB_BLANK_POWERDOWN;+lcd->power=LCD_POWER_OFF;-lms501kf03_power(lcd,FB_BLANK_UNBLANK);+lms501kf03_power(lcd,LCD_POWER_ON);}else{-lcd->power=FB_BLANK_UNBLANK;+lcd->power=LCD_POWER_ON;}spi_set_drvdata(spi,lcd);
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:05
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/tdo24m.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:06
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/fbdev/clps711x-fb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:07
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/ltv350qv.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:08
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/backlight/jornada720_lcd.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
@@ -72,7 +71,7 @@ static int jornada_lcd_set_contrast(struct lcd_device *ld, int value)staticintjornada_lcd_set_power(structlcd_device*ld,intpower){-if(power!=FB_BLANK_UNBLANK){+if(power!=LCD_POWER_ON){PPSR&=~PPC_LDD2;PPDR|=PPC_LDD2;}else{
@@ -107,7 +106,7 @@ static int jornada_lcd_probe(struct platform_device *pdev)/* lets set our default values */jornada_lcd_set_contrast(lcd_device,LCD_DEF_CONTRAST);-jornada_lcd_set_power(lcd_device,FB_BLANK_UNBLANK);+jornada_lcd_set_power(lcd_device,LCD_POWER_ON);/* give it some time to startup */msleep(100);
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:08
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 <redacted>
---
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(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:09
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/fbdev/omap/lcd_ams_delta.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:10
Replace FB_BLANK_ constants with their counterparts from the
lcd subsystem. The values are identical, so there's no change
in functionality.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/fbdev/imxfb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-09-06 07:55:11
Store the lcd device in struct fb_info.lcd_dev. The lcd subsystem can
now detect the lcd's fbdev device from this field.
This makes the implementation of check_fb in clps711x_lcd_ops obsolete.
Remove it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/fbdev/clps711x-fb.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
From: Lee Jones <lee@kernel.org> Date: 2024-09-30 15:50:43
On Fri, 06 Sep 2024 09:52:14 +0200, Thomas Zimmermann wrote:
This series removes most dependencies on fbdev from the lcd subsystem
and its drivers.
Patches 1 to 3 rework the fbdev notifier, the fbdev's fb_info can
now refer to a dedicated lcd device, and lcd defines constants for
power states. These changes resemble similar changes to the backlight
code.
[...]
Applied, thanks!
[01/28] backlight: lcd: Rearrange code in fb_notifier_callback()
commit: d36870367c187daaa8a2c487d5ff1d57141eb039
[02/28] backlight: lcd: Test against struct fb_info.lcd_dev
commit: 26228256b796eb0145bdfb2ae34ec8c4c0ef1319
[03/28] backlight: lcd: Add LCD_POWER_ constants for power states
commit: 48ffe2074c2864ab64ee2004e7ebf3d6a6730fbf
[04/28] backlight: corgi_lcd: Use lcd power constants
commit: 20929e3691599f9cb3e3a0a7b81718c7a5b716b9
[05/28] backlight: hx8357: Use lcd power constants
commit: 7629628d610658f9cc210b9e969f34d07f2c85bd
[06/28] backlight: ili922x: Use lcd power constants
commit: 4364900b128801d62f9c42b2486bceda82f95b17
[07/28] backlight: ili9320: Use lcd power constants
commit: e844452282f7dba399b86bf9847294c226c8d466
[08/28] backlight: jornada720_lcd: Include <linux/io.h> for IOMEM() macro
commit: a412a18709fd40356a1768c7522db97cb05062d1
[09/28] backlight: jornada720_lcd: Use lcd power constants
commit: 992f5c43fcf26001c1f5a11146be3c4c1533bbcf
[10/28] backlight: l4f00242t03: Use lcd power constants
commit: 4be0de90b7f8816e4a310ec6b2183eee66d54290
[11/28] backlight: lms283gf05: Use lcd power constants
commit: 3b53bf14d4eef8293bf0f826f3345090f4557516
[12/28] backlight: lms501kf03: Remove unnecessary include of <linux/backlight.h>
commit: 2576e64bc8a59838e74ba081a3d05ea6ab30678c
[13/28] backlight: lms501kf03: Use lcd power constants
commit: 7c323fb26465ed294cd34bff77a68a40499148a7
[14/28] backlight: ltv350qv: Use lcd power constants
commit: a42a215d4d4d5ab32af4dee860e964764ed89f65
[15/28] backlight: otm3225a: Use lcd power constants
commit: 7c14e7a3fda5bd7323dcee60c69a47773f1fd6c6
[16/28] backlight: platform_lcd: Remove include statement for <linux/backlight.h>
commit: 516f3251429068a963d498a35441c0afaea6d1a4
[17/28] backlight: platform_lcd: Remove match_fb from struct plat_lcd_data
commit: c38a7db56d18b3ec07f3ad52c1e3f1f05c375011
[18/28] backlight: platform_lcd: Use lcd power constants
commit: 86c0826a7eebf476e46fea81ca3a85f355213a9a
[19/28] backlight: tdo24m: Use lcd power constants
commit: e5dfbbd39ee839ad3d6c1df7b3ec92800ceb4984
[20/28] fbdev: clps711x-fb: Replace check_fb in favor of struct fb_info.lcd_dev
commit: 36462ac193088db17823b592cb2c08fff6898b23
[21/28] fbdev: clps711x-fb: Use lcd power constants
commit: c11de820785fc2f1b58a764ac5529ab3670ce8c4
[22/28] fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev
commit: 488d807101c208d057c429dd6f9ce00041eda094
[23/28] fbdev: imxfb: Use lcd power constants
commit: 32c913d82ec70af3103608996dbd32aa92004347
[24/28] fbdev: omap: Use lcd power constants
commit: 16d6110e5257bb3718c53186765fa04bc8d53000
[25/28] HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev
commit: 05deb1ce96cda46a1ddc82f82a4645ef14cbe680
[26/28] backlight: lcd: Replace check_fb with controls_device
commit: 43e1120deb3768c86aa3875c7073658e44a30ea5
[27/28] backlight: lcd: Remove struct fb_videomode from set_mode callback
commit: 02e224d096ef58fe59e96609de6018e133f33512
[28/28] backlight: lcd: Do not include <linux/fb.h> in lcd header
commit: 0d580d99749e759b62dc8e28f511310e9235da7a
--
Lee Jones [李琼斯]
From: Lee Jones <lee@kernel.org> Date: 2024-10-01 08:55:48
Enjoy!
The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:
Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)
are available in the Git repository at:
ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git tags/ib-backlight-hid-fbdev-v6.13
for you to fetch changes up to 0d580d99749e759b62dc8e28f511310e9235da7a:
backlight: lcd: Do not include <linux/fb.h> in lcd header (2024-09-30 16:49:42 +0100)
----------------------------------------------------------------
Immutable branch between Backlight, HID and fbdev due for the v6.13 merge window
----------------------------------------------------------------
Thomas Zimmermann (28):
backlight: lcd: Rearrange code in fb_notifier_callback()
backlight: lcd: Test against struct fb_info.lcd_dev
backlight: lcd: Add LCD_POWER_ constants for power states
backlight: corgi_lcd: Use lcd power constants
backlight: hx8357: Use lcd power constants
backlight: ili922x: Use lcd power constants
backlight: ili9320: Use lcd power constants
backlight: jornada720_lcd: Include <linux/io.h> for IOMEM() macro
backlight: jornada720_lcd: Use lcd power constants
backlight: l4f00242t03: Use lcd power constants
backlight: lms283gf05: Use lcd power constants
backlight: lms501kf03: Remove unnecessary include of <linux/backlight.h>
backlight: lms501kf03: Use lcd power constants
backlight: ltv350qv: Use lcd power constants
backlight: otm3225a: Use lcd power constants
backlight: platform_lcd: Remove include statement for <linux/backlight.h>
backlight: platform_lcd: Remove match_fb from struct plat_lcd_data
backlight: platform_lcd: Use lcd power constants
backlight: tdo24m: Use lcd power constants
fbdev: clps711x-fb: Replace check_fb in favor of struct fb_info.lcd_dev
fbdev: clps711x-fb: Use lcd power constants
fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev
fbdev: imxfb: Use lcd power constants
fbdev: omap: Use lcd power constants
HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev
backlight: lcd: Replace check_fb with controls_device
backlight: lcd: Remove struct fb_videomode from set_mode callback
backlight: lcd: Do not include <linux/fb.h> in lcd header
drivers/hid/hid-picolcd_fb.c | 4 +++
drivers/hid/hid-picolcd_lcd.c | 6 ----
drivers/video/backlight/corgi_lcd.c | 17 +++++------
drivers/video/backlight/hx8357.c | 2 +-
drivers/video/backlight/ili922x.c | 7 ++---
drivers/video/backlight/ili9320.c | 15 +++++-----
drivers/video/backlight/jornada720_lcd.c | 10 +++----
drivers/video/backlight/l4f00242t03.c | 32 ++++++++++----------
drivers/video/backlight/lcd.c | 50 ++++++++++++++++++++++++--------
drivers/video/backlight/lms283gf05.c | 2 +-
drivers/video/backlight/lms501kf03.c | 24 +++++++--------
drivers/video/backlight/ltv350qv.c | 15 +++++-----
drivers/video/backlight/otm3225a.c | 2 +-
drivers/video/backlight/platform_lcd.c | 20 +++++--------
drivers/video/backlight/tdo24m.c | 19 ++++++------
drivers/video/fbdev/clps711x-fb.c | 29 +++++++++---------
drivers/video/fbdev/imxfb.c | 32 +++++++-------------
drivers/video/fbdev/omap/lcd_ams_delta.c | 8 ++---
include/linux/fb.h | 13 +++++++++
include/linux/lcd.h | 29 +++++++++++++-----
include/video/platform_lcd.h | 3 --
21 files changed, 181 insertions(+), 158 deletions(-)
--
Lee Jones [李琼斯]
Store the lcd device in struct fb_info.lcd_dev. The lcd subsystem can
now detect the lcd's fbdev device from this field.
This makes the implementation of check_fb in clps711x_lcd_ops obsolete.
Remove it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/fbdev/clps711x-fb.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
@@ -198,7 +191,6 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)}staticconststructlcd_opsclps711x_lcd_ops={-.check_fb=clps711x_lcd_check_fb,.get_power=clps711x_lcd_get_power,.set_power=clps711x_lcd_set_power,};
@@ -325,16 +317,21 @@ static int clps711x_fb_probe(struct platform_device *pdev)if(ret)gotoout_fb_dealloc_cmap;+lcd=devm_lcd_device_register(dev,"clps711x-lcd",dev,cfb,+&clps711x_lcd_ops);+if(IS_ERR(lcd)){+ret=PTR_ERR(lcd);+gotoout_fb_dealloc_cmap;+}++info->lcd_dev=lcd;+ret=register_framebuffer(info);if(ret)gotoout_fb_dealloc_cmap;-lcd=devm_lcd_device_register(dev,"clps711x-lcd",dev,cfb,-&clps711x_lcd_ops);-if(!IS_ERR(lcd))-return0;+return0;-ret=PTR_ERR(lcd);unregister_framebuffer(info);out_fb_dealloc_cmap:
Something is not right here. With the current patch you'll make the
unregister_framebuffer(info)
unreachable, because there is a return 0 in front.
Please check again.
--
Kees Bakker
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2024-10-04 14:01:16
Hi
Am 03.10.24 um 20:33 schrieb Kees Bakker:
Op 06-09-2024 om 09:52 schreef Thomas Zimmermann:
quoted
Store the lcd device in struct fb_info.lcd_dev. The lcd subsystem can
now detect the lcd's fbdev device from this field.
This makes the implementation of check_fb in clps711x_lcd_ops obsolete.
Remove it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <redacted>
---
drivers/video/fbdev/clps711x-fb.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/video/fbdev/clps711x-fb.c
b/drivers/video/fbdev/clps711x-fb.c
index 6171a98a48fd..4340ea3b9660 100644
@@ -325,16 +317,21 @@ static int clps711x_fb_probe(struct
platform_device *pdev)
if (ret)
goto out_fb_dealloc_cmap;
+ lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
+ &clps711x_lcd_ops);
+ if (IS_ERR(lcd)) {
+ ret = PTR_ERR(lcd);
+ goto out_fb_dealloc_cmap;
+ }
+
+ info->lcd_dev = lcd;
+
ret = register_framebuffer(info);
if (ret)
goto out_fb_dealloc_cmap;
- lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
- &clps711x_lcd_ops);
- if (!IS_ERR(lcd))
- return 0;
+ return 0;
- ret = PTR_ERR(lcd);
unregister_framebuffer(info);
out_fb_dealloc_cmap:
Something is not right here. With the current patch you'll make the
unregister_framebuffer(info)
unreachable, because there is a return 0 in front.
Please check again.
See
https://lore.kernel.org/linux-fbdev/20241004014349.435006-1-qianqiang.liu@163.com/T/#u
This line used to be code for error rollback, but is now unnecessary AFAICT.
Best regards
Thomas
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Enjoy!
The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:
Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)
are available in the Git repository at:
ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git tags/ib-backlight-hid-fbdev-v6.13
for you to fetch changes up to 0d580d99749e759b62dc8e28f511310e9235da7a:
backlight: lcd: Do not include <linux/fb.h> in lcd header (2024-09-30 16:49:42 +0100)
----------------------------------------------------------------
Immutable branch between Backlight, HID and fbdev due for the v6.13 merge window
As picoLCD is the only affected driver in HID, I will be pulling this only
if there are any patches for picoLCD submitted for 6.13 (which is not yet
the case).
Thanks,
--
Jiri Kosina
SUSE Labs
From: Lee Jones <lee@kernel.org> Date: 2024-10-25 08:59:33
On Mon, 21 Oct 2024, Jiri Kosina wrote:
On Tue, 1 Oct 2024, Lee Jones wrote:
quoted
Enjoy!
The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:
Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)
are available in the Git repository at:
ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git tags/ib-backlight-hid-fbdev-v6.13
for you to fetch changes up to 0d580d99749e759b62dc8e28f511310e9235da7a:
backlight: lcd: Do not include <linux/fb.h> in lcd header (2024-09-30 16:49:42 +0100)
----------------------------------------------------------------
Immutable branch between Backlight, HID and fbdev due for the v6.13 merge window
As picoLCD is the only affected driver in HID, I will be pulling this only
if there are any patches for picoLCD submitted for 6.13 (which is not yet
the case).
Sounds like a plan. Thanks for letting me know.
--
Lee Jones [李琼斯]
From: Andy Shevchenko <hidden> Date: 2024-11-23 20:27:12
Fri, Sep 06, 2024 at 09:52:34AM +0200, Thomas Zimmermann kirjoitti:
Store the lcd device in struct fb_info.lcd_dev. The lcd subsystem can
now detect the lcd's fbdev device from this field.
This makes the implementation of check_fb in clps711x_lcd_ops obsolete.
Remove it.
...
+ lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
+ &clps711x_lcd_ops);
+ if (IS_ERR(lcd)) {
+ ret = PTR_ERR(lcd);
+ goto out_fb_dealloc_cmap;
+ }
+
+ info->lcd_dev = lcd;
+
ret = register_framebuffer(info);
if (ret)
goto out_fb_dealloc_cmap;
- lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
- &clps711x_lcd_ops);
- if (!IS_ERR(lcd))
- return 0;
+ return 0;
- ret = PTR_ERR(lcd);
unregister_framebuffer(info);