<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/video/backlight, branch v4.14.263</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.263</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.263'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-09-22T09:45:23+00:00</updated>
<entry>
<title>backlight: pwm_bl: Improve bootloader/kernel device handover</title>
<updated>2021-09-22T09:45:23+00:00</updated>
<author>
<name>Daniel Thompson</name>
<email>daniel.thompson@linaro.org</email>
</author>
<published>2021-07-22T14:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6b8de5614eab566535c2d584cecf3e162f211341'/>
<id>urn:sha1:6b8de5614eab566535c2d584cecf3e162f211341</id>
<content type='text'>
commit 79fad92f2e596f5a8dd085788a24f540263ef887 upstream.

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 &lt;marex@denx.de&gt;
Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
Tested-by: Marek Vasut &lt;marex@denx.de&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>backlight: lm3630a: Fix return code of .update_status() callback</title>
<updated>2021-07-20T14:17:51+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2021-06-21T12:21:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b8f6005f7cfbdb562e2a1d62762ba5200f9f1ed'/>
<id>urn:sha1:7b8f6005f7cfbdb562e2a1d62762ba5200f9f1ed</id>
<content type='text'>
[ Upstream commit b9481a667a90ec739995e85f91f3672ca44d6ffa ]

According to &lt;linux/backlight.h&gt; .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 &lt;u.kleine-koenig@pengutronix.de&gt;
Reviewed-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>backlight: sky81452-backlight: Fix refcount imbalance on error</title>
<updated>2020-10-29T08:07:04+00:00</updated>
<author>
<name>dinghao.liu@zju.edu.cn</name>
<email>dinghao.liu@zju.edu.cn</email>
</author>
<published>2020-08-20T06:38:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6630474d70c0c3cb80ad480b4bf0c813dbc4e9db'/>
<id>urn:sha1:6630474d70c0c3cb80ad480b4bf0c813dbc4e9db</id>
<content type='text'>
[ Upstream commit b7a4f80bc316a56d6ec8750e93e66f42431ed960 ]

When of_property_read_u32_array() returns an error code, a
pairing refcount decrement is needed to keep np's refcount
balanced.

Fixes: f705806c9f355 ("backlight: Add support Skyworks SKY81452 backlight driver")
Signed-off-by: Dinghao Liu &lt;dinghao.liu@zju.edu.cn&gt;
Reviewed-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>backlight: lp855x: Ensure regulators are disabled on probe failure</title>
<updated>2020-06-25T13:41:47+00:00</updated>
<author>
<name>Jon Hunter</name>
<email>jonathanh@nvidia.com</email>
</author>
<published>2020-02-24T14:07:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7d6960cd97513692c6529430345e7b6b2f5325b5'/>
<id>urn:sha1:7d6960cd97513692c6529430345e7b6b2f5325b5</id>
<content type='text'>
[ Upstream commit d8207c155a7c6015eb7f43739baa7dfb1fa638af ]

If probing the LP885x backlight fails after the regulators have been
enabled, then the following warning is seen when releasing the
regulators ...

 WARNING: CPU: 1 PID: 289 at drivers/regulator/core.c:2051 _regulator_put.part.28+0x158/0x160
 Modules linked in: tegra_xudc lp855x_bl(+) host1x pwm_tegra ip_tables x_tables ipv6 nf_defrag_ipv6
 CPU: 1 PID: 289 Comm: systemd-udevd Not tainted 5.6.0-rc2-next-20200224 #1
 Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)

 ...

 Call trace:
  _regulator_put.part.28+0x158/0x160
  regulator_put+0x34/0x50
  devm_regulator_release+0x10/0x18
  release_nodes+0x12c/0x230
  devres_release_all+0x34/0x50
  really_probe+0x1c0/0x370
  driver_probe_device+0x58/0x100
  device_driver_attach+0x6c/0x78
  __driver_attach+0xb0/0xf0
  bus_for_each_dev+0x68/0xc8
  driver_attach+0x20/0x28
  bus_add_driver+0x160/0x1f0
  driver_register+0x60/0x110
  i2c_register_driver+0x40/0x80
  lp855x_driver_init+0x20/0x1000 [lp855x_bl]
  do_one_initcall+0x58/0x1a0
  do_init_module+0x54/0x1d0
  load_module+0x1d80/0x21c8
  __do_sys_finit_module+0xe8/0x100
  __arm64_sys_finit_module+0x18/0x20
  el0_svc_common.constprop.3+0xb0/0x168
  do_el0_svc+0x20/0x98
  el0_sync_handler+0xf4/0x1b0
  el0_sync+0x140/0x180

Fix this by ensuring that the regulators are disabled, if enabled, on
probe failure.

