backlight: lcd: Remove fbdev dependencies
Subsystems (7)
cover backlight: lcd: Remove fbdev dependencies
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.
[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 | 49 +++++++++++++++++++----- 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, 182 insertions(+), 156 deletions(-)
Signature · 1 line
2.46.0
PATCH 1/28 backlight: lcd: Rearrange code in fb_notifier_callback()
First aqcuire the ops_lock and do al tests while holing 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.
--- drivers/video/backlight/lcd.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/video/backlight/lcd.c +14 -10
@@ -29,21 +29,25 @@ static int fb_notifier_callback(struct notifier_block *self, {struct lcd_device *ld;struct fb_event *evdata = data; +struct fb_info *info = evdata->info; ld = container_of(self, struct lcd_device, fb_notif); +mutex_lock (&ld->ops_lock); +if (!ld->ops) -return 0 ; + goto out; +if (ld->ops->check_fb && !ld->ops->check_fb (ld, evdata->info)) + goto out; -mutex_lock (&ld->ops_lock); -if (!ld->ops->check_fb || ld->ops->check_fb (ld, evdata->info)) { -if (event ==FB_EVENT_BLANK ) { -if (ld->ops->set_power) - ld->ops->set_power (ld, *(int *)evdata->data); - }else { -if (ld->ops->set_mode) - ld->ops->set_mode (ld, evdata->data); - } +if (event ==FB_EVENT_BLANK ) { +if (ld->ops->set_power) + ld->ops->set_power (ld, *(int *)evdata->data); + }else { +if (ld->ops->set_mode) + ld->ops->set_mode (ld, evdata->data); } + +out:mutex_unlock (&ld->ops_lock);return 0 ; }
Signature · 1 line
2.46.0
PATCH 2/28 backlight: lcd: Test against struct fb_info.lcd_dev
In reply to Thomas ZimmermannAdd 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.
--- drivers/video/backlight/lcd.c | 3 +++ include/linux/fb.h | 13 +++++++++++++ 2 files changed, 16 insertions(+)
drivers/video/backlight/lcd.c +3 -0
@@ -30,6 +30,7 @@ static int fb_notifier_callback(struct notifier_block *self,struct lcd_device *ld;struct fb_event *evdata = data;struct fb_info *info = evdata->info; +struct lcd_device *fb_lcd =fb_lcd_device (info); ld = container_of(self, struct lcd_device, fb_notif);mutex_lock (&ld->ops_lock);
@@ -38,6 +39,8 @@ static int fb_notifier_callback(struct notifier_block *self, goto out;if (ld->ops->check_fb && !ld->ops->check_fb (ld, evdata->info)) goto out; +if (fb_lcd && fb_lcd != ld) + goto out;if (event ==FB_EVENT_BLANK ) {if (ld->ops->set_power)
include/linux/fb.h +13 -0
@@ -21,6 +21,7 @@ struct fb_info;struct file ;struct i2c_adapter ;struct inode ; +struct lcd_device ;struct module ;struct notifier_block ;struct page ;
@@ -480,6 +481,13 @@ struct fb_info {struct mutex bl_curve_mutex;u8 bl_curve[FB_BACKLIGHT_LEVELS ];#endif + +/* +* Assigned LCD device; set before framebuffer +* registration, remove after unregister +*/ +struct lcd_device *lcd_dev; +#ifdef CONFIG_FB_DEFERRED_IO struct delayed_work deferred_work;unsigned long npagerefs;
@@ -753,6 +761,11 @@ static inline struct backlight_device *fb_bl_device(struct fb_info *info) }#endif +static inline struct lcd_device *fb_lcd_device (struct fb_info *info) +{ +return info->lcd_dev; +} +/* fbmon.c */ #define FB_MAXTIMINGS 0#define FB_VSYNCTIMINGS 1
Signature · 1 line
2.46.0
PATCH 3/28 backlight: lcd: Add LCD_POWER_ constants for power states
In reply to Thomas ZimmermannDuplicate 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 fro backlight drivers.
--- drivers/video/backlight/lcd.c | 22 +++++++++++++++++++++- include/linux/lcd.h | 5 +++++ 2 files changed, 26 insertions(+), 1 deletion(-)
drivers/video/backlight/lcd.c +21 -1
@@ -20,6 +20,24 @@#if defined(CONFIG_FB ) || (defined(CONFIG_FB_MODULE ) && \ defined(CONFIG_LCD_CLASS_DEVICE_MODULE )) +static int to_lcd_power (int fb_blank) +{ +switch (fb_blank) { +case FB_BLANK_UNBLANK : +return LCD_POWER_ON ; +/* deprecated; TODO: should become 'off' */ +case FB_BLANK_NORMAL : +return LCD_POWER_REDUCED ; +case FB_BLANK_VSYNC_SUSPEND : +return LCD_POWER_REDUCED_VSYNC_SUSPEND ; +/* 'off' */ +case FB_BLANK_HSYNC_SUSPEND : +case FB_BLANK_POWERDOWN : +default : +return LCD_POWER_OFF ; + } +} +/* This callback gets called when something important happens inside a * framebuffer driver. We're looking if that important event is blanking, * and if it is, we're switching lcd power as well ...
@@ -43,8 +61,10 @@ static int fb_notifier_callback(struct notifier_block *self, goto out;if (event ==FB_EVENT_BLANK ) { +int power =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);
include/linux/lcd.h +5 -0
@@ -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_lock is an internal backlight lock protecting the ops
Signature · 1 line
2.46.0
PATCH 4/28 backlight: corgi_lcd: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/corgi_lcd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/video/backlight/corgi_lcd.c +6 -6
@@ -24,7 +24,7 @@#include <linux/slab.h> #include <asm/mach/sharpsl_param.h> -#define POWER_IS_ON (pwr) ((pwr) <= FB_BLANK_NORMAL) +#define POWER_IS_ON (pwr) ((pwr) <= LCD_POWER_REDUCED)/* Register Addresses */ #define RESCTL_ADRS 0x00
@@ -455,7 +455,7 @@ static int corgi_lcd_suspend(struct device *dev) corgibl_flags |=CORGIBL_SUSPENDED ;corgi_bl_set_intensity (lcd,0 ); -corgi_lcd_set_power (lcd->lcd_dev,FB_BLANK_POWERDOWN ); +corgi_lcd_set_power (lcd->lcd_dev,LCD_POWER_OFF );return 0 ; }
@@ -464,7 +464,7 @@ static int corgi_lcd_resume(struct device *dev)struct corgi_lcd *lcd =dev_get_drvdata (dev); corgibl_flags &= ~CORGIBL_SUSPENDED ; -corgi_lcd_set_power (lcd->lcd_dev,FB_BLANK_UNBLANK ); +corgi_lcd_set_power (lcd->lcd_dev,LCD_POWER_ON );backlight_update_status (lcd->bl_dev);return 0 ; }
@@ -513,7 +513,7 @@ static int corgi_lcd_probe(struct spi_device *spi)if (IS_ERR (lcd->lcd_dev))return PTR_ERR (lcd->lcd_dev); - lcd->power =FB_BLANK_POWERDOWN ; + lcd->power =LCD_POWER_OFF ; lcd->mode = (pdata) ? pdata->init_mode :CORGI_LCD_MODE_VGA ;memset (&props,0 ,sizeof (struct backlight_properties ));
@@ -535,7 +535,7 @@ static int corgi_lcd_probe(struct spi_device *spi) lcd->kick_battery = pdata->kick_battery;spi_set_drvdata (spi, lcd); -corgi_lcd_set_power (lcd->lcd_dev,FB_BLANK_UNBLANK ); +corgi_lcd_set_power (lcd->lcd_dev,LCD_POWER_ON );backlight_update_status (lcd->bl_dev); lcd->limit_mask = pdata->limit_mask;
@@ -550,7 +550,7 @@ static void corgi_lcd_remove(struct spi_device *spi) lcd->bl_dev->props.power =BACKLIGHT_POWER_ON ; lcd->bl_dev->props.brightness =0 ;backlight_update_status (lcd->bl_dev); -corgi_lcd_set_power (lcd->lcd_dev,FB_BLANK_POWERDOWN ); +corgi_lcd_set_power (lcd->lcd_dev,LCD_POWER_OFF ); }static struct spi_driver corgi_lcd_driver = {
Signature · 1 line
2.46.0
PATCH 5/28 backlight: hx8357: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/hx8357.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/hx8357.c +1 -1
@@ -532,7 +532,7 @@ static int hx8369_lcd_init(struct lcd_device *lcdev)return 0 ; } -#define POWER_IS_ON (pwr) ((pwr) <= FB_BLANK_NORMAL) +#define POWER_IS_ON (pwr) ((pwr) <= LCD_POWER_REDUCED)static int hx8357_set_power (struct lcd_device *lcdev,int power) {
Signature · 1 line
2.46.0
PATCH 6/28 backlight: ili922x: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/ili922x.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/video/backlight/ili922x.c +3 -4
@@ -8,7 +8,6 @@* memory is cyclically updated over the RGB interface. */ -#include <linux/fb.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/init.h>
@@ -119,7 +118,7 @@#define CMD_BUFSIZE 16 -#define POWER_IS_ON (pwr) ((pwr) <= FB_BLANK_NORMAL) +#define POWER_IS_ON (pwr) ((pwr) <= LCD_POWER_REDUCED)#define set_tx_byte (b) (tx_invert ? ~(b) : b)
@@ -513,7 +512,7 @@ static int ili922x_probe(struct spi_device *spi)ili922x_display_init (spi); - ili->power =FB_BLANK_POWERDOWN ; + ili->power =LCD_POWER_OFF ; lcd =devm_lcd_device_register (&spi->dev,"ili922xlcd" , &spi->dev, ili, &ili922x_ops);
@@ -525,7 +524,7 @@ static int ili922x_probe(struct spi_device *spi) ili->ld = lcd;spi_set_drvdata (spi, ili); -ili922x_lcd_power (ili,FB_BLANK_UNBLANK ); +ili922x_lcd_power (ili,LCD_POWER_ON );return 0 ; }
Signature · 1 line
2.46.0
PATCH 7/28 backlight: ili9320: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/ili9320.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/video/backlight/ili9320.c +7 -8
@@ -10,7 +10,6 @@#include <linux/delay.h> #include <linux/err.h> -#include <linux/fb.h> #include <linux/init.h> #include <linux/lcd.h> #include <linux/module.h>
@@ -121,7 +120,7 @@ static inline int ili9320_power_off(struct ili9320 *lcd)return 0 ; } -#define POWER_IS_ON (pwr) ((pwr) <= FB_BLANK_NORMAL) +#define POWER_IS_ON (pwr) ((pwr) <= LCD_POWER_REDUCED)static int ili9320_power (struct ili9320 *lcd,int power) {
@@ -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" );return ret;
@@ -253,7 +252,7 @@ EXPORT_SYMBOL_GPL(ili9320_probe_spi);void ili9320_remove (struct ili9320 *ili) { -ili9320_power (ili,FB_BLANK_POWERDOWN ); +ili9320_power (ili,LCD_POWER_OFF ); }EXPORT_SYMBOL_GPL (ili9320_remove);
@@ -262,7 +261,7 @@ int ili9320_suspend(struct ili9320 *lcd) {int ret; - 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 ); - return ili9320_power(lcd, FB_BLANK_UNBLANK); + return ili9320_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 */ void ili9320_shutdown (struct ili9320 *lcd) { -ili9320_power (lcd,FB_BLANK_POWERDOWN ); +ili9320_power (lcd,LCD_POWER_OFF ); }EXPORT_SYMBOL_GPL (ili9320_shutdown);
Signature · 1 line
2.46.0
PATCH 8/28 backlight: jornada720_lcd: Include <linux/io.h> for IOMEM() macro
In reply to Thomas ZimmermannAvoids the proxy include via <linux/fb.h>.
--- drivers/video/backlight/jornada720_lcd.c | 1 + 1 file changed, 1 insertion(+)
drivers/video/backlight/jornada720_lcd.c +1 -0
@@ -7,6 +7,7 @@#include <linux/device.h> #include <linux/fb.h> +#include <linux/io.h> #include <linux/kernel.h> #include <linux/lcd.h> #include <linux/module.h>
Signature · 1 line
2.46.0
PATCH 9/28 backlight: jornada720_lcd: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/jornada720_lcd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/video/backlight/jornada720_lcd.c +4 -5
@@ -6,7 +6,6 @@*/ #include <linux/device.h> -#include <linux/fb.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/lcd.h>
@@ -24,14 +23,14 @@static int jornada_lcd_get_power (struct lcd_device *ld) { -return PPSR &PPC_LDD2 ?FB_BLANK_UNBLANK :FB_BLANK_POWERDOWN ; +return PPSR &PPC_LDD2 ?LCD_POWER_ON :LCD_POWER_OFF ; }static int jornada_lcd_get_contrast (struct lcd_device *ld) {int ret; -if (jornada_lcd_get_power (ld) !=FB_BLANK_UNBLANK ) +if (jornada_lcd_get_power (ld) !=LCD_POWER_ON )return 0 ;jornada_ssp_start ();
@@ -72,7 +71,7 @@ static int jornada_lcd_set_contrast(struct lcd_device *ld, int value)static int jornada_lcd_set_power (struct lcd_device *ld,int power) { -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 );
Signature · 1 line
2.46.0
PATCH 10/28 backlight: l4f00242t03: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/l4f00242t03.c | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/video/backlight/l4f00242t03.c +16 -16
@@ -112,40 +112,40 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)const u16 slpin =0x10 ;const u16 disoff =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 */ - }else if (priv->lcd_state <FB_BLANK_POWERDOWN ) { + }else if (priv->lcd_state <LCD_POWER_OFF ) {dev_dbg (&spi->dev,"Resuming LCD\n" );spi_write (spi, (const u8 *)&slpout,sizeof (u16));msleep (60 );spi_write (spi, (const u8 *)&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); } - }else if (power <FB_BLANK_POWERDOWN ) { -if (priv->lcd_state <=FB_BLANK_NORMAL ) { + }else if (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, (const u8 *)&disoff,sizeof (u16));msleep (60 );spi_write (spi, (const u8 *)&slpin,sizeof (u16)); - }else if (priv->lcd_state <FB_BLANK_POWERDOWN ) { + }else if (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, (const u8 *)&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" );
@@ -221,7 +221,7 @@ static void l4f00242t03_remove(struct spi_device *spi) {struct l4f00242t03_priv *priv =spi_get_drvdata (spi); -l4f00242t03_lcd_power_set (priv->ld,FB_BLANK_POWERDOWN ); +l4f00242t03_lcd_power_set (priv->ld,LCD_POWER_OFF ); }static void l4f00242t03_shutdown (struct spi_device *spi)
@@ -229,7 +229,7 @@ static void l4f00242t03_shutdown(struct spi_device *spi)struct l4f00242t03_priv *priv =spi_get_drvdata (spi);if (priv) -l4f00242t03_lcd_power_set (priv->ld,FB_BLANK_POWERDOWN ); +l4f00242t03_lcd_power_set (priv->ld,LCD_POWER_OFF ); }
Signature · 1 line
2.46.0
PATCH 11/28 backlight: lms283gf05: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/lms283gf05.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/lms283gf05.c +1 -1
@@ -126,7 +126,7 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power)struct lms283gf05_state *st =lcd_get_data (ld);struct spi_device *spi = st->spi; -if (power <=FB_BLANK_NORMAL ) { +if (power <=LCD_POWER_REDUCED ) {if (st->reset)lms283gf05_reset (st->reset);lms283gf05_toggle (spi, disp_initseq,ARRAY_SIZE (disp_initseq));
Signature · 1 line
2.46.0
PATCH 12/28 backlight: lms501kf03: Remove unnecessary include of <linux/backlight.h>
In reply to Thomas ZimmermannThis lcd driver is independent from the backlight code.
--- drivers/video/backlight/lms501kf03.c | 1 - 1 file changed, 1 deletion(-)
drivers/video/backlight/lms501kf03.c +0 -1
@@ -6,7 +6,6 @@* Author: Jingoo Han <[email protected]> */ -#include <linux/backlight.h> #include <linux/delay.h> #include <linux/fb.h> #include <linux/lcd.h>
Signature · 1 line
2.46.0
PATCH 13/28 backlight: lms501kf03: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/lms501kf03.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
drivers/video/backlight/lms501kf03.c +11 -12
@@ -7,7 +7,6 @@*/ #include <linux/delay.h> -#include <linux/fb.h> #include <linux/lcd.h> #include <linux/module.h> #include <linux/spi/spi.h>
@@ -205,7 +204,7 @@ static int lms501kf03_ldi_disable(struct lms501kf03 *lcd)static int lms501kf03_power_is_on (int power) { -return (power) <=FB_BLANK_NORMAL ; +return (power) <=LCD_POWER_REDUCED ; }static int lms501kf03_power_on (struct lms501kf03 *lcd)
@@ -294,8 +293,8 @@ static int lms501kf03_set_power(struct lcd_device *ld, int power) {struct lms501kf03 *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)* current lcd status is powerdown and then * it enables lcd panel. */ - 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);
@@ -367,7 +366,7 @@ static void lms501kf03_remove(struct spi_device *spi) {struct lms501kf03 *lcd =spi_get_drvdata (spi); -lms501kf03_power (lcd,FB_BLANK_POWERDOWN ); +lms501kf03_power (lcd,LCD_POWER_OFF ); }#ifdef CONFIG_PM_SLEEP
@@ -381,16 +380,16 @@ static int lms501kf03_suspend(struct device *dev)* when lcd panel is suspend, lcd panel becomes off * regardless of status. */ - return lms501kf03_power(lcd, FB_BLANK_POWERDOWN); + return lms501kf03_power(lcd, LCD_POWER_OFF); }static int lms501kf03_resume (struct device *dev) {struct lms501kf03 *lcd =dev_get_drvdata (dev); - lcd->power =FB_BLANK_POWERDOWN ; + lcd->power =LCD_POWER_OFF ; -return lms501kf03_power (lcd,FB_BLANK_UNBLANK ); +return lms501kf03_power (lcd,LCD_POWER_ON ); }#endif
@@ -401,7 +400,7 @@ static void lms501kf03_shutdown(struct spi_device *spi) {struct lms501kf03 *lcd =spi_get_drvdata (spi); -lms501kf03_power (lcd,FB_BLANK_POWERDOWN ); +lms501kf03_power (lcd,LCD_POWER_OFF ); }static struct spi_driver lms501kf03_driver = {
Signature · 1 line
2.46.0
PATCH 14/28 backlight: ltv350qv: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/ltv350qv.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/video/backlight/ltv350qv.c +7 -8
@@ -6,7 +6,6 @@*/ #include <linux/delay.h> #include <linux/err.h> -#include <linux/fb.h> #include <linux/init.h> #include <linux/lcd.h> #include <linux/module.h>
@@ -15,7 +14,7 @@#include "ltv350qv.h" -#define POWER_IS_ON (pwr) ((pwr) <= FB_BLANK_NORMAL) +#define POWER_IS_ON (pwr) ((pwr) <= LCD_POWER_REDUCED)struct ltv350qv {struct spi_device *spi;
@@ -233,7 +232,7 @@ static int ltv350qv_probe(struct spi_device *spi)return -ENOMEM ; lcd->spi = spi; - lcd->power =FB_BLANK_POWERDOWN ; + lcd->power =LCD_POWER_OFF ; lcd->buffer =devm_kzalloc (&spi->dev,8 ,GFP_KERNEL );if (!lcd->buffer)return -ENOMEM ;
@@ -245,7 +244,7 @@ static int ltv350qv_probe(struct spi_device *spi) lcd->ld = ld; - ret =ltv350qv_power (lcd,FB_BLANK_UNBLANK ); + ret =ltv350qv_power (lcd,LCD_POWER_ON );if (ret)return ret;
@@ -258,7 +257,7 @@ static void ltv350qv_remove(struct spi_device *spi) {struct ltv350qv *lcd =spi_get_drvdata (spi); -ltv350qv_power (lcd,FB_BLANK_POWERDOWN ); +ltv350qv_power (lcd,LCD_POWER_OFF ); }#ifdef CONFIG_PM_SLEEP
@@ -266,14 +265,14 @@ static int ltv350qv_suspend(struct device *dev) {struct ltv350qv *lcd =dev_get_drvdata (dev); -return ltv350qv_power (lcd,FB_BLANK_POWERDOWN ); +return ltv350qv_power (lcd,LCD_POWER_OFF ); }static int ltv350qv_resume (struct device *dev) {struct ltv350qv *lcd =dev_get_drvdata (dev); -return ltv350qv_power (lcd,FB_BLANK_UNBLANK ); +return ltv350qv_power (lcd,LCD_POWER_ON ); }#endif
@@ -284,7 +283,7 @@ static void ltv350qv_shutdown(struct spi_device *spi) {struct ltv350qv *lcd =spi_get_drvdata (spi); -ltv350qv_power (lcd,FB_BLANK_POWERDOWN ); +ltv350qv_power (lcd,LCD_POWER_OFF ); }static struct spi_driver ltv350qv_driver = {
Signature · 1 line
2.46.0
PATCH 15/28 backlight: otm3225a: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/otm3225a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/otm3225a.c +1 -1
@@ -189,7 +189,7 @@ static int otm3225a_set_power(struct lcd_device *ld, int power)if (power == dd->power)return 0 ; -if (power >FB_BLANK_UNBLANK ) +if (power >LCD_POWER_ON )otm3225a_write (dd->spi, display_off,ARRAY_SIZE (display_off));else otm3225a_write (dd->spi, display_on,ARRAY_SIZE (display_on));
Signature · 1 line
2.46.0
PATCH 16/28 backlight: platform_lcd: Remove include statement for <linux/backlight.h>
In reply to Thomas ZimmermannThis lcd driver does not depend on backlight interfaces. Remove the include statement.
--- drivers/video/backlight/platform_lcd.c | 1 - 1 file changed, 1 deletion(-)
drivers/video/backlight/platform_lcd.c +0 -1
@@ -10,7 +10,6 @@#include <linux/module.h> #include <linux/platform_device.h> #include <linux/fb.h> -#include <linux/backlight.h> #include <linux/lcd.h> #include <linux/slab.h>
Signature · 1 line
2.46.0
PATCH 17/28 backlight: platform_lcd: Remove match_fb from struct plat_lcd_data
In reply to Thomas ZimmermannThe match_fb callback in struct plat_lcd_data is unused. Remove it.
--- drivers/video/backlight/platform_lcd.c | 4 ---- include/video/platform_lcd.h | 3 --- 2 files changed, 7 deletions(-)
drivers/video/backlight/platform_lcd.c +0 -4
@@ -53,10 +53,6 @@ static int platform_lcd_set_power(struct lcd_device *lcd, int power)static int platform_lcd_match (struct lcd_device *lcd,struct fb_info *info) {struct platform_lcd *plcd =to_our_lcd (lcd); -struct plat_lcd_data *pdata = plcd->pdata; - -if (pdata->match_fb) -return pdata->match_fb (pdata, info);return plcd->us->parent == info->device; }
include/video/platform_lcd.h +0 -3
@@ -8,11 +8,8 @@*/ struct plat_lcd_data ; -struct fb_info ;struct plat_lcd_data {int (*probe)(struct plat_lcd_data *);void (*set_power)(struct plat_lcd_data *,unsigned int power); -int (*match_fb)(struct plat_lcd_data *,struct fb_info *); }; -
Signature · 1 line
2.46.0
PATCH 18/28 backlight: platform_lcd: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/platform_lcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/backlight/platform_lcd.c +2 -2
@@ -41,7 +41,7 @@ static int platform_lcd_set_power(struct lcd_device *lcd, int power)struct platform_lcd *plcd =to_our_lcd (lcd);int lcd_power =1 ; -if (power ==FB_BLANK_POWERDOWN || plcd->suspended) +if (power ==LCD_POWER_OFF || plcd->suspended) lcd_power =0 ; plcd->pdata->set_power (plcd->pdata, lcd_power);
@@ -97,7 +97,7 @@ static int platform_lcd_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, plcd); -platform_lcd_set_power (plcd->lcd,FB_BLANK_NORMAL ); +platform_lcd_set_power (plcd->lcd,LCD_POWER_REDUCED );return 0 ; }
Signature · 1 line
2.46.0
PATCH 19/28 backlight: tdo24m: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/backlight/tdo24m.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/video/backlight/tdo24m.c +7 -7
@@ -16,7 +16,7 @@#include <linux/lcd.h> #include <linux/slab.h> -#define POWER_IS_ON (pwr) ((pwr) <= FB_BLANK_NORMAL) +#define POWER_IS_ON (pwr) ((pwr) <= LCD_POWER_REDUCED)#define TDO24M_SPI_BUFF_SIZE (4)#define MODE_QVGA 0
@@ -354,7 +354,7 @@ static int tdo24m_probe(struct spi_device *spi)return -ENOMEM ; lcd->spi_dev = spi; - lcd->power =FB_BLANK_POWERDOWN ; + lcd->power =LCD_POWER_OFF ; lcd->mode =MODE_VGA ;/* default to VGA */ lcd->buf =devm_kzalloc (&spi->dev,TDO24M_SPI_BUFF_SIZE ,GFP_KERNEL );
@@ -390,7 +390,7 @@ static int tdo24m_probe(struct spi_device *spi)return PTR_ERR (lcd->lcd_dev);spi_set_drvdata (spi, lcd); - err =tdo24m_power (lcd,FB_BLANK_UNBLANK ); + err =tdo24m_power (lcd,LCD_POWER_ON );if (err)return err;
@@ -401,7 +401,7 @@ static void tdo24m_remove(struct spi_device *spi) {struct tdo24m *lcd =spi_get_drvdata (spi); -tdo24m_power (lcd,FB_BLANK_POWERDOWN ); +tdo24m_power (lcd,LCD_POWER_OFF ); }#ifdef CONFIG_PM_SLEEP
@@ -409,14 +409,14 @@ static int tdo24m_suspend(struct device *dev) {struct tdo24m *lcd =dev_get_drvdata (dev); -return tdo24m_power (lcd,FB_BLANK_POWERDOWN ); +return tdo24m_power (lcd,LCD_POWER_OFF ); }static int tdo24m_resume (struct device *dev) {struct tdo24m *lcd =dev_get_drvdata (dev); -return tdo24m_power (lcd,FB_BLANK_UNBLANK ); +return tdo24m_power (lcd,LCD_POWER_ON ); }#endif
@@ -427,7 +427,7 @@ static void tdo24m_shutdown(struct spi_device *spi) {struct tdo24m *lcd =spi_get_drvdata (spi); -tdo24m_power (lcd,FB_BLANK_POWERDOWN ); +tdo24m_power (lcd,LCD_POWER_OFF ); }static struct spi_driver tdo24m_driver = {
Signature · 1 line
2.46.0
PATCH 20/28 fbdev: clps711x-fb: Replace check_fb in favor of struct fb_info.lcd_dev
In reply to Thomas ZimmermannStore 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.
--- drivers/video/fbdev/clps711x-fb.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-)
drivers/video/fbdev/clps711x-fb.c +10 -13
@@ -162,13 +162,6 @@ static const struct fb_ops clps711x_fb_ops = { .fb_blank = clps711x_fb_blank, }; -static int clps711x_lcd_check_fb (struct lcd_device *lcddev,struct fb_info *fi) -{ -struct clps711x_fb_info *cfb =dev_get_drvdata (&lcddev->dev); - -return (!fi || fi->par == cfb) ?1 :0 ; -} -static int clps711x_lcd_get_power (struct lcd_device *lcddev) {struct clps711x_fb_info *cfb =dev_get_drvdata (&lcddev->dev);
@@ -198,7 +191,6 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank) }static const struct lcd_ops clps711x_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) 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:
Signature · 1 line
2.46.0
PATCH 21/28 fbdev: clps711x-fb: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/fbdev/clps711x-fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/clps711x-fb.c +3 -3
@@ -168,9 +168,9 @@ static int clps711x_lcd_get_power(struct lcd_device *lcddev)if (!IS_ERR_OR_NULL (cfb->lcd_pwr))if (!regulator_is_enabled (cfb->lcd_pwr)) -return FB_BLANK_NORMAL ; +return LCD_POWER_REDUCED ; -return FB_BLANK_UNBLANK ; +return LCD_POWER_ON ; }static int clps711x_lcd_set_power (struct lcd_device *lcddev,int blank)
@@ -178,7 +178,7 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)struct clps711x_fb_info *cfb =dev_get_drvdata (&lcddev->dev);if (!IS_ERR_OR_NULL (cfb->lcd_pwr)) { -if (blank ==FB_BLANK_UNBLANK ) { +if (blank ==LCD_POWER_ON ) {if (!regulator_is_enabled (cfb->lcd_pwr))return regulator_enable (cfb->lcd_pwr); }else {
Signature · 1 line
2.46.0
PATCH 22/28 fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev
In reply to Thomas ZimmermannStore 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.
--- drivers/video/fbdev/imxfb.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
drivers/video/fbdev/imxfb.c +8 -18
@@ -782,16 +782,6 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,return 0 ; } -static int imxfb_lcd_check_fb (struct lcd_device *lcddev,struct fb_info *fi) -{ -struct imxfb_info *fbi =dev_get_drvdata (&lcddev->dev); - -if (!fi || fi->par == fbi) -return 1 ; - -return 0 ; -} -static int imxfb_lcd_get_contrast (struct lcd_device *lcddev) {struct imxfb_info *fbi =dev_get_drvdata (&lcddev->dev);
@@ -858,7 +848,6 @@ static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power) }static const struct lcd_ops imxfb_lcd_ops = { - .check_fb = imxfb_lcd_check_fb, .get_contrast = imxfb_lcd_get_contrast, .set_contrast = imxfb_lcd_set_contrast, .get_power = imxfb_lcd_get_power,
@@ -1025,11 +1014,6 @@ static int imxfb_probe(struct platform_device *pdev) goto failed_cmap;imxfb_set_par (info); - ret =register_framebuffer (info); -if (ret <0 ) { -dev_err (&pdev->dev,"failed to register framebuffer\n" ); - goto failed_register; - } fbi->lcd_pwr =devm_regulator_get (&pdev->dev,"lcd" );if (PTR_ERR (fbi->lcd_pwr) == -EPROBE_DEFER ) {
@@ -1046,13 +1030,19 @@ static int imxfb_probe(struct platform_device *pdev) lcd->props.max_contrast =0xff ; + info->lcd_dev = lcd; + + ret =register_framebuffer (info); +if (ret <0 ) { +dev_err (&pdev->dev,"failed to register framebuffer\n" ); + goto failed_lcd; + } +imxfb_enable_controller (fbi);return 0 ; failed_lcd: -unregister_framebuffer (info); -failed_register:fb_dealloc_cmap (&info->cmap); failed_cmap: dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
Signature · 1 line
2.46.0
PATCH 23/28 fbdev: imxfb: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/fbdev/imxfb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/imxfb.c +3 -3
@@ -814,9 +814,9 @@ static int imxfb_lcd_get_power(struct lcd_device *lcddev)if (!IS_ERR (fbi->lcd_pwr) && !regulator_is_enabled (fbi->lcd_pwr)) -return FB_BLANK_POWERDOWN ; +return LCD_POWER_OFF ; -return FB_BLANK_UNBLANK ; +return LCD_POWER_ON ; }static int imxfb_regulator_set (struct imxfb_info *fbi,int enable)
@@ -842,7 +842,7 @@ static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power)struct imxfb_info *fbi =dev_get_drvdata (&lcddev->dev);if (!IS_ERR (fbi->lcd_pwr)) -return imxfb_regulator_set (fbi, power ==FB_BLANK_UNBLANK ); +return imxfb_regulator_set (fbi, power ==LCD_POWER_ON );return 0 ; }
Signature · 1 line
2.46.0
PATCH 24/28 fbdev: omap: Use lcd power constants
In reply to Thomas ZimmermannReplace FB_BLANK_ constants with their counterparts from the lcd subsystem. The values are identical, so there's no change in functionality.
--- drivers/video/fbdev/omap/lcd_ams_delta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/video/fbdev/omap/lcd_ams_delta.c +4 -4
@@ -32,7 +32,7 @@ static struct gpio_desc *gpiod_ndisp;static int ams_delta_lcd_set_power (struct lcd_device *dev,int power) { -if (power ==FB_BLANK_UNBLANK ) { +if (power ==LCD_POWER_ON ) {if (!(ams_delta_lcd &AMS_DELTA_LCD_POWER )) {omap_writeb (ams_delta_lcd &AMS_DELTA_MAX_CONTRAST ,OMAP_PWL_ENABLE );
@@ -63,9 +63,9 @@ static int ams_delta_lcd_set_contrast(struct lcd_device *dev, int value)static int ams_delta_lcd_get_power (struct lcd_device *dev) {if (ams_delta_lcd &AMS_DELTA_LCD_POWER ) -return FB_BLANK_UNBLANK ; +return LCD_POWER_ON ;else -return FB_BLANK_POWERDOWN ; +return LCD_POWER_OFF ; }static int ams_delta_lcd_get_contrast (struct lcd_device *dev)
@@ -155,7 +155,7 @@ static int ams_delta_panel_probe(struct platform_device *pdev)#endif ams_delta_lcd_set_contrast (lcd_device,AMS_DELTA_DEFAULT_CONTRAST ); -ams_delta_lcd_set_power (lcd_device,FB_BLANK_UNBLANK ); +ams_delta_lcd_set_power (lcd_device,LCD_POWER_ON );omapfb_register_panel (&ams_delta_panel);return 0 ;
Signature · 1 line
2.46.0
PATCH 25/28 HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev
In reply to Thomas ZimmermannStore 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.
--- drivers/hid/hid-picolcd_fb.c | 4 ++++ drivers/hid/hid-picolcd_lcd.c | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/hid/hid-picolcd_fb.c +4 -0
@@ -497,6 +497,10 @@ int picolcd_init_framebuffer(struct picolcd_data *data)#endif #endif +#ifdef CONFIG_HID_PICOLCD_LCD + info->lcd_dev = data->lcd; +#endif + fbdata = info->par;spin_lock_init (&fbdata->lock); fbdata->picolcd = data;
drivers/hid/hid-picolcd_lcd.c +0 -6
@@ -41,15 +41,9 @@ static int picolcd_set_contrast(struct lcd_device *ldev, int contrast)return 0 ; } -static int picolcd_check_lcd_fb (struct lcd_device *ldev,struct fb_info *fb) -{ -return fb && fb ==picolcd_fbinfo ((struct picolcd_data *)lcd_get_data (ldev)); -} -static const struct lcd_ops picolcd_lcdops = { .get_contrast = picolcd_get_contrast, .set_contrast = picolcd_set_contrast, - .check_fb = picolcd_check_lcd_fb, };int picolcd_init_lcd (struct picolcd_data *data,struct hid_report *report)
Signature · 1 line
2.46.0
PATCH 26/28 backlight: lcd: Replace check_fb with controls_device
In reply to Thomas ZimmermannRename check_fb in struct lcd_ops with controls_device. The callback is not independent from fbdev's struct fb_info and tests is an lcd device controls a hardware display device. The new naming and semantics follow similar funcionality for backlight devices.
--- 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(-)
drivers/video/backlight/lcd.c +1 -1
@@ -55,7 +55,7 @@ static int fb_notifier_callback(struct notifier_block *self,if (!ld->ops) goto out; -if (ld->ops->check_fb && !ld->ops->check_fb (ld, evdata->info)) +if (ld->ops->controls_device && !ld->ops->controls_device (ld, info->device)) goto out;if (fb_lcd && fb_lcd != ld) goto out;
drivers/video/backlight/platform_lcd.c +5 -6
@@ -9,7 +9,6 @@#include <linux/module.h> #include <linux/platform_device.h> -#include <linux/fb.h> #include <linux/lcd.h> #include <linux/slab.h>
@@ -50,17 +49,17 @@ static int platform_lcd_set_power(struct lcd_device *lcd, int power)return 0 ; } -static int platform_lcd_match (struct lcd_device *lcd,struct fb_info *info) +static bool platform_lcd_controls_device (struct lcd_device *lcd,struct device *display_device) {struct platform_lcd *plcd =to_our_lcd (lcd); -return plcd->us->parent == info->device; +return plcd->us->parent == display_device; }static const struct lcd_ops platform_lcd_ops = { - .get_power = platform_lcd_get_power, - .set_power = platform_lcd_set_power, - .check_fb = platform_lcd_match, + .get_power = platform_lcd_get_power, + .set_power = platform_lcd_set_power, + .controls_device = platform_lcd_controls_device, };static int platform_lcd_probe (struct platform_device *pdev)
include/linux/lcd.h +12 -4
@@ -35,7 +35,6 @@*/ struct lcd_device ; -struct fb_info ;struct lcd_properties {/* The maximum value for contrast (read-only) */
@@ -54,9 +53,18 @@ struct lcd_ops {int (*set_contrast)(struct lcd_device *,int contrast);/* Set LCD panel mode (resolutions ...) */ int (*set_mode)(struct lcd_device *,struct fb_videomode *); -/* Check if given framebuffer device is the one LCD is bound to; -return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ -int (*check_fb)(struct lcd_device *,struct fb_info *); + +/* +* Check if the LCD controls the given display device. This +* operation is optional and if not implemented it is assumed that +* the display is always the one controlled by the LCD. +* +* RETURNS: +* +* If display_dev is NULL or display_dev matches the device controlled by +* the LCD, return true. Otherwise return false. +*/ +bool (*controls_device)(struct lcd_device *lcd,struct device *display_device); };struct lcd_device {
Signature · 1 line
2.46.0
PATCH 27/28 backlight: lcd: Remove struct fb_videomode from set_mode callback
In reply to Thomas ZimmermannImplementations 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.
--- 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(-)
drivers/video/backlight/corgi_lcd.c +2 -3
@@ -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)
drivers/video/backlight/lcd.c +3 -1
@@ -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:
drivers/video/backlight/tdo24m.c +2 -3
@@ -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)
include/linux/lcd.h +5 -2
@@ -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
Signature · 1 line
2.46.0
PATCH 28/28 backlight: lcd: Do not include <linux/fb.h> in lcd header
In reply to Thomas ZimmermannWith the excpetion of fb_notifier_callback(), none of the lcd code uses fbdev; especially the lcd drivers. Remove the include statement for <linux/fb.h> from the public lcd header.
--- include/linux/lcd.h | 1 - 1 file changed, 1 deletion(-)
include/linux/lcd.h +0 -1
@@ -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
Signature · 1 line
2.46.0
Re: [PATCH 25/28] HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev
In reply to Thomas ZimmermannQuoted 7 lines · Thomas Zimmermann
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_fbinpicolcd_lcdopsobsolete. Remove it.Signed-off-by Thomas Zimmermann <[email protected]>
Signature · 2 lines
Jiri Kosina SUSE Labs
Re: [PATCH 01/28] backlight: lcd: Rearrange code in fb_notifier_callback()
In reply to Thomas ZimmermannQuoted 1 line · Thomas Zimmermann
First aqcuire the
ops_lockand do al tests while holing it. Rearranges
s/aqcuire/acquire/
s/al/all/
Quoted 13 lines
the code in lcd's
fb_notifier_callback()to resemble the callback in the backlight module. This will simplify later changes to these tests.Signed-off-by Thomas Zimmermann <[email protected]>--- drivers/video/backlight/lcd.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)drivers/video/backlight/lcd.c +0
-0
drivers/video/backlight/lcd.c static int fb_notifier_callback(struct notifier_block *self, · line 36
Quoted 8 lines
drivers/video/backlight/lcd.c +3
-0@@ -29,21 +29,25 @@ static int fb_notifier_callback(struct notifier_block *self, {struct lcd_device *ld;struct fb_event *evdata = data; +struct fb_info *info = evdata->info; ld = container_of(self, struct lcd_device, fb_notif); +mutex_lock (&ld->ops_lock); +
guard(mutex)(&ld->ops_lock); and eliminating all the goto code would be better here but not a huge deal.
Daniel.
Re: [PATCH 26/28] backlight: lcd: Replace check_fb with controls_device
In reply to Thomas ZimmermannQuoted 4 lines · Thomas Zimmermann
Rename
check_fbin structlcd_opswithcontrols_device. The callback is not independent from fbdev's structfb_infoand tests is an lcd device controls a hardware display device. The new naming and semantics follow similar funcionality for backlight devices.
Nitpicking but...
s/funcionality/functionality/
Daniel.
Quoted 14 lines · Thomas Zimmermann
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_infocan 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.
Quoted 8 lines
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.
[1] https://patchwork.freedesktop.org/series/129782/
[2] https://patchwork.freedesktop.org/series/134718/
I shared a could of nitpicks. You can do what you like with them since none are major enough to stop me also sharing a:
Daniel.
Hi
Am 03.09.24 um 16:58 schrieb Daniel Thompson:
Quoted 19 lines · Thomas Zimmermann
Quoted 18 lines
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_infocan 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].
Quoted 7 lines
Quoted 4 lines
Hopefully this series can be merged at once through the lcd tree.
[1] https://patchwork.freedesktop.org/series/129782/
[2] https://patchwork.freedesktop.org/series/134718/I shared a could of nitpicks. You can do what you like with them since none are major enough to stop me also sharing a:
Reviewed-by Daniel Thompson <[email protected]>
Thanks for reviewing. I'll send out an update. Why tree do these patches go into? Backlight?
Best regards
Thomas
Quoted 3 lines
Daniel.
Signature · 7 lines
-- 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)
Helge, you might want to look through the fbdev patches in this series.
Am 20.08.24 um 11:22 schrieb Thomas Zimmermann:
Quoted 79 lines
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_infocan 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.
[1] https://patchwork.freedesktop.org/series/129782/
[2] https://patchwork.freedesktop.org/series/134718/Thomas Zimmermann (28):
backlight: lcd: Rearrange code infb_notifier_callback()
backlight: lcd: Test against struct fb_info.lcd_dev
backlight: lcd: AddLCD_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> forIOMEM()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: Removematch_fbfrom structplat_lcd_data
backlight:platform_lcd: Use lcd power constants
backlight: tdo24m: Use lcd power constants
fbdev: clps711x-fb: Replacecheck_fbin favor of struct
fb_info.lcd_dev
fbdev: clps711x-fb: Use lcd power constants
fbdev: imxfb: Replacecheck_fbin favor of struct fb_info.lcd_dev
fbdev: imxfb: Use lcd power constants
fbdev: omap: Use lcd power constants
HID: picoLCD: Replacecheck_fbin favor of struct fb_info.lcd_dev
backlight: lcd: Replacecheck_fbwithcontrols_device
backlight: lcd: Remove structfb_videomodefromset_modecallback
backlight: lcd: Do not include <linux/fb.h> in lcd headerdrivers/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 | 49 +++++++++++++++++++----- 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, 182 insertions(+), 156 deletions(-)
Signature · 7 lines
-- 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)
Lee Jones
maintainerQuoted 24 lines · Thomas Zimmermann
Hi
Am 03.09.24 um 16:58 schrieb Daniel Thompson:
Quoted 21 lines · Thomas Zimmermann
Quoted 20 lines
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_infocan 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.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
[1] https://patchwork.freedesktop.org/series/129782/
[2] https://patchwork.freedesktop.org/series/134718/I shared a could of nitpicks. You can do what you like with them since none are major enough to stop me also sharing a:
Reviewed-by Daniel Thompson <[email protected]>Thanks for reviewing. I'll send out an update. Why tree do these patches go into? Backlight?
Yes, that's expected.
Signature · 1 line
Lee Jones [李琼斯]