<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/leds, branch dev-5.14-intel</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.14-intel</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.14-intel'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2021-09-24T04:39:15+00:00</updated>
<entry>
<title>leds: pca955x: Allow zero LEDs to be specified</title>
<updated>2021-09-24T04:39:15+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-09-21T04:39:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=41a83df4a3b9bd62bc508fd528c6f5a01014aede'/>
<id>urn:sha1:41a83df4a3b9bd62bc508fd528c6f5a01014aede</id>
<content type='text'>
It's valid to use the PCA955x devices just for GPIOs and not for LEDs.
In this case, as PCA955X_TYPE_GPIO is now equivalent to
PCA955X_TYPE_NONE, remove the test for whether we have any child nodes
specified in the devicetree.

A consequence of this is it's now possible to bind the driver to a
PCA955x device when dynamically instantiated through the I2C subsystem's
`new_device` interface.

OpenBMC-Staging-Count: 1
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Joel Stanley &lt;joel@jms.id.au&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20210921043936.468001-3-andrew@aj.id.au
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: pca955x: Make the gpiochip always expose all pins</title>
<updated>2021-09-24T04:39:15+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-09-21T04:39:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e6fc28c4644d7306a6b32e3029f559a55439364d'/>
<id>urn:sha1:e6fc28c4644d7306a6b32e3029f559a55439364d</id>
<content type='text'>
The devicetree binding allows specifying which pins are GPIO vs LED.
Limiting the instantiated gpiochip to just these pins as the driver
currently does requires an arbitrary mapping between pins and GPIOs, but
such a mapping is not implemented by the driver. As a result,
specifying GPIOs in such a way that they don't map 1-to-1 to pin indexes
does not function as expected.

Establishing such a mapping is more complex than not and even if we did,
doing so leads to a slightly hairy userspace experience as the behaviour
of the PCA955x gpiochip would depend on how the pins are assigned in the
devicetree. Instead, always expose all pins via the gpiochip to provide
a stable interface and track which pins are in use.

Specifying a pin as `type = &lt;PCA955X_TYPE_GPIO&gt;;` in the devicetree
becomes a no-op.

I've assessed the impact of this change by looking through all of the
affected devicetrees as of the tag leds-5.15-rc1:

```
$ git grep -l 'pca955[0123]' $(find . -name dts -type d)
arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
arch/arm/boot/dts/aspeed-bmc-opp-mihawk.dts
arch/arm/boot/dts/aspeed-bmc-opp-mowgli.dts
arch/arm/boot/dts/aspeed-bmc-opp-swift.dts
arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts
arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
```

These are all IBM-associated platforms. I've analysed both the
devicetrees and schematics where necessary to determine whether any
systems hit the hazard of the current broken behaviour. For the most
part, the systems specify the pins as either all LEDs or all GPIOs, or
at least do so in a way such that the broken behaviour isn't exposed.

The main counter-point to this observation is the Everest system whose
devicetree describes a large number of PCA955x devices and in some cases
has pin assignments that hit the hazard. However, there does not seem to
be any use of the affected GPIOs in the userspace associated with
Everest.

Regardless, any use of the hazardous GPIOs in Everest is already broken,
so let's fix the interface and then fix any already broken userspace
with it.

OpenBMC-Staging-Count: 1
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Joel Stanley &lt;joel@jms.id.au&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20210921043936.468001-2-andrew@aj.id.au
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: pca955x: Switch to i2c probe_new</title>
<updated>2021-09-22T02:36:43+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2021-09-16T21:21:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9eebe7172115e8ef0d923756d3ea7bb46487f805'/>
<id>urn:sha1:9eebe7172115e8ef0d923756d3ea7bb46487f805</id>
<content type='text'>
The deprecated i2c probe functionality doesn't work with OF
compatible strings, as it only checks for the i2c device id. Switch
to the new way of probing and grab the match data to select the
chip type.

OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Link: https://lore.kernel.org/r/20210916212140.33915-8-eajames@linux.ibm.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: pca955x: Let the core process the fwnode</title>
<updated>2021-09-22T02:36:43+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2021-09-16T21:21:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=eb61f68f1a73e56c71d9ea96e70a3343a62ae9ae'/>
<id>urn:sha1:eb61f68f1a73e56c71d9ea96e70a3343a62ae9ae</id>
<content type='text'>
Much of the fwnode processing in the PCA955x driver is now in the
LEDs core driver, so pass the fwnode in the init data when
registering the LED device. In order to preserve the existing naming
scheme, check for an empty name and set it to the LED number.

OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Link: https://lore.kernel.org/r/20210916212140.33915-7-eajames@linux.ibm.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: pca955x: Implement the default-state property</title>
<updated>2021-09-22T02:36:42+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2021-09-16T21:21:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=76422d19fef2fe3688f1ae482b00e60d23a3b895'/>
<id>urn:sha1:76422d19fef2fe3688f1ae482b00e60d23a3b895</id>
<content type='text'>
In order to retain the LED state after a system reboot, check the
documented default-state device tree property during initialization.
Modify the behavior of the probe according to the property.

OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Link: https://lore.kernel.org/r/20210916212140.33915-6-eajames@linux.ibm.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: pca955x: Add brightness_get function</title>
<updated>2021-09-22T02:36:42+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2021-09-16T21:21:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c31a50bea3c0c38f0c20ed6b7605207428f852a1'/>
<id>urn:sha1:c31a50bea3c0c38f0c20ed6b7605207428f852a1</id>
<content type='text'>
Add a function to fetch the state of the hardware LED.

OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Link: https://lore.kernel.org/r/20210916212140.33915-5-eajames@linux.ibm.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: pca955x: Clean up code formatting</title>
<updated>2021-09-22T02:36:42+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2021-09-16T21:21:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=26dadd403dc1ec2256d8373151e4ff2b875c8bcd'/>
<id>urn:sha1:26dadd403dc1ec2256d8373151e4ff2b875c8bcd</id>
<content type='text'>
Format the code. Add some variables to help shorten lines.

OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Link: https://lore.kernel.org/r/20210916212140.33915-4-eajames@linux.ibm.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: leds-core: Implement the retain-state-shutdown property</title>
<updated>2021-09-22T02:36:42+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.ibm.com</email>
</author>
<published>2021-09-16T21:21:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=0d424125f1c32c9297493cb934f5627d6bd38a00'/>
<id>urn:sha1:0d424125f1c32c9297493cb934f5627d6bd38a00</id>
<content type='text'>
Read the retain-state-shutdown device tree property to set the
existing LED_RETAIN_AT_SHUTDOWN flag. Then check the flag when
unregistering, and if set, don't set the brightness to OFF. This
is useful for systems that want to keep the HW state of the LED
across reboots.

OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James &lt;eajames@linux.ibm.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Link: https://lore.kernel.org/r/20210916212140.33915-3-eajames@linux.ibm.com
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>leds: lgm-sso: Propagate error codes from callee to caller</title>
<updated>2021-09-15T08:02:20+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2021-08-05T11:26:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=881a8a363b0889a8892d3ff9ac9b28b92a5a3021'/>
<id>urn:sha1:881a8a363b0889a8892d3ff9ac9b28b92a5a3021</id>
<content type='text'>
[ Upstream commit 9cbc861095375793a69858f91f3ac4e817f320f0 ]

The one of the latest change to the driver reveals the problem that
the error codes from callee aren't propagated to the caller of
__sso_led_dt_parse(). Fix this accordingly.

Fixes: 9999908ca1ab ("leds: lgm-sso: Put fwnode in any case during -&gt;probe()")
Fixes: c3987cd2bca3 ("leds: lgm: Add LED controller driver for LGM SoC")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&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: trigger: audio: Add an activate callback to ensure the initial brightness is set</title>
<updated>2021-09-15T08:02:17+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2021-02-21T11:52:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a0f0e72ed1b3f2882fc4a10516bf6dc4da4f04ce'/>
<id>urn:sha1:a0f0e72ed1b3f2882fc4a10516bf6dc4da4f04ce</id>
<content type='text'>
[ Upstream commit 64f67b5240db79eceb0bd57dae8e591fd3103ba0 ]

Some 2-in-1s with a detachable (USB) keyboard(dock) have mute-LEDs in
the speaker- and/or mic-mute keys on the keyboard.

Examples of this are the Lenovo Thinkpad10 tablet (with its USB kbd-dock)
and the HP x2 10 series.

The detachable nature of these keyboards means that the keyboard and
thus the mute LEDs may show up after the user (or userspace restoring
old mixer settings) has muted the speaker and/or mic.

Current LED-class devices with a default_trigger of "audio-mute" or
"audio-micmute" initialize the brightness member of led_classdev with
ledtrig_audio_get() before registering the LED.

This makes the software state after attaching the keyboard match the
actual audio mute state, e.g. cat /sys/class/leds/foo/brightness will
show the right value.

But before this commit nothing was actually calling the led_classdev's
brightness_set[_blocking] callback so the value returned by
ledtrig_audio_get() was never actually being sent to the hw, leading
to the mute LEDs staying in their default power-on state, after
attaching the keyboard, even if ledtrig_audio_get() returned a different
state.

This could be fixed by having the individual LED drivers call
brightness_set[_blocking] themselves after registering the LED,
but this really is something which should be done by a led-trigger
activate callback.

Add an activate callback for this, fixing the issue of the
mute LEDs being out of sync after (re)attaching the keyboard.

Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Fixes: faa2541f5b1a ("leds: trigger: Introduce audio mute LED trigger")
Reviewed-by: Marek Behún &lt;kabel@kernel.org&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
