linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/5] iio: proximity: sx9500: Assign interrupt from GpioIo()
@ 2017-11-03 13:03 Andy Shevchenko
  2017-11-03 13:03 ` [PATCH v3 2/5] iio: proximity: sx9500: Add GPIO ACPI mapping table Andy Shevchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Andy Shevchenko @ 2017-11-03 13:03 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: Andy Shevchenko

The commit 0f0796509c07

("iio: remove gpio interrupt probing from drivers that use a single interrupt")

removed custom IRQ assignment for the drivers which are enumerated via
ACPI or OF. Unfortunately, some ACPI tables have IRQ line defined as
GpioIo() resource and thus automatic IRQ allocation will fail.

Partially revert the commit 0f0796509c07 to restore original behaviour.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/proximity/sx9500.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
index 53c5d653e780..df23dbcc030a 100644
--- a/drivers/iio/proximity/sx9500.c
+++ b/drivers/iio/proximity/sx9500.c
@@ -869,6 +869,7 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
 static void sx9500_gpio_probe(struct i2c_client *client,
 			      struct sx9500_data *data)
 {
+	struct gpio_desc *gpiod_int;
 	struct device *dev;
 
 	if (!client)
@@ -876,6 +877,14 @@ static void sx9500_gpio_probe(struct i2c_client *client,
 
 	dev = &client->dev;
 
+	if (client->irq <= 0) {
+		gpiod_int = devm_gpiod_get(dev, SX9500_GPIO_INT, GPIOD_IN);
+		if (IS_ERR(gpiod_int))
+			dev_err(dev, "gpio get irq failed\n");
+		else
+			client->irq = gpiod_to_irq(gpiod_int);
+	}
+
 	data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH);
 	if (IS_ERR(data->gpiod_rst)) {
 		dev_warn(dev, "gpio get reset pin failed\n");
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2018-02-26 19:51 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-03 13:03 [PATCH v3 1/5] iio: proximity: sx9500: Assign interrupt from GpioIo() Andy Shevchenko
2017-11-03 13:03 ` [PATCH v3 2/5] iio: proximity: sx9500: Add GPIO ACPI mapping table Andy Shevchenko
2017-11-04  3:14   ` Jonathan Cameron
2017-11-19 15:29     ` Jonathan Cameron
2017-11-25 14:24       ` Jonathan Cameron
2017-11-27 15:08         ` Andy Shevchenko
2017-12-01 10:04           ` Linus Walleij
2017-12-01 12:36             ` Andy Shevchenko
2017-11-03 13:03 ` [PATCH v3 3/5] iio: proximity: sx9500: Set IRQ pin to direction-input if necessary Andy Shevchenko
2017-11-04  3:20   ` Jonathan Cameron
2017-11-08 16:35     ` Andy Shevchenko
2017-11-08 17:03       ` Mika Westerberg
2017-11-08 20:45         ` Linus Walleij
2017-11-08 20:52           ` Andy Shevchenko
2017-11-10 18:13           ` Andy Shevchenko
2018-02-26 19:51         ` Andy Shevchenko
2017-11-03 13:03 ` [PATCH v3 4/5] iio: proximity: sx9500: Add another ACPI ID Andy Shevchenko
2017-11-19 15:32   ` Jonathan Cameron
2017-11-03 13:03 ` [PATCH v3 5/5] iio: magnetometer: ak8975: " Andy Shevchenko
2017-11-04  3:11 ` [PATCH v3 1/5] iio: proximity: sx9500: Assign interrupt from GpioIo() Jonathan Cameron
2017-11-04 10:43   ` Linus Walleij
2017-11-06  9:35   ` Mika Westerberg
2017-11-19 15:24     ` Jonathan Cameron
2017-11-20 10:30       ` Mika Westerberg
2017-11-25 14:28         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).