summaryrefslogtreecommitdiffstats
path: root/drivers/iio/proximity/sx9500.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-22 20:38:28 +0100
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-22 20:38:28 +0100
commit9eb124fe796cbadd454c8f946d7051f4c3f4a251 (patch)
tree357d21901062bf487d4c19d0495e630256d1eee3 /drivers/iio/proximity/sx9500.c
parentmedia: coda/imx-vdoa: Remove irq member from vdoa_data struct (diff)
parentw1_netlink.h: add support for nested structs (diff)
downloadlinux-9eb124fe796cbadd454c8f946d7051f4c3f4a251.tar.xz
linux-9eb124fe796cbadd454c8f946d7051f4c3f4a251.zip
Merge branch 'docs-next' of git://git.lwn.net/linux into patchwork
* 'docs-next' of git://git.lwn.net/linux: (888 commits) w1_netlink.h: add support for nested structs scripts: kernel-doc: apply filtering rules to warnings scripts: kernel-doc: improve nested logic to handle multiple identifiers scripts: kernel-doc: handle nested struct function arguments scripts: kernel-doc: print the declaration name on warnings scripts: kernel-doc: get rid of $nested parameter scripts: kernel-doc: parse next structs/unions scripts: kernel-doc: replace tabs by spaces scripts: kernel-doc: change default to ReST format scripts: kernel-doc: improve argument handling scripts: kernel-doc: get rid of unused output formats docs: get rid of kernel-doc-nano-HOWTO.txt docs: kernel-doc.rst: add documentation about man pages docs: kernel-doc.rst: improve typedef documentation docs: kernel-doc.rst: improve structs chapter docs: kernel-doc.rst: improve function documentation section docs: kernel-doc.rst: improve private members description docs: kernel-doc.rst: better describe kernel-doc arguments docs: fix process/submit-checklist.rst Sphinx warning docs: ftrace-uses.rst fix varios code-block directives ...
Diffstat (limited to 'drivers/iio/proximity/sx9500.c')
-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)
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");