<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/leds, branch v4.14.217</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.217</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.217'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-11-05T10:06:58+00:00</updated>
<entry>
<title>leds: bcm6328, bcm6358: use devres LED registering function</title>
<updated>2020-11-05T10:06:58+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2020-09-17T22:32:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=286ac996f19b7cd468cd738b0036c256177ea32e'/>
<id>urn:sha1:286ac996f19b7cd468cd738b0036c256177ea32e</id>
<content type='text'>
commit ff5c89d44453e7ad99502b04bf798a3fc32c758b upstream.

These two drivers do not provide remove method and use devres for
allocation of other resources, yet they use led_classdev_register
instead of the devres variant, devm_led_classdev_register.

Fix this.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Cc: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
Cc: Kevin Cernekee &lt;cernekee@gmail.com&gt;
Cc: Jaedon Shin &lt;jaedon.shin@gmail.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>leds: core: Flush scheduled work for system suspend</title>
<updated>2020-08-21T07:48:09+00:00</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kai.heng.feng@canonical.com</email>
</author>
<published>2020-07-02T05:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a14ab85a26751b93d9b0597600e0895488a75730'/>
<id>urn:sha1:a14ab85a26751b93d9b0597600e0895488a75730</id>
<content type='text'>
[ Upstream commit 302a085c20194bfa7df52e0fe684ee0c41da02e6 ]

Sometimes LED won't be turned off by LED_CORE_SUSPENDRESUME flag upon
system suspend.

led_set_brightness_nopm() uses schedule_work() to set LED brightness.
However, there's no guarantee that the scheduled work gets executed
because no one flushes the work.

So flush the scheduled work to make sure LED gets turned off.

Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Acked-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Fixes: 81fe8e5b73e3 ("leds: core: Add led_set_brightness_nosleep{nopm} functions")
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: lm355x: avoid enum conversion warning</title>
<updated>2020-08-21T07:48:07+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2020-05-05T14:19:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e361b9c851ad749dc4f5dae18c00a6070e946b38'/>
<id>urn:sha1:e361b9c851ad749dc4f5dae18c00a6070e946b38</id>
<content type='text'>
[ Upstream commit 985b1f596f9ed56f42b8c2280005f943e1434c06 ]

clang points out that doing arithmetic between diffent enums is usually
a mistake:

drivers/leds/leds-lm355x.c:167:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion]
                reg_val = pdata-&gt;pin_tx2 | pdata-&gt;ntc_pin;
                          ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
drivers/leds/leds-lm355x.c:178:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion]
                reg_val = pdata-&gt;pin_tx2 | pdata-&gt;ntc_pin | pdata-&gt;pass_mode;
                          ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~

In this driver, it is intentional, so add a cast to hide the false-positive
warning. It appears to be the only instance of this warning at the moment.

Fixes: b98d13c72592 ("leds: Add new LED driver for lm355x chips")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: 88pm860x: fix use-after-free on unbind</title>
<updated>2020-08-21T07:47:59+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2020-06-01T13:39:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efe1c042fa521dcce374ca23560480ff6927a58e'/>
<id>urn:sha1:efe1c042fa521dcce374ca23560480ff6927a58e</id>
<content type='text'>
commit eca21c2d8655387823d695b26e6fe78cf3975c05 upstream.

Several MFD child drivers register their class devices directly under
the parent device. This means you cannot blindly do devres conversions
so that deregistration ends up being tied to the parent device,
something which leads to use-after-free on driver unbind when the class
device is released while still being registered.

Fixes: 375446df95ee ("leds: 88pm860x: Use devm_led_classdev_register")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 4.6
Cc: Amitoj Kaur Chawla &lt;amitoj1606@gmail.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>leds: lm3533: fix use-after-free on unbind</title>
<updated>2020-08-21T07:47:59+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2020-06-01T13:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=661926601c318c4cf30272ac93ed2bf1c80ff778'/>
<id>urn:sha1:661926601c318c4cf30272ac93ed2bf1c80ff778</id>
<content type='text'>
commit d584221e683bbd173738603b83a315f27d27d043 upstream.

Several MFD child drivers register their class devices directly under
the parent device. This means you cannot blindly do devres conversions
so that deregistration ends up being tied to the parent device,
something which leads to use-after-free on driver unbind when the class
device is released while still being registered.

Fixes: 50154e29e5cc ("leds: lm3533: Use devm_led_classdev_register")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 4.6
Cc: Amitoj Kaur Chawla &lt;amitoj1606@gmail.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>leds: da903x: fix use-after-free on unbind</title>
<updated>2020-08-21T07:47:59+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2020-06-01T13:39:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1452c5ffe79f34ded327310a84a67d653a00e68e'/>
<id>urn:sha1:1452c5ffe79f34ded327310a84a67d653a00e68e</id>
<content type='text'>
commit 6f4aa35744f69ed9b0bf5a736c9ca9b44bc1dcea upstream.

