<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpio, branch v5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-09-11T09:46:54Z</updated>
<entry>
<title>gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist</title>
<updated>2019-09-11T09:46:54Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2019-08-27T20:28:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=61f7f7c8f978b1c0d80e43c83b7d110ca0496eb4'/>
<id>urn:sha1:61f7f7c8f978b1c0d80e43c83b7d110ca0496eb4</id>
<content type='text'>
Another day; another DSDT bug we need to workaround...

Since commit ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events
at least once on boot") we call _AEI edge handlers at boot.

In some rare cases this causes problems. One example of this is the Minix
Neo Z83-4 mini PC, this device has a clear DSDT bug where it has some copy
and pasted code for dealing with Micro USB-B connector host/device role
switching, while the mini PC does not even have a micro-USB connector.
This code, which should not be there, messes with the DDC data pin from
the HDMI connector (switching it to GPIO mode) breaking HDMI support.

To avoid problems like this, this commit adds a new
gpiolib_acpi.run_edge_events_on_boot kernel commandline option, which
allows disabling the running of _AEI edge event handlers at boot.

The default value is -1/auto which uses a DMI based blacklist, the initial
version of this blacklist contains the Neo Z83-4 fixing the HDMI breakage.

Cc: stable@vger.kernel.org
Cc: Daniel Drake &lt;drake@endlessm.com&gt;
Cc: Ian W MORRISON &lt;ianwmorrison@gmail.com&gt;
Reported-by: Ian W MORRISON &lt;ianwmorrison@gmail.com&gt;
Suggested-by: Ian W MORRISON &lt;ianwmorrison@gmail.com&gt;
Fixes: ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at least once on boot")
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20190827202835.213456-1-hdegoede@redhat.com
Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Tested-by: Ian W MORRISON &lt;ianwmorrison@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: of: fix fallback quirks handling</title>
<updated>2019-09-10T10:31:35Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2019-09-03T23:18:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1dea33e84d33a5220aeda4ca9e918de0fd77c078'/>
<id>urn:sha1:1dea33e84d33a5220aeda4ca9e918de0fd77c078</id>
<content type='text'>
We should only try to execute fallback quirks handling when previous
call returned -ENOENT, and not when we did not get -EPROBE_DEFER.
The other errors should be treated as hard errors: we did find the GPIO
description, but for some reason we failed to handle it properly.

The fallbacks should only be executed when previous handlers returned
-ENOENT, which means the mapping/description was not found.

Also let's remove the explicit deferral handling when iterating through
GPIO suffixes: it is not needed anymore as we will not be calling
fallbacks for anything but -ENOENT.

Fixes: df451f83e1fc ("gpio: of: fix Freescale SPI CS quirk handling")
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Link: https://lore.kernel.org/r/20190903231856.GA165165@dtor-ws
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpio: fix line flag validation in lineevent_create</title>
<updated>2019-09-09T08:04:53Z</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2019-09-09T03:24:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5ca2f54b597c816df54ff1b28eb99cf7262b955d'/>
<id>urn:sha1:5ca2f54b597c816df54ff1b28eb99cf7262b955d</id>
<content type='text'>
lineevent_create should not allow any of GPIOHANDLE_REQUEST_OUTPUT,
GPIOHANDLE_REQUEST_OPEN_DRAIN or GPIOHANDLE_REQUEST_OPEN_SOURCE to be set.

Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>gpio: fix line flag validation in linehandle_create</title>
<updated>2019-09-09T08:01:55Z</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2019-09-09T03:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e95fbc130a162ba9ad956311b95aa0da269eea48'/>
<id>urn:sha1:e95fbc130a162ba9ad956311b95aa0da269eea48</id>
<content type='text'>
linehandle_create should not allow both GPIOHANDLE_REQUEST_INPUT
and GPIOHANDLE_REQUEST_OUTPUT to be set.

Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>gpio: mockup: add missing single_release()</title>
<updated>2019-09-09T07:55:27Z</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2019-09-04T14:18:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59929d3a2eb6c4abafc5b61a20c98aa8728ec378'/>
<id>urn:sha1:59929d3a2eb6c4abafc5b61a20c98aa8728ec378</id>
<content type='text'>
When using single_open() for opening, single_release() should be
used instead of seq_release(), otherwise there is a memory leak.

Fixes: 2a9e27408e12 ("gpio: mockup: rework debugfs interface")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>gpio: pca953x: use pca953x_read_regs instead of regmap_bulk_read</title>
<updated>2019-08-28T10:55:24Z</updated>
<author>
<name>David Jander</name>
<email>david@protonic.nl</email>
</author>
<published>2019-08-27T06:46:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=438b6c20e6161a1a7542490baa093c86732f77d6'/>
<id>urn:sha1:438b6c20e6161a1a7542490baa093c86732f77d6</id>
<content type='text'>
The register number needs to be translated for chips with more than 8
ports. This patch fixes a bug causing all chips with more than 8 GPIO pins
to not work correctly.

