diff options
Diffstat (limited to 'drivers/iio/proximity')
-rw-r--r-- | drivers/iio/proximity/as3935.c | 17 | ||||
-rw-r--r-- | drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 16 | ||||
-rw-r--r-- | drivers/iio/proximity/sx9500.c | 25 |
3 files changed, 28 insertions, 30 deletions
diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index b6249af48014..f130388a16a0 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c @@ -1,18 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * as3935.c - Support for AS3935 Franklin lightning sensor * - * Copyright (C) 2014 Matt Ranostay <mranostay@gmail.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * + * Copyright (C) 2014, 2017-2018 + * Author: Matt Ranostay <matt.ranostay@konsulko.com> */ #include <linux/module.h> @@ -502,6 +493,6 @@ static struct spi_driver as3935_driver = { }; module_spi_driver(as3935_driver); -MODULE_AUTHOR("Matt Ranostay <mranostay@gmail.com>"); +MODULE_AUTHOR("Matt Ranostay <matt.ranostay@konsulko.com>"); MODULE_DESCRIPTION("AS3935 lightning sensor"); MODULE_LICENSE("GPL"); diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index 4d56f67b24c6..47af54f14756 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -1,17 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * pulsedlight-lidar-lite-v2.c - Support for PulsedLight LIDAR sensor * - * Copyright (C) 2015 Matt Ranostay <mranostay@gmail.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Copyright (C) 2015, 2017-2018 + * Author: Matt Ranostay <matt.ranostay@konsulko.com> * * TODO: interrupt mode, and signal strength reporting */ @@ -377,6 +369,6 @@ static struct i2c_driver lidar_driver = { }; module_i2c_driver(lidar_driver); -MODULE_AUTHOR("Matt Ranostay <mranostay@gmail.com>"); +MODULE_AUTHOR("Matt Ranostay <matt.ranostay@konsulko.com>"); MODULE_DESCRIPTION("PulsedLight LIDAR sensor"); MODULE_LICENSE("GPL"); diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index b8a2c2c8cac5..ff80409e0c44 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -32,9 +32,6 @@ #define SX9500_DRIVER_NAME "sx9500" #define SX9500_IRQ_NAME "sx9500_event" -#define SX9500_GPIO_INT "interrupt" -#define SX9500_GPIO_RESET "reset" - /* Register definitions. */ #define SX9500_REG_IRQ_SRC 0x00 #define SX9500_REG_STAT 0x01 @@ -866,26 +863,44 @@ static int sx9500_init_device(struct iio_dev *indio_dev) return sx9500_init_compensation(indio_dev); } +static const struct acpi_gpio_params reset_gpios = { 0, 0, false }; +static const struct acpi_gpio_params interrupt_gpios = { 2, 0, false }; + +static const struct acpi_gpio_mapping acpi_sx9500_gpios[] = { + { "reset-gpios", &reset_gpios, 1 }, + /* + * Some platforms have a bug in ACPI GPIO description making IRQ + * GPIO to be output only. Ask the GPIO core to ignore this limit. + */ + { "interrupt-gpios", &interrupt_gpios, 1, ACPI_GPIO_QUIRK_NO_IO_RESTRICTION }, + { }, +}; + static void sx9500_gpio_probe(struct i2c_client *client, struct sx9500_data *data) { struct gpio_desc *gpiod_int; struct device *dev; + int ret; if (!client) return; dev = &client->dev; + ret = devm_acpi_dev_add_driver_gpios(dev, acpi_sx9500_gpios); + if (ret) + dev_dbg(dev, "Unable to add GPIO mapping table\n"); + if (client->irq <= 0) { - gpiod_int = devm_gpiod_get(dev, SX9500_GPIO_INT, GPIOD_IN); + gpiod_int = devm_gpiod_get(dev, "interrupt", 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); + data->gpiod_rst = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(data->gpiod_rst)) { dev_warn(dev, "gpio get reset pin failed\n"); data->gpiod_rst = NULL; |