Several MFD child drivers register their class devices directly under
the parent device. This means you cannot blindly do devres conversions
so that deregistration ends up being tied to the parent device,
something which leads to use-after-free on driver unbind when the class
device is released while still being registered.

Fixes: eed16255d66b ("leds: da903x: Use devm_led_classdev_register")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 4.6
Cc: Amitoj Kaur Chawla &lt;amitoj1606@gmail.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>leds: wm831x-status: fix use-after-free on unbind</title>
<updated>2020-08-21T07:47:58+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2020-06-01T13:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbe4aa36c940dc309133e5d10a5771f3d0bf2d28'/>
<id>urn:sha1:dbe4aa36c940dc309133e5d10a5771f3d0bf2d28</id>
<content type='text'>
commit 47a459ecc800a17109d0c496a4e21e478806ee40 upstream.

Several MFD child drivers register their class devices directly under
the parent device. This means you cannot blindly do devres conversions
so that deregistration ends up being tied to the parent device,
something which leads to use-after-free on driver unbind when the class
device is released while still being registered.

Fixes: 8d3b6a4001ce ("leds: wm831x-status: Use devm_led_classdev_register")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 4.6
Cc: Amitoj Kaur Chawla &lt;amitoj1606@gmail.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>leds: pca963x: Fix open-drain initialization</title>
<updated>2020-02-28T15:35:55+00:00</updated>
<author>
<name>Zahari Petkov</name>
<email>zahari@balena.io</email>
</author>
<published>2019-11-18T21:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bb36a883e32b7d3804441822e6e0d4cb3a47a19b'/>
<id>urn:sha1:bb36a883e32b7d3804441822e6e0d4cb3a47a19b</id>
<content type='text'>
[ Upstream commit 697529091ac7a0a90ca349b914bb30641c13c753 ]

Before commit bb29b9cccd95 ("leds: pca963x: Add bindings to invert
polarity") Mode register 2 was initialized directly with either 0x01
or 0x05 for open-drain or totem pole (push-pull) configuration.

Afterwards, MODE2 initialization started using bitwise operations on
top of the default MODE2 register value (0x05). Using bitwise OR for
setting OUTDRV with 0x01 and 0x05 does not produce correct results.
When open-drain is used, instead of setting OUTDRV to 0, the driver
keeps it as 1:

Open-drain: 0x05 | 0x01 -&gt; 0x05 (0b101 - incorrect)
Totem pole: 0x05 | 0x05 -&gt; 0x05 (0b101 - correct but still wrong)

Now OUTDRV setting uses correct bitwise operations for initialization:

Open-drain: 0x05 &amp; ~0x04 -&gt; 0x01 (0b001 - correct)
Totem pole: 0x05 | 0x04 -&gt; 0x05 (0b101 - correct)

Additional MODE2 register definitions are introduced now as well.

Fixes: bb29b9cccd95 ("leds: pca963x: Add bindings to invert polarity")
Signed-off-by: Zahari Petkov &lt;zahari@balena.io&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: leds-lp5562 allow firmware files up to the maximum length</title>
<updated>2019-10-05T10:47:45+00:00</updated>
<author>
<name>Nick Stoughton</name>
<email>nstoughton@logitech.com</email>
</author>
<published>2019-07-17T21:56:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a267c9f9b8f6c9959697ce988ef00e99ce039477'/>
<id>urn:sha1:a267c9f9b8f6c9959697ce988ef00e99ce039477</id>
<content type='text'>
[ Upstream commit ed2abfebb041473092b41527903f93390d38afa7 ]

Firmware files are in ASCII, using 2 hex characters per byte. The
maximum length of a firmware string is therefore

16 (commands) * 2 (bytes per command) * 2 (characters per byte) = 64

Fixes: ff45262a85db ("leds: add new LP5562 LED driver")
Signed-off-by: Nick Stoughton &lt;nstoughton@logitech.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: pwm: silently error out on EPROBE_DEFER</title>
<updated>2019-05-16T17:42:29+00:00</updated>
<author>
<name>Jerome Brunet</name>
<email>jbrunet@baylibre.com</email>
</author>
<published>2018-09-06T13:59:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=041ef4231cae4ed533c0a050b0b60629ac9b02da'/>
<id>urn:sha1:041ef4231cae4ed533c0a050b0b60629ac9b02da</id>
<content type='text'>
[ Upstream commit 9aec30371fb095a0c9415f3f0146ae269c3713d8 ]

When probing, if we fail to get the pwm due to probe deferal, we shouldn't
print an error message. Just be silent in this case.

Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
</feed>
