summaryrefslogtreecommitdiffstats
path: root/drivers/iio/proximity
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-06 15:27:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-06 15:27:17 +0100
commite8cd29b774ddd28bfe6d693c82241e294dc91e09 (patch)
treec8f904220eab7c50771558642b6c6d9240fb5368 /drivers/iio/proximity
parent7e739297cdbe8383bf4a5e423959107eccc01fa1 (diff)
parent73996933b53ff396d63a7fccd8e824758634dc19 (diff)
downloadlinux-e8cd29b774ddd28bfe6d693c82241e294dc91e09.tar.bz2
Merge Linus's staging merge point into staging-next
This resolves the merge issue pointed out by Stephen in drivers/iio/adc/meson_saradc.c. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/proximity')
-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 f878a9a9f304..b8a2c2c8cac5 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");