Commit 4c5ae538 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

iio: proximity: sx9500: Assign interrupt from GpioIo()

[ Upstream commit e53111ad ]

The commit 0f079650

("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 0f079650 to restore original behaviour.
Signed-off-by: default avatarAndy Shevchenko <>
Acked-by: default avatarMika Westerberg <>
Signed-off-by: default avatarJonathan Cameron <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 567c1f76
......@@ -871,6 +871,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)
......@@ -878,6 +879,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");
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");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment