summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
Commit message (Collapse)AuthorAgeFilesLines
* backlight: l4f00242t03: Add check for spi_setupChen Ni2024-08-011-1/+4
| | | | | | | | | | Add check for the return value of spi_setup() and return the error if it fails in order to catch the error. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240705092800.3221159-1-nichen@iscas.ac.cn Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: sky81452-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-1/+1
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-18-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: rave-sp-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-1/+1
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-17-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: pwm-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-2/+2
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-16-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: pcf50633-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-3/+2
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-15-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: pandora-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-2/+1
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-14-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: mp3309c: Use backlight power constantsThomas Zimmermann2024-07-041-2/+2
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-13-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: lm3533-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-2/+1
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-12-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: led-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-2/+2
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-11-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: ktd253-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-3/+2
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-10-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: kb3886-bl: Use backlight power constantsThomas Zimmermann2024-07-041-2/+2
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-9-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: journada_bl: Use backlight power constantsThomas Zimmermann2024-07-041-2/+1
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-8-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: ipaq-micro-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-2/+1
| | | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-7-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: gpio-backlight: Use backlight power constantsThomas Zimmermann2024-07-041-5/+4
| | | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-6-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: corgi-lcd: Use backlight power constantsThomas Zimmermann2024-07-041-2/+2
| | | | | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Only change the driver's backlight device, but leave the LCD device as-is. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-5-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: ams369fb06: Use backlight power constantsThomas Zimmermann2024-07-041-12/+11
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-4-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: aat2870-backlight: Use blacklight power constantsThomas Zimmermann2024-07-041-2/+2
| | | | | | | | | | | Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240624152033.25016-3-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: lm3509_bl: Fix early returns in for_each_child_of_node()Javier Carrasco2024-06-261-2/+1
| | | | | | | | | | | | | | | | | The for_each_child_of_node() macro automatically decrements the child refcount at the end of every iteration. On early exits, of_node_put() must be used to manually decrement the refcount and avoid memory leaks. The scoped version of the macro accounts for such early breaks, fixing the early exits without the need for explicit calls to of_node_put(). Reported-by: kernel test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@inria.fr> Closes: https://lore.kernel.org/r/202406172314.2vVgelaS-lkp@intel.com/ Fixes: b72755f5b577 ("backlight: Add new lm3509 backlight driver") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://lore.kernel.org/r/20240624-lm3509_bl_scoped-v1-1-ceba9df38f23@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: Drop explicit initialization of struct i2c_device_id::driver_data ↵Uwe Kleine-König2024-06-208-9/+12
| | | | | | | | | | | | | | | | | to 0 These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove commas after the sentinel entries. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/20240619193558.2543645-2-u.kleine-koenig@baylibre.com Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: Add missing MODULE_DESCRIPTION() macrosJeff Johnson2024-06-132-0/+2
| | | | | | | | | | | | | With ARCH=x86, make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/video/backlight/platform_lcd.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/video/backlight/rt4831-backlight.o Add the missing invocations of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://lore.kernel.org/r/20240612-md-drivers-video-backlight-v1-1-f4ca1beb36cc@quicinc.com Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: lm3509_bl: Fix NULL vs IS_ERR() check in register() functionDan Carpenter2024-06-131-2/+3
| | | | | | | | | | | The devm_backlight_device_register() doesn't return NULL, it returns error pointers. Update the error checking to match. Fixes: b72755f5b577 ("backlight: Add new lm3509 backlight driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/187b5bc5-a010-46c2-8ead-980df9efae79@moroto.mountain Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: Add new lm3509 backlight driverPatrick Gansterer2024-05-313-0/+348
| | | | | | | | | | | | | This is a general driver for LM3509 backlight chip of TI. LM3509 is High Efficiency Boost for White LEDs and/or OLED Displays with Dual Current Sinks. This driver supports OLED/White LED select, brightness control and sub/main control. The datasheet can be found at http://www.ti.com/product/lm3509. Signed-off-by: Patrick Gansterer <paroga@paroga.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240526105136.721529-3-paroga@paroga.com Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: sky81452-backlight: Remove unnecessary call to of_node_get()Shresth Prasad2024-05-101-6/+2
| | | | | | | | | | | `dev->of_node` already has a reference to the device_node and calling of_node_get on it is unnecessary. All conresponding calls to of_node_put are also removed. Signed-off-by: Shresth Prasad <shresthprasad7@gmail.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240502172121.8695-2-shresthprasad7@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: mp3309c: Fix LEDs flickering in PWM modeFlavio Suligoi2024-05-101-5/+0
| | | | | | | | | | | | | | | | | | | | | | The mp3309 has two configuration registers, named according to their address (0x00 and 0x01). In the second register (0x01), the bit DIMS (Dimming Mode Select) must be always 0 (zero), in both analog (via I2C commands) and PWM dimming mode. In the initial driver version, the DIMS bit was set in PWM mode and reset in analog mode. But if the DIMS bit is set in pwm dimming mode and other devices are connected on the same I2C bus, every I2C commands on the bus generates a flickering on the LEDs powered by the mp3309c. This change concerns the chip initialization and does not impact any existing device-tree configuration. Signed-off-by: Flavio Suligoi <f.suligoi@asem.it> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240417153105.1794134-2-f.suligoi@asem.it Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: otm3225a: Drop driver owner assignmentKrzysztof Kozlowski2024-05-101-1/+0
| | | | | | | | | | Core in spi_register_driver() already sets the .owner, so driver does not need to. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240327174714.519577-1-krzysztof.kozlowski@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: lp8788: Drop support for platform dataUwe Kleine-König2024-05-101-143/+8
| | | | | | | | | | | | The backlight driver supports getting passed platform data. However this isn't used. This allows to remove quite some dead code from the driver because bl->pdata is always NULL, and so bl->mode is always LP8788_BL_REGISTER_ONLY. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240329133839.550065-2-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: lcd: Make lcd_class constantRicardo B. Marliere2024-05-101-10/+13
| | | | | | | | | | | | | | | | Since commit 43a7206b0963 ("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@gregkh Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: Make backlight_class constantRicardo B. Marliere2024-05-101-13/+16
| | | | | | | | | | | | | | | Since commit 43a7206b0963 ("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.net Signed-off-by: Lee Jones <lee@kernel.org>
* backlight: mp3309c: Fix signedness bug in mp3309c_parse_fwnode()Dan Carpenter2024-05-101-1/+2
| | | | | | | | | | | | | | | 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: b54c828bdba9 ("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.mountain Signed-off-by: Lee Jones <lee@kernel.org>
*-. Merge branches 'ib-backlight-auxdisplay-staging-omap-6.9', ↵Lee Jones2024-05-1020-54/+39
|\ \ | | | | | | | | | 'ib-backlight-auxdisplay-hid-fb-6.9' and 'ib-backlight-hid-fbdev-lcd-scripts-6.10' into ibs-for-backlight-merged
| | * backlight: tdo24m: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: platform_lcd: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: otm3225a: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: ltv350qv: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: lms501kf03: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: lms283gf05: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: l4f00242t03: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: jornada720_lcd: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: ili9320: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: ili922x: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: hx8357: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: corgi_lcd: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: ams369fg06: Constify lcd_opsKrzysztof Kozlowski2024-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| | * backlight: lcd: Constify lcd_opsKrzysztof Kozlowski2024-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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.org Signed-off-by: Lee Jones <lee@kernel.org>
| * | backlight: Add controls_device callback to struct backlight_opsThomas Zimmermann2024-03-284-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.de Signed-off-by: Lee Jones <lee@kernel.org>
| * | backlight: pwm-backlight: Remove struct backlight_ops.check_fbThomas Zimmermann2024-03-281-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.de Signed-off-by: Lee Jones <lee@kernel.org>
| * | backlight: aat2870-backlight: Remove struct backlight.check_fbThomas Zimmermann2024-03-281-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.de Signed-off-by: Lee Jones <lee@kernel.org>
| * | backlight: Match backlight device against struct fb_info.bl_devThomas Zimmermann2024-03-281-2/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.de Signed-off-by: Lee Jones <lee@kernel.org>
* | backlight: Remove fb_blank from struct backlight_propertiesThomas Zimmermann2024-03-283-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.de Signed-off-by: Lee Jones <lee@kernel.org>
* | backlight: omap1: Replace FB_BLANK_ states with simple on/offThomas Zimmermann2024-03-281-25/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.de Signed-off-by: Lee Jones <lee@kernel.org>