summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'backlight-next-5.20' of ↵Linus Torvalds2022-08-063-23/+41
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "Core Framework: - Change maintainer email address Fix-ups: - Obtain OCP level from Device Tree; rt4831-backlight - DT fix-ups/conversions; richtek,rt4831-backlight - Remove unused code / functionatlity; platform_lcd - Switch to atomic PWM API; lp855x_bl * tag 'backlight-next-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: MAINTAINERS: Use Lee Jones' kernel.org address for Backlight submissions backlight: lp855x: Switch to atomic PWM API dt-bindings: backlight: Update Lee Jones' email address Revert "drivers/video/backlight/platform_lcd.c: add support for device tree based probe" backlight: rt4831: Apply ocp level from devicetree dt-bindings: backlight: rt4831: Add the new ocp level property
| * backlight: lp855x: Switch to atomic PWM APIMaíra Canal2022-07-191-12/+9
| | | | | | | | | | | | | | | | | | | | | | Remove legacy PWM interface (pwm_config, pwm_enable, pwm_disable) and replace it for the atomic PWM API. Signed-off-by: Maíra Canal <mairacanal@riseup.net> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220714215334.78226-1-mairacanal@riseup.net
| * Revert "drivers/video/backlight/platform_lcd.c: add support for device tree ↵Rob Herring2022-07-131-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | based probe" This reverts commit 52e842432f36d5b15227d0ee0d2aa3d2bc3cc0b2. The DT support never would have worked because there's no platform_data providing ops. There's not any documented binding for it either. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220629210024.815761-1-robh@kernel.org
| * backlight: rt4831: Apply ocp level from devicetreeChiYuan Huang2022-06-271-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'richtek,bled-ocp-microamp' property parsing in device_property_init function. This value may configure prior to the kernel driver. If it's not specified in devicetree, keep the original setting. Else, use clamp to align the value in min/max range and also roundup to choose the best selector. Reported-by: Lucas Tsai <lucas_tsai@richtek.com> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/1655807788-24511-3-git-send-email-u0084500@gmail.com
* | Merge branch 'for-linus' of ↵Linus Torvalds2022-08-041-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 Pull AVR32 updates from Hans-Christian Noren Egtvedt: "Mostly changes to documentation and comments" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32: video:backlight: remove reference to AVR32 architecture in ltv350qv video: remove support for non-existing atmel,at32ap-lcdc in atmel_lcdfb usb:udc: remove reference to AVR32 architecture in Atmel USBA Kconfig sound:spi: remove reference to AVR32 in Atmel AT73C213 DAC driver net: remove cdns,at32ap7000-macb device tree entry misc: update maintainer email address and description for atmel-ssc mfd: remove reference to AVR32 architecture in atmel-smc.c dma:dw: remove reference to AVR32 architecture in core.c
| * | video:backlight: remove reference to AVR32 architecture in ltv350qvHans-Christian Noren Egtvedt2022-08-031-2/+1
| | | | | | | | | | | | | | | | | | | | | The AVR32 architecture does no longer exist in the Linux kernel, hence remove a reference to also non-existing Linux BSP CD from Atmel. Signed-off-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
* | | treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE ↵Thomas Gleixner2022-06-101-9/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (part 2) Based on the normalized pattern: this program is free software you can redistribute it and/or modify it under the terms of the gnu general public license as published by the free software foundation version 2 this program is distributed as is without any warranty of any kind whether express or implied without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference. Reviewed-by: Allison Randal <allison@lohutok.net> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* / fbdev: omap: avoid using mach/*.h filesArnd Bergmann2022-04-212-4/+4
|/ | | | | | | | | | All the headers we actually need are now in include/linux/soc, so use those versions instead and allow compile-testing on other architectures. Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* Merge tag 'backlight-next-5.18' of ↵Linus Torvalds2022-03-252-11/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Device Support: - Add support for PM6150L to Qualcomm WLED Fix-ups" - Use kcalloc() to avoid open-coding; pwm_bl - Device Tree changes; qcom-wled - Cleanup or simplify code; backlight" * tag 'backlight-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: backlight: Slighly simplify devm_of_find_backlight() backlight: qcom-wled: Add PM6150L compatible dt-bindings: backlight: qcom-wled: Add PM6150L compatible backlight: pwm_bl: Avoid open coded arithmetic in memory allocation
| * backlight: backlight: Slighly simplify devm_of_find_backlight()Christophe JAILLET2022-03-081-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_add_action_or_reset() instead of devm_add_action()+hand writing what is done in the release function, should an error occur. This is more straightforward and saves a few lines of code. While at it, remove a useless test in devm_backlight_release(). 'data' is known to be not NULL when this function is called. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/f998a4291d865273afa0d1f85764a9ac7fbc1b64.1644738084.git.christophe.jaillet@wanadoo.fr
| * backlight: qcom-wled: Add PM6150L compatibleLuca Weiss2022-02-081-0/+1
| | | | | | | | | | | | | | | | | | PM6150L contains WLED of version 5. Add support ofr it to the driver. Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211229170358.2457006-3-luca.weiss@fairphone.com
| * backlight: pwm_bl: Avoid open coded arithmetic in memory allocationChristophe JAILLET2022-02-081-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | kmalloc_array()/kcalloc() should be used to avoid potential overflow when a multiplication is needed to compute the size of the requested memory. So turn a kzalloc()+explicit size computation into an equivalent kcalloc(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/bd3d74acfa58d59f6f5f81fc5a9fb409edb8d747.1644046817.git.christophe.jaillet@wanadoo.fr
* | Merge tag 'for-5.18/fbdev-1' of ↵Linus Torvalds2022-03-232-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev updates from Helge Deller: "Lots of small fixes and code cleanups across most of the fbdev drivers. This includes conversions to use helper functions, const conversions, spelling fixes, help text updates, adding return value checks, small build fixes, and much more" * tag 'for-5.18/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (59 commits) video: fbdev: kyro: make read-only array ODValues static const video: fbdev: offb: fix warning comparing pointer to 0 video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of video: fbdev: sm712fb: Fix crash in smtcfb_write() video: fbdev: s3c-fb: fix platform_get_irq.cocci warning video: fbdev: sm712fb: Fix crash in smtcfb_read() video: fbdev: via: check the return value of kstrdup() video: fbdev: au1100fb: Spelling s/palette/palette/ video: fbdev: atari: Atari 2 bpp (STe) palette bugfix video: fbdev: atari: Remove unused atafb_setcolreg() video: fbdev: atari: Convert to standard round_up() helper video: fbdev: atari: Fix TT High video mode video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf() video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf() video: fbdev: omapfb: Use sysfs_emit() instead of snprintf() video: fbdev: s3c-fb: Use platform_get_irq() to get the interrupt video: fbdev: Fix wrong file path for pvr2fb.c in Kconfig help text video: fbdev: pxa3xx-gcu: Remove unnecessary print function dev_err() video: fbdev: pxa168fb: Remove unnecessary print function dev_err() ...
| * | backlight: qcom-wled: Add PM6150L compatibleLuca Weiss2022-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | PM6150L contains WLED of version 5. Add support ofr it to the driver. Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Helge Deller <deller@gmx.de>
| * | backlight: lm3630a_bl: Remove redundant 'flush_workqueue()' callsXu Wang2022-01-291-1/+0
| |/ | | | | | | | | | | | | | | | | | | | | 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Helge Deller <deller@gmx.de>
* / spi: make remove callback a void functionUwe Kleine-König2022-02-099-20/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value returned by an spi driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Claudius Heine <ch@denx.de> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC Acked-by: Marcus Folkesson <marcus.folkesson@gmail.com> Acked-by: Łukasz Stelmach <l.stelmach@samsung.com> Acked-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220123175201.34839-6-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* backlight: qcom-wled: Respect enabled-strings in set_brightnessMarijn Suijten2021-12-221-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hardware is capable of controlling any non-contiguous sequence of LEDs specified in the DT using qcom,enabled-strings as u32 array, and this also follows from the DT-bindings documentation. The numbers specified in this array represent indices of the LED strings that are to be enabled and disabled. Its value is appropriately used to setup and enable string modules, but completely disregarded in the set_brightness paths which only iterate over the number of strings linearly. Take an example where only string 2 is enabled with qcom,enabled_strings=<2>: this string is appropriately enabled but subsequent brightness changes would have only touched the zero'th brightness register because num_strings is 1 here. This is simply addressed by looking up the string for this index in the enabled_strings array just like the other codepaths that iterate over num_strings. Likewise enabled_strings is now also used in the autodetection path for consistent behaviour: when a list of strings is specified in DT only those strings will be probed for autodetection, analogous to how the number of strings that need to be probed is already bound by qcom,num-strings. After all autodetection uses the set_brightness helpers to set an initial value, which could otherwise end up changing brightness on a different set of strings. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Fixes: 03b2b5e86986 ("backlight: qcom-wled: Add support for WLED4 peripheral") Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-10-marijn.suijten@somainline.org
* backlight: qcom-wled: Remove unnecessary double whitespaceMarijn Suijten2021-12-221-2/+2
| | | | | | | | | | | Remove redundant spaces inside for loop conditions. No other double spaces were found that are not part of indentation with `[^\s] `. Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-9-marijn.suijten@somainline.org
* backlight: qcom-wled: Provide enabled_strings default for WLED 4 and 5Marijn Suijten2021-12-221-0/+2
| | | | | | | | | | | | | | | Only WLED 3 sets a sensible default that allows operating this driver with just qcom,num-strings in the DT; WLED 4 and 5 require qcom,enabled-strings to be provided otherwise enabled_strings remains zero-initialized, resulting in every string-specific register write (currently only the setup and config functions, brightness follows in a future patch) to only configure the zero'th string multiple times. Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-8-marijn.suijten@somainline.org
* backlight: qcom-wled: Remove unnecessary 4th default string in WLED3Marijn Suijten2021-12-221-1/+1
| | | | | | | | | | | | | | | | The previous commit improves num_strings parsing to not go over the maximum of 3 strings for WLED3 anymore. Likewise this default index for a hypothetical 4th string is invalid and could access registers that are not mapped to the desired purpose. Removing this value gets rid of undesired confusion and avoids the possibility of accessing registers at this offset even if the 4th array element is used by accident. Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-7-marijn.suijten@somainline.org
* backlight: qcom-wled: Override default length with qcom,enabled-stringsMarijn Suijten2021-12-221-3/+9
| | | | | | | | | | | | | | | | | | | | The length of qcom,enabled-strings as property array is enough to determine the number of strings to be enabled, without needing to set qcom,num-strings to override the default number of strings when less than the default (which is also the maximum) is provided in DT. This also introduces an extra warning when qcom,num-strings is set, denoting that it is not necessary to set both anymore. It is usually more concise to set just qcom,num-length when a zero-based, contiguous range of strings is needed (the majority of the cases), or to only set qcom,enabled-strings when a specific set of indices is desired. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-6-marijn.suijten@somainline.org
* backlight: qcom-wled: Fix off-by-one maximum with default num_stringsMarijn Suijten2021-12-221-32/+16
| | | | | | | | | | | | | | | | | | | | | | | | | When not specifying num-strings in the DT the default is used, but +1 is added to it which turns WLED3 into 4 and WLED4/5 into 5 strings instead of 3 and 4 respectively, causing out-of-bounds reads and register read/writes. This +1 exists for a deficiency in the DT parsing code, and is simply omitted entirely - solving this oob issue - by parsing the property separately much like qcom,enabled-strings. This also enables more stringent checks on the maximum value when qcom,enabled-strings is provided in the DT, by parsing num-strings after enabled-strings to allow it to check against (and in a subsequent patch override) the length of enabled-strings: it is invalid to set num-strings higher than that. The DT currently utilizes it to get around an incorrect fixed read of four elements from that array (has been addressed in a prior patch) by setting a lower num-strings where desired. Fixes: 93c64f1ea1e8 ("leds: add Qualcomm PM8941 WLED driver") Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-By: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-5-marijn.suijten@somainline.org
* backlight: qcom-wled: Use cpu_to_le16 macro to perform conversionMarijn Suijten2021-12-221-12/+11
| | | | | | | | | | | The kernel already provides appropriate primitives to perform endianness conversion which should be used in favour of manual bit-wrangling. Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-4-marijn.suijten@somainline.org
* backlight: qcom-wled: Pass number of elements to read to read_u32_arrayMarijn Suijten2021-12-221-2/+7
| | | | | | | | | | | | | | | | | | | of_property_read_u32_array takes the number of elements to read as last argument. This does not always need to be 4 (sizeof(u32)) but should instead be the size of the array in DT as read just above with of_property_count_elems_of_size. To not make such an error go unnoticed again the driver now bails accordingly when of_property_read_u32_array returns an error. Surprisingly the indentation of newlined arguments is lining up again after prepending `rc = `. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-3-marijn.suijten@somainline.org
* backlight: qcom-wled: Validate enabled string indices in DTMarijn Suijten2021-12-221-1/+17
| | | | | | | | | | | | The strings passed in DT may possibly cause out-of-bounds register accesses and should be validated before use. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211115203459.1634079-2-marijn.suijten@somainline.org
* backlight: lp855x: Add support ACPI enumerationHans de Goede2021-12-221-12/+61
| | | | | | | | | | | | | | | | | The Xiaomi Mi Pad 2 tablet uses an ACPI enumerated LP8556 backlight controller for its LCD-panel, with a Xiaomi specific ACPI HID of "XMCC0001", add support for this. Note the new "if (id)" check also fixes a NULL pointer deref when a user tries to manually bind the driver from sysfs. When CONFIG_ACPI is disabled acpi_match_device() will always return NULL, so the lp855x_parse_acpi() call will get optimized away. Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211102225504.18920-3-hdegoede@redhat.com
* backlight: lp855x: Add dev helper variable to lp855x_probe()Hans de Goede2021-12-221-16/+13
| | | | | | | | | | | | | | | | Add a dev local variable to the lp855x_probe(), to replace "&cl->dev" and "lp->dev" in various places. Also switch to dev_err_probe() in one case which takes care of not printing -EPROBE_DEFER errors for us. This is mostly a preparation for adding ACPI enumeration support which will use the new "dev" variable more. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211102225504.18920-2-hdegoede@redhat.com
* backlight: lp855x: Move device_config setting out of lp855x_configure()Hans de Goede2021-12-221-16/+16
| | | | | | | | | | | | | Move the setting of the lp->cfg pointer to the chip specific lp855x_device_config struct from lp855x_configure() to lp855x_probe(), before calling lp855x_parse_dt(). This is a preperation patch for adding ACPI enumeration support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211102225504.18920-1-hdegoede@redhat.com
* video: backlight: ili9320: Make ili9320_remove() return voidUwe Kleine-König2021-10-203-4/+5
| | | | | | | | | | | | | Up to now ili9320_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211019120927.3822792-1-u.kleine-koenig@pengutronix.de
* backlight: Propagate errors from get_brightness()Thomas Weißschuh2021-09-231-5/+17
| | | | | | | | | | | | | backlight.h documents "struct backlight_ops->get_brightness()" to return a negative errno on failure. So far these errors have not been handled in the backlight core. This leads to negative values being exposed through sysfs although only positive values are documented to be reported. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* video: backlight: Drop maximum brightness override for brightness zeroMarek Vasut2021-09-221-6/+0
| | | | | | | | | | | | | | | | | | | | The note in c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c") says that gpio-backlight uses brightness as power state. This has been fixed since in ec665b756e6f7 ("backlight: gpio-backlight: Correct initial power state handling") and other backlight drivers do not require this workaround. Drop the workaround. This fixes the case where e.g. pwm-backlight can perfectly well be set to brightness 0 on boot in DT, which without this patch leads to the display brightness to be max instead of off. Fixes: c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c") Cc: <stable@vger.kernel.org> # 5.4+ Cc: <stable@vger.kernel.org> # 4.19.x: ec665b756e6f7: backlight: gpio-backlight: Correct initial power state handling Signed-off-by: Marek Vasut <marex@denx.de> Acked-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: pwm_bl: Improve bootloader/kernel device handoverDaniel Thompson2021-08-191-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently there are (at least) two problems in the way pwm_bl starts managing the enable_gpio pin. Both occur when the backlight is initially off and the driver finds the pin not already in output mode and, as a result, unconditionally switches it to output-mode and asserts the signal. Problem 1: This could cause the backlight to flicker since, at this stage in driver initialisation, we have no idea what the PWM and regulator are doing (an unconfigured PWM could easily "rest" at 100% duty cycle). Problem 2: This will cause us not to correctly honour the post_pwm_on_delay (which also risks flickers). Fix this by moving the code to configure the GPIO output mode until after we have examines the handover state. That allows us to initialize enable_gpio to off if the backlight is currently off and on if the backlight is on. Cc: stable@vger.kernel.org Reported-by: Marek Vasut <marex@denx.de> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Marek Vasut <marex@denx.de> Tested-by: Marek Vasut <marex@denx.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: ktd253: Stabilize backlightLinus Walleij2021-07-211-20/+55
| | | | | | | | | | | | | | | | | | | | Remove interrupt disablement during backlight setting. It is way to dangerous and makes platforms instable by having it miss vblank IRQs leading to the graphics derailing. The code is using ndelay() which is not available on platforms such as ARM and will result in 32 * udelay(1) which is substantial. Add some code to detect if an interrupt occurs during the tight loop and in that case just redo it from the top. Fixes: 5317f37e48b9 ("backlight: Add Kinetic KTD253 backlight driver") Cc: Stephan Gerhold <stephan@gerhold.net> Reported-by: newbyte@disroot.org Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: lm3630a: Convert to atomic PWM API and check for errorsUwe Kleine-König2021-06-221-23/+19
| | | | | | | | | | | | | The practical upside here is that this only needs a single API call to program the hardware which (depending on the underlaying hardware) can be more effective and prevents glitches. Up to now the return value of the pwm functions was ignored. Fix this and propagate the error to the caller. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: lm3630a: Fix return code of .update_status() callbackUwe Kleine-König2021-06-221-6/+6
| | | | | | | | | | | | | According to <linux/backlight.h> .update_status() is supposed to return 0 on success and a negative error code otherwise. Adapt lm3630a_bank_a_update_status() and lm3630a_bank_b_update_status() to actually do it. While touching that also add the error code to the failure message. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: Kconfig whitespace and indentation cleanupsJuerg Haefliger2021-06-011-11/+11
| | | | | | | | | Remove leading whitespaces, replace multi spaces with tabs, and fix help text indentation. Signed-off-by: Juerg Haefliger <juergh@canonical.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* video: backlight: qcom-wled: Add PMI8994 compatibleKonrad Dybcio2021-05-271-0/+1
| | | | | | | | Add a compatible for PMI8994 WLED. It uses the V4 of WLED IP. Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: rt4831: Adds support for Richtek RT4831 backlightChiYuan Huang2021-05-193-0/+212
| | | | | | | | Adds support for Richtek RT4831 backlight. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: lm3630a_bl: Put fwnode in error case during ->probe()Andy Shevchenko2021-05-191-1/+3
| | | | | | | | | | | | | device_for_each_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Cc: Brian Masney <masneyb@onstation.org> Cc: Dan Murphy <dmurphy@ti.com> Fixes: 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support") Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Brian Masney <masneyb@onstation.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: journada720: Fix Wmisleading-indentation warningArnd Bergmann2021-03-231-22/+22
| | | | | | | | | | | | | | | | | With gcc-11, we get a warning about code that looks correct but badly indented: drivers/video/backlight/jornada720_bl.c: In function ‘jornada_bl_update_status’: drivers/video/backlight/jornada720_bl.c:66:11: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation] 66 | } else /* turn on backlight */ | ^~~~ Change the formatting according to our normal conventions. Fixes: 13a7b5dc0d17 ("backlight: Adds HP Jornada 700 series backlight driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: qcom-wled: Correct the sync_toggle sequenceKiran Gunda2021-03-231-6/+6
| | | | | | | | | | | | | As per the current implementation, after FSC (Full Scale Current) and brightness update the sync bits are set-then-cleared. But, the FSC and brightness sync takes place when the sync bits are set (e.g. on a rising edge). So the hardware team recommends a clear-then-set approach in order to guarantee such a transition regardless of the previous register state. Signed-off-by: Kiran Gunda <kgunda@codeaurora.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: qcom-wled: Fix FSC update issue for WLED5Kiran Gunda2021-03-221-6/+19
| | | | | | | | | | | | | | | | Currently, for WLED5, the FSC (Full scale current) setting is not updated properly due to driver toggling the wrong register after an FSC update. On WLED5 we should only toggle the MOD_SYNC bit after a brightness update. For an FSC update we need to toggle the SYNC bits instead. Fix it by adopting the common wled3_sync_toggle() for WLED5 and introducing new code to the brightness update path to compensate. Signed-off-by: Kiran Gunda <kgunda@codeaurora.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: ktd253: Support KTD259Linus Walleij2021-03-221-0/+1
| | | | | | | | | The KTD259 works just like KTD253 so add this compatible to the driver. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* backlight: qcom-wled: Use sink_addr for sync toggleObeida Shamoun2021-03-221-2/+2
| | | | | | | | | | | | | | | | | | | WLED3_SINK_REG_SYNC is, as the name implies, a sink register offset. Therefore, use the sink address as base instead of the ctrl address. This fixes the sync toggle on wled4, which can be observed by the fact that adjusting brightness now works. It has no effect on wled3 because sink and ctrl base addresses are the same. This allows adjusting the brightness without having to disable then reenable the module. Signed-off-by: Obeida Shamoun <oshmoun100@googlemail.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Kiran Gunda <kgunda@codeaurora.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-armLinus Torvalds2021-02-221-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull ARM updates from Russell King: - Generalise byte swapping assembly - Update debug addresses for STI - Validate start of physical memory with DTB - Do not clear SCTLR.nTLSMD in decompressor - amba/locomo/sa1111 devices remove method return type is void - address markers for KASAN in page table dump * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9065/1: OABI compat: fix build when EPOLL is not enabled ARM: 9055/1: mailbox: arm_mhuv2: make remove callback return void amba: Make use of bus_type functions amba: Make the remove callback return void vfio: platform: simplify device removal amba: reorder functions amba: Fix resource leak for drivers without .remove ARM: 9054/1: arch/arm/mm/mmu.c: Remove duplicate header ARM: 9053/1: arm/mm/ptdump:Add address markers for KASAN regions ARM: 9051/1: vdso: remove unneded extra-y addition ARM: 9050/1: Kconfig: Select ARCH_HAVE_NMI_SAFE_CMPXCHG where possible ARM: 9049/1: locomo: make locomo bus's remove callback return void ARM: 9048/1: sa1111: make sa1111 bus's remove callback return void ARM: 9047/1: smp: remove unused variable ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores ARM: 9045/1: uncompress: Validate start of physical memory against passed DTB ARM: 9042/1: debug: no uncompress debugging while semihosting ARM: 9041/1: sti LL_UART: add STiH418 SBC UART0 support ARM: 9040/1: use DEBUG_UART_PHYS and DEBUG_UART_VIRT for sti LL_UART ARM: 9039/1: assembler: generalize byte swapping macro into rev_l
| * ARM: 9049/1: locomo: make locomo bus's remove callback return voidUwe Kleine-König2021-02-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver core ignores the return value of struct bus_type::remove because there is only little that can be done. To simplify the quest to make this function return void, let struct locomo_driver::remove return void, too. All users already unconditionally return 0, this commit makes it obvious that returning an error code is a bad idea and ensures future users behave accordingly. Link: https://lore.kernel.org/r/20201126110140.2021758-1-u.kleine-koenig@pengutronix.de Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
* | backlight/video: Use Platform getter/setter functionsJulia Lawall2021-02-121-1/+1
| | | | | | | | | | | | | | | | | | Use getter and setter functions, for platform_device structures and a spi_device structure. Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | backlight: ktd253: Bring up in a known stateLinus Walleij2021-02-091-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The KTD253 backlight might already be on when the driver is probed: then we don't really know what the current ratio is and all light intensity settings will be off relative to what it was at boot. To fix this, bring up the backlight OFF then move it to the default backlight from there so we know the state. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | backlight: sky81452-backlight: Convert comma to semicolonZheng Yongjun2021-01-201-1/+1
| | | | | | | | | | | | | | | | Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | backlight: lms283gf05: Convert to GPIO descriptorsLinus Walleij2021-01-201-26/+17
|/ | | | | | | | | | | | | | | | | | | | | | This converts the lms283gf05 backlight driver to use GPIO descriptors and switches the single PXA Palm Z2 device over to defining these. Since the platform data was only used to convey GPIO information we can delete the platform data header. Notice that we define the proper active low semantics in the board file GPIO descriptor table (active low) and assert the reset line by bringing it to "1" (asserted). Cc: Marek Vasut <marex@denx.de> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Daniel Mack <daniel@zonque.org> Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>