- 10 May, 2024 4 commits
-
-
Ricardo B. Marliere authored
Since commit 43a7206b ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the lcd_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/2024032809-enchanted-conducive-3677@gregkhSigned-off-by: Lee Jones <lee@kernel.org>
-
Ricardo B. Marliere authored
Since commit 43a7206b ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the backlight_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240305-class_cleanup-backlight-v1-1-c0e15cc25be1@marliere.netSigned-off-by: Lee Jones <lee@kernel.org>
-
Dan Carpenter authored
The "num_levels" variable is used to store error codes from device_property_count_u32() so it needs to be signed. This doesn't cause an issue at runtime because devm_kcalloc() won't allocate negative sizes. However, it's still worth fixing. Fixes: b54c828b ("backlight: mp3309c: Make use of device properties") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Tested-by: Flavio Suligoi <f.suligoi@asem.it> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/74347f67-360d-4513-8939-595e3c4764fa@moroto.mountainSigned-off-by: Lee Jones <lee@kernel.org>
-
Lee Jones authored
Merge branches 'ib-backlight-auxdisplay-staging-omap-6.9', 'ib-backlight-auxdisplay-hid-fb-6.9' and 'ib-backlight-hid-fbdev-lcd-scripts-6.10' into ibs-for-backlight-merged
-
- 03 May, 2024 19 commits
-
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core code. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Suggested-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-19-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-18-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-17-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-16-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Bruno Prémont <bonbons@linux-vserver.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-15-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-14-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-13-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-12-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-11-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-10-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-9-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-8-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-7-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-6-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-5-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-4-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-3-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' is not modified by core backlight code, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-2-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
Krzysztof Kozlowski authored
'struct lcd_ops' passed in lcd_device_register() is not modified by core backlight code, so it can be made const for code safety. This allows drivers to also define the structure as const. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240424-video-backlight-lcd-ops-v2-1-1aaa82b07bc6@kernel.orgSigned-off-by: Lee Jones <lee@kernel.org>
-
- 28 Mar, 2024 16 commits
-
-
Thomas Zimmermann authored
Remove the field fb_blank from struct backlight_properties and remove all code that still sets or reads it. Backlight blank status is now tracked exclusively in struct backlight_properties.state. The core backlight code keeps the fb_blank and state fields in sync, but doesn't do anything else with fb_blank. Several drivers initialize fb_blank to FB_BLANK_UNBLANK to enable the backlight. This is already the default for the state field. So we can delete the fb_blank code from core and drivers and rely on the state field. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Flavio Suligoi <f.suligoi@asem.it> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev> Tested-by: Flavio Suligoi <f.suligoi@asem.it> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240319093915.31778-7-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The field fb_blank in struct backlight_properties is deprecated and should not be used. Don't output its value in the driver's debug print. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240319093915.31778-6-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
Replace the use of struct backlight_properties.fb_blank with backlight helpers. This effects testing if the backlight is blanked and reading the backlight's brightness level. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240319093915.31778-5-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The backlight is on for fb_blank eq FB_BLANK_UNBLANK, or off for any other value in fb_blank. But the field fb_blank in struct backlight_properties is deprecated and should not be used any longer. Replace the test for fb_blank in omap's backlight code with a simple boolean parameter and push the test into the update_status helper. Instead of reading fb_blank directly, decode the backlight device's status with backlight_is_blank(). Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240319093915.31778-4-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The callback set_power in struct omap_backlight_config is not implemented anywhere. Remove it from the structure and driver. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240319093915.31778-3-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
Replace the use of struct backlight_properties.fb_blank with a call to backlight_get_brightness(). The helper implements similar logic as the driver's function. It also accounts for BL_CORE_SUSPENDED for drivers that set BL_CORE_SUSPENDRESUME. Ht16k33 doesn't use this, so there's no change in behaviour here. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Robin van der Gracht <robin@protonic.nl> Cc: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Robin van der Gracht <robin@protonic.nl> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240319093915.31778-2-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
Replace check_fb with controls_device in struct backlight_ops. The new callback interface takes a Linux device instead of a framebuffer. Resolves one of the dependencies of backlight.h on fb.h. The few drivers that had custom implementations of check_fb can easily use the framebuffer's Linux device instead. Update them accordingly. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-11-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-10-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
For drivers that support backlight, LCD and fbdev devices, fbdev has to be initialized last. See documentation for struct fbinfo.bl_dev. The backlight name's index number comes from register_framebuffer(), which now happens after initializing the backlight device. So like in all other backlight drivers, we now give the backlight device a generic name without the fbdev index. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-9-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-8-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The internal check_fb callback from struct pwm_bl_data is never implemented. The driver's implementation of check_fb always returns true, which is the backlight core's default if no implementation has been set. So remove the code from the driver. v2: * reword commit message Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-7-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The driver's implementation of check_fb always returns true, which is the default if no implementation has been set. So remove the code from the driver. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-6-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
Update the driver to initialize struct fb_info.bl_dev to its backlight device, if any. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. v2: * protect against CONFIG_FB_BACKLIGHT (Javier, kernel test robot) * reword commit message (Daniel) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Bruno Prémont <bonbons@linux-vserver.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-5-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
For drivers that support backlight, LCD and fbdev devices, fbdev has to be initialized last. See documentation for struct fbinfo.bl_dev. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Bruno Prémont <bonbons@linux-vserver.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-4-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
The driver sets struct fb_info.bl_dev to the correct backlight device. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb() function from struct backlight_ops. v3: * use 'check_fb()' in commit message (Andy) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Robin van der Gracht <robin@protonic.nl> Acked-by: Robin van der Gracht <robin@protonic.nl> Acked-by: Andy Shevchenko <andy@kernel.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-3-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
Thomas Zimmermann authored
Framebuffer drivers for devices with dedicated backlight are supposed to set struct fb_info.bl_dev to the backlight's respective device. Use the value to match backlight and framebuffer in the backlight core code. The code first tests against struct backlight_ops.check_ops. If this test succeeds, it performs the test against fbdev. So backlight drivers can override the later test as before. Fbdev's backlight support depends on CONFIG_FB_BACKLIGHT. To avoid ifdef in the code, the new helper fb_bl_device() returns the backlight device, or NULL if the config option has been disabled. The test in the backlight code will then do nothing. v4: * declare empty fb_bl_device() as static inline * export fb_bl_device() v3: * hide ifdef in fb_bl_device() (Lee) * no if-else blocks (Andy) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240305162425.23845-2-tzimmermann@suse.deSigned-off-by: Lee Jones <lee@kernel.org>
-
- 24 Mar, 2024 1 commit
-
-
Linus Torvalds authored
-