Fixes: 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache")
Cc: Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: David Jander &lt;david@protonic.nl&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>gpio: pca953x: correct type of reg_direction</title>
<updated>2019-08-28T10:55:24Z</updated>
<author>
<name>David Jander</name>
<email>david@protonic.nl</email>
</author>
<published>2019-08-27T06:46:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc624a06f0c5190bc37fec7d22cd82b43a579698'/>
<id>urn:sha1:bc624a06f0c5190bc37fec7d22cd82b43a579698</id>
<content type='text'>
The type of reg_direction needs to match the type of the regmap, which
is u8.

Fixes: 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache")
Cc: Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: David Jander &lt;david@protonic.nl&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>gpio: Fix irqchip initialization order</title>
<updated>2019-08-23T09:00:43Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2019-08-20T08:05:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48057ed1840fde9239b1e000bea1a0a1f07c5e99'/>
<id>urn:sha1:48057ed1840fde9239b1e000bea1a0a1f07c5e99</id>
<content type='text'>
The new API for registering a gpio_irq_chip along with a
gpio_chip has a different semantic ordering than the old
API which added the irqchip explicitly after registering
the gpio_chip.

Move the calls to add the gpio_irq_chip *last* in the
function, so that the different hooks setting up OF and
ACPI and machine gpio_chips are called *before* we try
to register the interrupts, preserving the elder semantic
order.

This cropped up in the PL061 driver which used to work
fine with no special ACPI quirks, but started to misbehave
using the new API.

Fixes: e0d897289813 ("gpio: Implement tighter IRQ chip integration")
Cc: Thierry Reding &lt;treding@nvidia.com&gt;
Cc: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Cc: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reported-by: Wei Xu &lt;xuwei5@hisilicon.com&gt;
Tested-by: Wei Xu &lt;xuwei5@hisilicon.com&gt;
Reported-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20190820080527.11796-1-linus.walleij@linaro.org
</content>
</entry>
<entry>
<title>gpio: of: fix Freescale SPI CS quirk handling</title>
<updated>2019-08-16T22:28:50Z</updated>
<author>
<name>Andreas Kemnade</name>
<email>andreas@kemnade.info</email>
</author>
<published>2019-08-16T16:50:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=df451f83e1fc0fa3764a2724b0faaaf9d07ab1b6'/>
<id>urn:sha1:df451f83e1fc0fa3764a2724b0faaaf9d07ab1b6</id>
<content type='text'>
On the gta04 we see:
spi_gpio: probe of spi_lcd failed with error -2

The quirk introduced in
commit e3023bf80639 ("gpio: of: Handle the Freescale SPI CS")
can also be triggered by a temporary -EPROBE_DEFER and
so "convert" it to a hard -ENOENT.

Disable that conversion by checking for -EPROBE_DEFER.

Fixes: e3023bf80639 ("gpio: of: Handle the Freescale SPI CS")
Suggested-by: H. Nikolaus Schaller &lt;hns@goldelico.com&gt;
Signed-off-by: Andreas Kemnade &lt;andreas@kemnade.info&gt;
Link: https://lore.kernel.org/r/20190816165000.32334-1-andreas@kemnade.info
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>gpiolib: never report open-drain/source lines as 'input' to user-space</title>
<updated>2019-08-14T08:57:18Z</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bgolaszewski@baylibre.com</email>
</author>
<published>2019-08-06T11:41:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c60e6b5c9241b24b8b523fefd3e44fb85622cda'/>
<id>urn:sha1:2c60e6b5c9241b24b8b523fefd3e44fb85622cda</id>
<content type='text'>
If the driver doesn't support open-drain/source config options, we
emulate this behavior when setting the direction by calling
gpiod_direction_input() if the default value is 0 (open-source) or
1 (open-drain), thus not actively driving the line in those cases.

This however clears the FLAG_IS_OUT bit for the GPIO line descriptor
and makes the LINEINFO ioctl() incorrectly report this line's mode as
'input' to user-space.

This commit modifies the ioctl() to always set the GPIOLINE_FLAG_IS_OUT
bit in the lineinfo structure's flags field. Since it's impossible to
use the input mode and open-drain/source options at the same time, we
can be sure the reported information will be correct.

Fixes: 521a2ad6f862 ("gpio: add userspace ABI for GPIO line information")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Link: https://lore.kernel.org/r/20190806114151.17652-1-brgl@bgdev.pl
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