Finally, ensure that the vddio regulator is disabled in the driver
remove handler.

Signed-off-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Reviewed-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>backlight: lm3630a: Return 0 on success in update_status functions</title>
<updated>2020-01-27T13:46:34+00:00</updated>
<author>
<name>Brian Masney</name>
<email>masneyb@onstation.org</email>
</author>
<published>2019-04-24T09:25:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=616d12400dc2cf57969978fd96e257d6559ea046'/>
<id>urn:sha1:616d12400dc2cf57969978fd96e257d6559ea046</id>
<content type='text'>
[ Upstream commit d3f48ec0954c6aac736ab21c34a35d7554409112 ]

lm3630a_bank_a_update_status() and lm3630a_bank_b_update_status()
both return the brightness value if the brightness was successfully
updated. Writing to these attributes via sysfs would cause a 'Bad
address' error to be returned. These functions should return 0 on
success, so let's change it to correct that error.

Fixes: 28e64a68a2ef ("backlight: lm3630: apply chip revision")
Signed-off-by: Brian Masney &lt;masneyb@onstation.org&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>backlight: lm3639: Unconditionally call led_classdev_unregister</title>
<updated>2019-11-24T07:23:24+00:00</updated>
<author>
<name>Nathan Chancellor</name>
<email>natechancellor@gmail.com</email>
</author>
<published>2018-09-21T20:21:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0f07c78437601b01eb2a75589561bea050a045e7'/>
<id>urn:sha1:0f07c78437601b01eb2a75589561bea050a045e7</id>
<content type='text'>
[ Upstream commit 7cea645ae9c5a54aa7904fddb2cdf250acd63a6c ]

Clang warns that the address of a pointer will always evaluated as true
in a boolean context.

drivers/video/backlight/lm3639_bl.c:403:14: warning: address of
'pchip-&gt;cdev_torch' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (&amp;pchip-&gt;cdev_torch)
        ~~   ~~~~~~~^~~~~~~~~~
drivers/video/backlight/lm3639_bl.c:405:14: warning: address of
'pchip-&gt;cdev_flash' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (&amp;pchip-&gt;cdev_flash)
        ~~   ~~~~~~~^~~~~~~~~~
2 warnings generated.

These statements have been present since 2012, introduced by
commit 0f59858d5119 ("backlight: add new lm3639 backlight
driver"). Given that they have been called unconditionally since
then presumably without any issues, removing the always true if
statements to fix the warnings without any real world changes.

Link: https://github.com/ClangBuiltLinux/linux/issues/119
Signed-off-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Reviewed-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial state</title>
<updated>2019-04-05T20:31:37+00:00</updated>
<author>
<name>Chen-Yu Tsai</name>
<email>wens@csie.org</email>
</author>
<published>2019-01-27T14:50:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f325ee43b7d6c9fef0c71b8b7eef4dd1b871645a'/>
<id>urn:sha1:f325ee43b7d6c9fef0c71b8b7eef4dd1b871645a</id>
<content type='text'>
[ Upstream commit cec2b18832e26bc866bef2be22eff4e25bbc4034 ]

gpiod_get_value() gives out a warning if access to the underlying gpiochip
requires sleeping, which is common for I2C based chips:

    WARNING: CPU: 0 PID: 77 at drivers/gpio/gpiolib.c:2500 gpiod_get_value+0xd0/0x100
    Modules linked in:
    CPU: 0 PID: 77 Comm: kworker/0:2 Not tainted 4.14.0-rc3-00589-gf32897915d48-dirty #90
    Hardware name: Allwinner sun4i/sun5i Families
    Workqueue: events deferred_probe_work_func
    [&lt;c010ec50&gt;] (unwind_backtrace) from [&lt;c010b784&gt;] (show_stack+0x10/0x14)
    [&lt;c010b784&gt;] (show_stack) from [&lt;c0797224&gt;] (dump_stack+0x88/0x9c)
    [&lt;c0797224&gt;] (dump_stack) from [&lt;c0125b08&gt;] (__warn+0xe8/0x100)
    [&lt;c0125b08&gt;] (__warn) from [&lt;c0125bd0&gt;] (warn_slowpath_null+0x20/0x28)
    [&lt;c0125bd0&gt;] (warn_slowpath_null) from [&lt;c037069c&gt;] (gpiod_get_value+0xd0/0x100)
    [&lt;c037069c&gt;] (gpiod_get_value) from [&lt;c03778d0&gt;] (pwm_backlight_probe+0x238/0x508)
    [&lt;c03778d0&gt;] (pwm_backlight_probe) from [&lt;c0411a2c&gt;] (platform_drv_probe+0x50/0xac)
    [&lt;c0411a2c&gt;] (platform_drv_probe) from [&lt;c0410224&gt;] (driver_probe_device+0x238/0x2e8)
    [&lt;c0410224&gt;] (driver_probe_device) from [&lt;c040e820&gt;] (bus_for_each_drv+0x44/0x94)
    [&lt;c040e820&gt;] (bus_for_each_drv) from [&lt;c040ff0c&gt;] (__device_attach+0xb0/0x114)
    [&lt;c040ff0c&gt;] (__device_attach) from [&lt;c040f4f8&gt;] (bus_probe_device+0x84/0x8c)
    [&lt;c040f4f8&gt;] (bus_probe_device) from [&lt;c040f944&gt;] (deferred_probe_work_func+0x50/0x14c)
    [&lt;c040f944&gt;] (deferred_probe_work_func) from [&lt;c013be84&gt;] (process_one_work+0x1ec/0x414)
    [&lt;c013be84&gt;] (process_one_work) from [&lt;c013ce5c&gt;] (worker_thread+0x2b0/0x5a0)
    [&lt;c013ce5c&gt;] (worker_thread) from [&lt;c0141908&gt;] (kthread+0x14c/0x154)
    [&lt;c0141908&gt;] (kthread) from [&lt;c0107ab0&gt;] (ret_from_fork+0x14/0x24)

This was missed in commit 0c9501f823a4 ("backlight: pwm_bl: Handle gpio
that can sleep"). The code was then moved to a separate function in
commit 7613c922315e ("backlight: pwm_bl: Move the checks for initial power
state to a separate function").

The only usage of gpiod_get_value() is during the probe stage, which is
safe to sleep in. Switch to gpiod_get_value_cansleep().

Fixes: 0c9501f823a4 ("backlight: pwm_bl: Handle gpio that can sleep")
Signed-off-by: Chen-Yu Tsai &lt;wens@csie.org&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Acked-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pwm-backlight: Enable/disable the PWM before/after LCD enable toggle.</title>
<updated>2019-03-27T05:13:55+00:00</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2018-03-28T17:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9c5f91cc9b2e8d4637182e9b43124af31803abbe'/>
<id>urn:sha1:9c5f91cc9b2e8d4637182e9b43124af31803abbe</id>
<content type='text'>
commit 5fb5caee92ba35a4a3baa61d45a78eb057e2c031 upstream.

Before this patch the enable signal was set before the PWM signal and
vice-versa on power off. This sequence is wrong, at least, it is on
the different panels datasheets that I checked, so I inverted the sequence
to follow the specs.

For reference the following panels have the mentioned sequence:
  - N133HSE-EA1 (Innolux)
  - N116BGE (Innolux)
  - N156BGE-L21 (Innolux)
  - B101EAN0 (Auo)
  - B101AW03 (Auo)
  - LTN101NT05 (Samsung)
  - CLAA101WA01A (Chunghwa)

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Acked-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Acked-by: Jingoo Han &lt;jingoohan1@gmail.com&gt;
Acked-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>backlight: pwm_bl: Don't use GPIOF_* with gpiod_get_direction</title>
<updated>2018-08-03T05:50:38+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2018-01-14T21:07:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4531135811a5bf90011c99fe850a45a16a584f8b'/>
<id>urn:sha1:4531135811a5bf90011c99fe850a45a16a584f8b</id>
<content type='text'>
[ Upstream commit bb084c0f61d659f0e6d371b096e0e57998f191d6 ]

The documentation was wrong, gpiod_get_direction() returns 0/1 instead
of the GPIOF_* flags. The docs were fixed with commit 94fc73094abe47
("gpio: correct docs about return value of gpiod_get_direction"). Now,
fix this user (until a better, system-wide solution is in place).

Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Acked-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Reviewed-by: Simon Horman &lt;horms+renesas@verge.net.au&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>backlight: tps65217_bl: Fix Device Tree node lookup</title>
<updated>2018-07-03T09:25:00+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-11-20T10:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=779d5f71c2323ef5610e7c3d9bdb73e5f92f660e'/>
<id>urn:sha1:779d5f71c2323ef5610e7c3d9bdb73e5f92f660e</id>
<content type='text'>
commit 2b12dfa124dbadf391cb9a616aaa6b056823bf75 upstream.

Fix child-node lookup during probe, which ended up searching the whole
device tree depth-first starting at the parent rather than just matching
on its children.

This would only cause trouble if the child node is missing while there
is an unrelated node named "backlight" elsewhere in the tree.

Cc: stable &lt;stable@vger.kernel.org&gt;     # 3.7
Fixes: eebfdc17cc6c ("backlight: Add TPS65217 WLED driver")
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
