aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-11-03 09:03:36 -0400
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-12-02 06:15:13 -0500
commite53111ad5deaef98d8c18a9933ef1f5624c5979d (patch)
tree849b18ac983b45b07b1989ec0df5aaf8ad1c8a11
parent81b039ec36a41a5451e1e36f05bb055eceab1dc8 (diff)
iio: proximity: sx9500: Assign interrupt from GpioIo()
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> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/proximity/sx9500.c9
1 files changed, 9 insertions, 0 deletions
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)
869static void sx9500_gpio_probe(struct i2c_client *client, 869static void sx9500_gpio_probe(struct i2c_client *client,
870 struct sx9500_data *data) 870 struct sx9500_data *data)
871{ 871{
872 struct gpio_desc *gpiod_int;
872 struct device *dev; 873 struct device *dev;
873 874
874 if (!client) 875 if (!client)
@@ -876,6 +877,14 @@ static void sx9500_gpio_probe(struct i2c_client *client,
876 877
877 dev = &client->dev; 878 dev = &client->dev;
878 879
880 if (client->irq <= 0) {
881 gpiod_int = devm_gpiod_get(dev, SX9500_GPIO_INT, GPIOD_IN);
882 if (IS_ERR(gpiod_int))
883 dev_err(dev, "gpio get irq failed\n");
884 else
885 client->irq = gpiod_to_irq(gpiod_int);
886 }
887
879 data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH); 888 data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH);
880 if (IS_ERR(data->gpiod_rst)) { 889 if (IS_ERR(data->gpiod_rst)) {
881 dev_warn(dev, "gpio get reset pin failed\n"); 890 dev_warn(dev, "gpio get reset pin failed\n");