diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-11-22 16:29:57 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-11-22 16:29:57 -0800 |
commit | 2fb7eb3d7e8c5c0375c726c7d5c443e6f7e53741 (patch) | |
tree | d6cf7e7bf329e8758ef9ede1a37dad55763a21d9 /include | |
parent | 93251bdf7a771c4eeb0f95fa38ded92e95154ef7 (diff) | |
parent | 3adec6f907b698b32ab62f70da31b41abed00c59 (diff) | |
download | lwn-2fb7eb3d7e8c5c0375c726c7d5c443e6f7e53741.tar.gz lwn-2fb7eb3d7e8c5c0375c726c7d5c443e6f7e53741.zip |
Merge tag 'backlight-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones:
- Improve handling of LCD power states and interactions with the fbdev
subsystem
- Introduce new LCD_POWER_ constants to decouple the LCD subsystem from
fbdev
- Update several drivers to use the new LCD_POWER_ constants
- Clarify the semantics of the lcd_ops.controls_device callback
- Remove unnecessary includes and dependencies
- Remove unused notifier functionality
- Simplify code with scoped for-each loops
- Fix module autoloading for the ktz8866 driver
- Update device tree bindings to yaml format
- Minor cleanups and improvements in various drivers
* tag 'backlight-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: (33 commits)
MAINTAINERS: Use Daniel Thompson's korg address for Backlight work
dt-bindings: backlight: Convert zii,rave-sp-backlight.txt to yaml
backlight: Remove notifier
backlight: ktz8866: Fix module autoloading
backlight: 88pm860x_bl: Simplify with scoped for each OF child loop
backlight: lcd: Do not include <linux/fb.h> in lcd header
backlight: lcd: Remove struct fb_videomode from set_mode callback
backlight: lcd: Replace check_fb with controls_device
HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev
fbdev: omap: Use lcd power constants
fbdev: imxfb: Use lcd power constants
fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev
fbdev: clps711x-fb: Use lcd power constants
fbdev: clps711x-fb: Replace check_fb in favor of struct fb_info.lcd_dev
backlight: tdo24m: Use lcd power constants
backlight: platform_lcd: Use lcd power constants
backlight: platform_lcd: Remove match_fb from struct plat_lcd_data
backlight: platform_lcd: Remove include statement for <linux/backlight.h>
backlight: otm3225a: Use lcd power constants
backlight: ltv350qv: Use lcd power constants
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/backlight.h | 20 | ||||
-rw-r--r-- | include/linux/fb.h | 13 | ||||
-rw-r--r-- | include/linux/lcd.h | 29 | ||||
-rw-r--r-- | include/video/platform_lcd.h | 3 |
4 files changed, 35 insertions, 30 deletions
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index ea9c1bc8148e..f5652e5a9060 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -66,24 +66,6 @@ enum backlight_type { BACKLIGHT_TYPE_MAX, }; -/** - * enum backlight_notification - the type of notification - * - * The notifications that is used for notification sent to the receiver - * that registered notifications using backlight_register_notifier(). - */ -enum backlight_notification { - /** - * @BACKLIGHT_REGISTERED: The backlight device is registered. - */ - BACKLIGHT_REGISTERED, - - /** - * @BACKLIGHT_UNREGISTERED: The backlight revice is unregistered. - */ - BACKLIGHT_UNREGISTERED, -}; - /** enum backlight_scale - the type of scale used for brightness values * * The type of scale used for brightness values. @@ -421,8 +403,6 @@ void devm_backlight_device_unregister(struct device *dev, struct backlight_device *bd); void backlight_force_update(struct backlight_device *bd, enum backlight_update_reason reason); -int backlight_register_notifier(struct notifier_block *nb); -int backlight_unregister_notifier(struct notifier_block *nb); struct backlight_device *backlight_device_get_by_name(const char *name); struct backlight_device *backlight_device_get_by_type(enum backlight_type type); int backlight_device_set_brightness(struct backlight_device *bd, diff --git a/include/linux/fb.h b/include/linux/fb.h index 267b59ead432..5ba187e08cf7 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -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; @@ -754,6 +762,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 diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 68703a51dc53..c3ccdff4519a 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h @@ -12,7 +12,11 @@ #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 +#define LCD_POWER_REDUCED_VSYNC_SUSPEND (2) // deprecated; don't use in new code +#define LCD_POWER_OFF (4) /* Notes on locking: * @@ -30,7 +34,6 @@ */ struct lcd_device; -struct fb_info; struct lcd_properties { /* The maximum value for contrast (read-only) */ @@ -47,11 +50,23 @@ 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 *); - /* 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 *); + + /* + * 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 + * 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 { diff --git a/include/video/platform_lcd.h b/include/video/platform_lcd.h index 6a95184a28c1..2bdf46519298 100644 --- a/include/video/platform_lcd.h +++ b/include/video/platform_lcd.h @@ -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 *); }; - |