diff options
Diffstat (limited to 'drivers/iio/light')
41 files changed, 245 insertions, 373 deletions
diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index 5190eacfeb0a..e3fd00b595d0 100644 --- a/drivers/iio/light/Kconfig +++ b/drivers/iio/light/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only # # Light sensors @@ -13,11 +14,11 @@ config ACPI_ALS select IIO_TRIGGERED_BUFFER select IIO_KFIFO_BUF help - Say Y here if you want to build a driver for the ACPI0008 - Ambient Light Sensor. + Say Y here if you want to build a driver for the ACPI0008 + Ambient Light Sensor. - To compile this driver as a module, choose M here: the module will - be called acpi-als. + To compile this driver as a module, choose M here: the module will + be called acpi-als. config ADJD_S311 tristate "ADJD-S311-CR999 digital color sensor" @@ -25,31 +26,31 @@ config ADJD_S311 select IIO_TRIGGERED_BUFFER depends on I2C help - If you say yes here you get support for the Avago ADJD-S311-CR999 - digital color light sensor. + If you say yes here you get support for the Avago ADJD-S311-CR999 + digital color light sensor. - This driver can also be built as a module. If so, the module - will be called adjd_s311. + This driver can also be built as a module. If so, the module + will be called adjd_s311. config AL3320A tristate "AL3320A ambient light sensor" depends on I2C help - Say Y here if you want to build a driver for the Dyna Image AL3320A - ambient light sensor. + Say Y here if you want to build a driver for the Dyna Image AL3320A + ambient light sensor. - To compile this driver as a module, choose M here: the - module will be called al3320a. + To compile this driver as a module, choose M here: the + module will be called al3320a. config APDS9300 tristate "APDS9300 ambient light sensor" depends on I2C help - Say Y here if you want to build a driver for the Avago APDS9300 - ambient light sensor. + Say Y here if you want to build a driver for the Avago APDS9300 + ambient light sensor. - To compile this driver as a module, choose M here: the - module will be called apds9300. + To compile this driver as a module, choose M here: the + module will be called apds9300. config APDS9960 tristate "Avago APDS9960 gesture/RGB/ALS/proximity sensor" @@ -68,74 +69,74 @@ config BH1750 tristate "ROHM BH1750 ambient light sensor" depends on I2C help - Say Y here to build support for the ROHM BH1710, BH1715, BH1721, - BH1750, BH1751 ambient light sensors. + Say Y here to build support for the ROHM BH1710, BH1715, BH1721, + BH1750, BH1751 ambient light sensors. - To compile this driver as a module, choose M here: the module will - be called bh1750. + To compile this driver as a module, choose M here: the module will + be called bh1750. config BH1780 tristate "ROHM BH1780 ambient light sensor" depends on I2C help - Say Y here to build support for the ROHM BH1780GLI ambient - light sensor. + Say Y here to build support for the ROHM BH1780GLI ambient + light sensor. - To compile this driver as a module, choose M here: the module will - be called bh1780. + To compile this driver as a module, choose M here: the module will + be called bh1780. config CM32181 depends on I2C tristate "CM32181 driver" help - Say Y here if you use cm32181. - This option enables ambient light sensor using - Capella cm32181 device driver. + Say Y here if you use cm32181. + This option enables ambient light sensor using + Capella cm32181 device driver. - To compile this driver as a module, choose M here: - the module will be called cm32181. + To compile this driver as a module, choose M here: + the module will be called cm32181. config CM3232 depends on I2C tristate "CM3232 ambient light sensor" help - Say Y here if you use cm3232. - This option enables ambient light sensor using - Capella Microsystems cm3232 device driver. + Say Y here if you use cm3232. + This option enables ambient light sensor using + Capella Microsystems cm3232 device driver. - To compile this driver as a module, choose M here: - the module will be called cm3232. + To compile this driver as a module, choose M here: + the module will be called cm3232. config CM3323 depends on I2C tristate "Capella CM3323 color light sensor" help - Say Y here if you want to build a driver for Capella CM3323 - color sensor. + Say Y here if you want to build a driver for Capella CM3323 + color sensor. - To compile this driver as a module, choose M here: the module will - be called cm3323. + To compile this driver as a module, choose M here: the module will + be called cm3323. config CM3605 tristate "Capella CM3605 ambient light and proximity sensor" depends on OF help - Say Y here if you want to build a driver for Capella CM3605 - ambient light and short range proximity sensor. + Say Y here if you want to build a driver for Capella CM3605 + ambient light and short range proximity sensor. - To compile this driver as a module, choose M here: the module will - be called cm3605. + To compile this driver as a module, choose M here: the module will + be called cm3605. config CM36651 depends on I2C tristate "CM36651 driver" help - Say Y here if you use cm36651. - This option enables proximity & RGB sensor using - Capella cm36651 device driver. + Say Y here if you use cm36651. + This option enables proximity & RGB sensor using + Capella cm36651 device driver. - To compile this driver as a module, choose M here: - the module will be called cm36651. + To compile this driver as a module, choose M here: + the module will be called cm36651. config IIO_CROS_EC_LIGHT_PROX tristate "ChromeOS EC Light and Proximity Sensors" @@ -167,21 +168,21 @@ config SENSORS_ISL29018 select REGMAP_I2C default n help - If you say yes here you get support for ambient light sensing and - proximity infrared sensing from Intersil ISL29018. - This driver will provide the measurements of ambient light intensity - in lux, proximity infrared sensing and normal infrared sensing. - Data from sensor is accessible via sysfs. + If you say yes here you get support for ambient light sensing and + proximity infrared sensing from Intersil ISL29018. + This driver will provide the measurements of ambient light intensity + in lux, proximity infrared sensing and normal infrared sensing. + Data from sensor is accessible via sysfs. config SENSORS_ISL29028 tristate "Intersil ISL29028 Concurrent Light and Proximity Sensor" depends on I2C select REGMAP_I2C help - Provides driver for the Intersil's ISL29028 device. - This driver supports the sysfs interface to get the ALS, IR intensity, - Proximity value via iio. The ISL29028 provides the concurrent sensing - of ambient light and proximity. + Provides driver for the Intersil's ISL29028 device. + This driver supports the sysfs interface to get the ALS, IR intensity, + Proximity value via iio. The ISL29028 provides the concurrent sensing + of ambient light and proximity. config ISL29125 tristate "Intersil ISL29125 digital color light sensor" @@ -228,22 +229,22 @@ config JSA1212 depends on I2C select REGMAP_I2C help - Say Y here if you want to build a IIO driver for JSA1212 - proximity & ALS sensor device. + Say Y here if you want to build a IIO driver for JSA1212 + proximity & ALS sensor device. - To compile this driver as a module, choose M here: - the module will be called jsa1212. + To compile this driver as a module, choose M here: + the module will be called jsa1212. config RPR0521 tristate "ROHM RPR0521 ALS and proximity sensor driver" depends on I2C select REGMAP_I2C help - Say Y here if you want to build support for ROHM's RPR0521 - ambient light and proximity sensor device. + Say Y here if you want to build support for ROHM's RPR0521 + ambient light and proximity sensor device. - To compile this driver as a module, choose M here: - the module will be called rpr0521. + To compile this driver as a module, choose M here: + the module will be called rpr0521. config SENSORS_LM3533 tristate "LM3533 ambient light sensor" @@ -269,22 +270,22 @@ config LTR501 select IIO_BUFFER select IIO_TRIGGERED_BUFFER help - If you say yes here you get support for the Lite-On LTR-501ALS-01 - ambient light and proximity sensor. This driver also supports LTR-559 - ALS/PS or LTR-301 ALS sensors. + If you say yes here you get support for the Lite-On LTR-501ALS-01 + ambient light and proximity sensor. This driver also supports LTR-559 + ALS/PS or LTR-301 ALS sensors. - This driver can also be built as a module. If so, the module - will be called ltr501. + This driver can also be built as a module. If so, the module + will be called ltr501. config LV0104CS tristate "LV0104CS Ambient Light Sensor" depends on I2C help - Say Y here if you want to build support for the On Semiconductor - LV0104CS ambient light sensor. + Say Y here if you want to build support for the On Semiconductor + LV0104CS ambient light sensor. - To compile this driver as a module, choose M here: - the module will be called lv0104cs. + To compile this driver as a module, choose M here: + the module will be called lv0104cs. config MAX44000 tristate "MAX44000 Ambient and Infrared Proximity Sensor" @@ -293,11 +294,11 @@ config MAX44000 select IIO_BUFFER select IIO_TRIGGERED_BUFFER help - Say Y here if you want to build support for Maxim Integrated's - MAX44000 ambient and infrared proximity sensor device. + Say Y here if you want to build support for Maxim Integrated's + MAX44000 ambient and infrared proximity sensor device. - To compile this driver as a module, choose M here: - the module will be called max44000. + To compile this driver as a module, choose M here: + the module will be called max44000. config MAX44009 tristate "MAX44009 Ambient Light Sensor" @@ -320,15 +321,15 @@ config OPT3001 opt3001. config PA12203001 - tristate "TXC PA12203001 light and proximity sensor" - depends on I2C - select REGMAP_I2C - help - If you say yes here you get support for the TXC PA12203001 - ambient light and proximity sensor. + tristate "TXC PA12203001 light and proximity sensor" + depends on I2C + select REGMAP_I2C + help + If you say yes here you get support for the TXC PA12203001 + ambient light and proximity sensor. - This driver can also be built as a module. If so, the module - will be called pa12203001. + This driver can also be built as a module. If so, the module + will be called pa12203001. config SI1133 tristate "SI1133 UV Index Sensor and Ambient Light Sensor" @@ -359,12 +360,12 @@ config STK3310 depends on I2C select REGMAP_I2C help - Say yes here to get support for the Sensortek STK3310 ambient light - and proximity sensor. The STK3311 model is also supported by this - driver. + Say yes here to get support for the Sensortek STK3310 ambient light + and proximity sensor. The STK3311 model is also supported by this + driver. - Choosing M will build the driver as a module. If so, the module - will be called stk3310. + Choosing M will build the driver as a module. If so, the module + will be called stk3310. config ST_UVIS25 tristate "STMicroelectronics UVIS25 sensor driver" @@ -396,11 +397,11 @@ config TCS3414 select IIO_BUFFER select IIO_TRIGGERED_BUFFER help - If you say yes here you get support for the TAOS TCS3414 - family of digital color sensors. + If you say yes here you get support for the TAOS TCS3414 + family of digital color sensors. - This driver can also be built as a module. If so, the module - will be called tcs3414. + This driver can also be built as a module. If so, the module + will be called tcs3414. config TCS3472 tristate "TAOS TCS3472 color light-to-digital converter" @@ -408,67 +409,67 @@ config TCS3472 select IIO_BUFFER select IIO_TRIGGERED_BUFFER help - If you say yes here you get support for the TAOS TCS3472 - family of color light-to-digital converters with IR filter. + If you say yes here you get support for the TAOS TCS3472 + family of color light-to-digital converters with IR filter. - This driver can also be built as a module. If so, the module - will be called tcs3472. + This driver can also be built as a module. If so, the module + will be called tcs3472. config SENSORS_TSL2563 tristate "TAOS TSL2560, TSL2561, TSL2562 and TSL2563 ambient light sensors" depends on I2C help - If you say yes here you get support for the Taos TSL2560, - TSL2561, TSL2562 and TSL2563 ambient light sensors. + If you say yes here you get support for the Taos TSL2560, + TSL2561, TSL2562 and TSL2563 ambient light sensors. - This driver can also be built as a module. If so, the module - will be called tsl2563. + This driver can also be built as a module. If so, the module + will be called tsl2563. config TSL2583 tristate "TAOS TSL2580, TSL2581 and TSL2583 light-to-digital converters" depends on I2C help - Provides support for the TAOS tsl2580, tsl2581 and tsl2583 devices. - Access ALS data via iio, sysfs. + Provides support for the TAOS tsl2580, tsl2581 and tsl2583 devices. + Access ALS data via iio, sysfs. config TSL2772 tristate "TAOS TSL/TMD2x71 and TSL/TMD2x72 Family of light and proximity sensors" depends on I2C help - Support for: tsl2571, tsl2671, tmd2671, tsl2771, tmd2771, tsl2572, tsl2672, - tmd2672, tsl2772, tmd2772 devices. - Provides iio_events and direct access via sysfs. + Support for: tsl2571, tsl2671, tmd2671, tsl2771, tmd2771, tsl2572, tsl2672, + tmd2672, tsl2772, tmd2772 devices. + Provides iio_events and direct access via sysfs. config TSL4531 tristate "TAOS TSL4531 ambient light sensors" depends on I2C help - Say Y here if you want to build a driver for the TAOS TSL4531 family - of ambient light sensors with direct lux output. + Say Y here if you want to build a driver for the TAOS TSL4531 family + of ambient light sensors with direct lux output. - To compile this driver as a module, choose M here: the - module will be called tsl4531. + To compile this driver as a module, choose M here: the + module will be called tsl4531. config US5182D tristate "UPISEMI light and proximity sensor" depends on I2C help - If you say yes here you get support for the UPISEMI US5182D - ambient light and proximity sensor. + If you say yes here you get support for the UPISEMI US5182D + ambient light and proximity sensor. - This driver can also be built as a module. If so, the module - will be called us5182d. + This driver can also be built as a module. If so, the module + will be called us5182d. config VCNL4000 tristate "VCNL4000/4010/4020/4200 combined ALS and proximity sensor" depends on I2C help - Say Y here if you want to build a driver for the Vishay VCNL4000, - VCNL4010, VCNL4020, VCNL4200 combined ambient light and proximity - sensor. + Say Y here if you want to build a driver for the Vishay VCNL4000, + VCNL4010, VCNL4020, VCNL4200 combined ambient light and proximity + sensor. - To compile this driver as a module, choose M here: the - module will be called vcnl4000. + To compile this driver as a module, choose M here: the + module will be called vcnl4000. config VCNL4035 tristate "VCNL4035 combined ALS and proximity sensor" @@ -476,41 +477,41 @@ config VCNL4035 select REGMAP_I2C depends on I2C help - Say Y here if you want to build a driver for the Vishay VCNL4035, - combined ambient light (ALS) and proximity sensor. Currently only ALS - function is available. + Say Y here if you want to build a driver for the Vishay VCNL4035, + combined ambient light (ALS) and proximity sensor. Currently only ALS + function is available. - To compile this driver as a module, choose M here: the - module will be called vcnl4035. + To compile this driver as a module, choose M here: the + module will be called vcnl4035. config VEML6070 tristate "VEML6070 UV A light sensor" depends on I2C help - Say Y here if you want to build a driver for the Vishay VEML6070 UV A - light sensor. + Say Y here if you want to build a driver for the Vishay VEML6070 UV A + light sensor. - To compile this driver as a module, choose M here: the - module will be called veml6070. + To compile this driver as a module, choose M here: the + module will be called veml6070. config VL6180 tristate "VL6180 ALS, range and proximity sensor" depends on I2C help - Say Y here if you want to build a driver for the STMicroelectronics - VL6180 combined ambient light, range and proximity sensor. + Say Y here if you want to build a driver for the STMicroelectronics + VL6180 combined ambient light, range and proximity sensor. - To compile this driver as a module, choose M here: the - module will be called vl6180. + To compile this driver as a module, choose M here: the + module will be called vl6180. config ZOPT2201 tristate "ZOPT2201 ALS and UV B sensor" depends on I2C help - Say Y here if you want to build a driver for the IDT - ZOPT2201 ambient light and UV B sensor. + Say Y here if you want to build a driver for the IDT + ZOPT2201 ambient light and UV B sensor. - To compile this driver as a module, choose M here: the - module will be called zopt2201. + To compile this driver as a module, choose M here: the + module will be called zopt2201. endmenu diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c index c35e2f8df339..1eafd0b24e18 100644 --- a/drivers/iio/light/acpi-als.c +++ b/drivers/iio/light/acpi-als.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * ACPI Ambient Light Sensor Driver * @@ -10,20 +11,6 @@ * Final cleanup and debugging: * Copyright (C) 2013-2014 Marek Vasut <marex@denx.de> * Copyright (C) 2015 Gabriele Mazzotta <gabriele.mzt@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. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <linux/module.h> diff --git a/drivers/iio/light/adjd_s311.c b/drivers/iio/light/adjd_s311.c index e45bb6a277c2..d3269cd44fb5 100644 --- a/drivers/iio/light/adjd_s311.c +++ b/drivers/iio/light/adjd_s311.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * adjd_s311.c - Support for ADJD-S311-CR999 digital color sensor * * Copyright (C) 2012 Peter Meerwald <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * driver for ADJD-S311-CR999 digital color sensor (10-bit channels for * red, green, blue, clear); 7-bit I2C slave address 0x74 * diff --git a/drivers/iio/light/al3320a.c b/drivers/iio/light/al3320a.c index 66623facea9a..a21aa99e74e4 100644 --- a/drivers/iio/light/al3320a.c +++ b/drivers/iio/light/al3320a.c @@ -1,16 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * AL3320A - Dyna Image Ambient Light Sensor * * Copyright (c) 2014, Intel Corporation. * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * IIO driver for AL3320A (7-bit I2C slave address 0x1C). * * TODO: interrupt support, thresholds - * */ #include <linux/module.h> diff --git a/drivers/iio/light/apds9300.c b/drivers/iio/light/apds9300.c index 5c15736fb93e..856b6c468dea 100644 --- a/drivers/iio/light/apds9300.c +++ b/drivers/iio/light/apds9300.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * apds9300.c - IIO driver for Avago APDS9300 ambient light sensor * * Copyright 2013 Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> - * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. */ #include <linux/module.h> diff --git a/drivers/iio/light/bh1780.c b/drivers/iio/light/bh1780.c index 036f3bbe323c..340d64d0ac59 100644 --- a/drivers/iio/light/bh1780.c +++ b/drivers/iio/light/bh1780.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * ROHM 1780GLI Ambient Light Sensor Driver * diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c index aebf7dd071af..5f4fb5674fa0 100644 --- a/drivers/iio/light/cm32181.c +++ b/drivers/iio/light/cm32181.c @@ -1,10 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2013 Capella Microsystems Inc. * Author: Kevin Tsai <ktsai@capellamicro.com> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2, as published - * by the Free Software Foundation. */ #include <linux/delay.h> diff --git a/drivers/iio/light/cm3232.c b/drivers/iio/light/cm3232.c index c639cf276ee6..cd3cfb7d02bd 100644 --- a/drivers/iio/light/cm3232.c +++ b/drivers/iio/light/cm3232.c @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * CM3232 Ambient Light Sensor * * Copyright (C) 2014-2015 Capella Microsystems Inc. * Author: Kevin Tsai <ktsai@capellamicro.com> * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2, as published - * by the Free Software Foundation. - * * IIO driver for CM3232 (7-bit I2C slave address 0x10). */ diff --git a/drivers/iio/light/cm3323.c b/drivers/iio/light/cm3323.c index 83b08b6dc60f..50f3438c2b49 100644 --- a/drivers/iio/light/cm3323.c +++ b/drivers/iio/light/cm3323.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * CM3323 - Capella Color Light Sensor * * Copyright (c) 2015, Intel Corporation. * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * IIO driver for CM3323 (7-bit I2C slave address 0x10) * * TODO: calibscale to correct the lens factor diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c index e454bc6a33c6..964ede49f662 100644 --- a/drivers/iio/light/cm3605.c +++ b/drivers/iio/light/cm3605.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * CM3605 Ambient Light and Proximity Sensor * diff --git a/drivers/iio/light/cm36651.c b/drivers/iio/light/cm36651.c index 1dd8ed0121b3..7702c2bcbcfa 100644 --- a/drivers/iio/light/cm36651.c +++ b/drivers/iio/light/cm36651.c @@ -1,10 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2013 Samsung Electronics Co., Ltd. * Author: Beomho Seo <beomho.seo@samsung.com> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2, as published - * by the Free Software Foundation. */ #include <linux/delay.h> diff --git a/drivers/iio/light/cros_ec_light_prox.c b/drivers/iio/light/cros_ec_light_prox.c index fd1609e975ab..308ee6ff2e22 100644 --- a/drivers/iio/light/cros_ec_light_prox.c +++ b/drivers/iio/light/cros_ec_light_prox.c @@ -1,19 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 /* * cros_ec_light_prox - Driver for light and prox sensors behing CrosEC. * * Copyright (C) 2017 Google, Inc - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * 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. */ -#include <linux/delay.h> #include <linux/device.h> #include <linux/iio/buffer.h> #include <linux/iio/common/cros_ec_sensors_core.h> @@ -28,7 +19,6 @@ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> -#include <linux/sysfs.h> /* * We only represent one entry for light or proximity. EC is merging different diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index 44b13fbcd093..4d70c5bf35da 100644 --- a/drivers/iio/light/gp2ap020a00f.c +++ b/drivers/iio/light/gp2ap020a00f.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2013 Samsung Electronics Co., Ltd. * Author: Jacek Anaszewski <j.anaszewski@samsung.com> @@ -28,10 +29,6 @@ * with any triggers or illuminance events. Enabling/disabling * one of the proximity events automatically enables/disables * the other one. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, as - * published by the Free Software Foundation. */ #include <linux/debugfs.h> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index 94f33250ba5a..b6cd299517d1 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c @@ -1,20 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HID Sensors Driver * Copyright (c) 2012, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope 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. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * */ #include <linux/device.h> #include <linux/platform_device.h> diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index cf5a0c242609..7e1030af9ba3 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -1,19 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * HID Sensors Driver * Copyright (c) 2014, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope 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. - * - * You should have received a copy of the GNU General Public License along with - * this program. - * */ #include <linux/device.h> #include <linux/platform_device.h> diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index 846df4dce48c..805a74f08ad1 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * A iio driver for the light sensor ISL 29018/29023/29035. * @@ -5,16 +6,6 @@ * sensing and infrared sensing. * * Copyright (c) 2010, NVIDIA Corporation. - * - * 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. */ #include <linux/module.h> diff --git a/drivers/iio/light/isl29028.c b/drivers/iio/light/isl29028.c index f9912ab4f65c..4d220c835c75 100644 --- a/drivers/iio/light/isl29028.c +++ b/drivers/iio/light/isl29028.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * IIO driver for the light sensor ISL29028. * ISL29028 is Concurrent Ambient Light and Proximity Sensor @@ -5,18 +6,6 @@ * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2016-2017 Brian Masney <masneyb@onstation.org> * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * * Datasheets: * - http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29028.pdf * - http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29030.pdf diff --git a/drivers/iio/light/isl29125.c b/drivers/iio/light/isl29125.c index ed38edcd5efe..e37894f0ae0b 100644 --- a/drivers/iio/light/isl29125.c +++ b/drivers/iio/light/isl29125.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * isl29125.c - Support for Intersil ISL29125 RGB light sensor * * Copyright (c) 2014 Peter Meerwald <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * RGB light sensor with 16-bit channels for red, green, blue); * 7-bit I2C slave address 0x44 * diff --git a/drivers/iio/light/jsa1212.c b/drivers/iio/light/jsa1212.c index 811505d925b3..13deeebe37eb 100644 --- a/drivers/iio/light/jsa1212.c +++ b/drivers/iio/light/jsa1212.c @@ -1,17 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * JSA1212 Ambient Light & Proximity Sensor Driver * * Copyright (c) 2014, Intel Corporation. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope 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. - * * JSA1212 I2C slave address: 0x44(ADDR tied to GND), 0x45(ADDR tied to VDD) * * TODO: Interrupt support, thresholds, range support. diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c index ff5a3324b489..6733b52c22df 100644 --- a/drivers/iio/light/lm3533-als.c +++ b/drivers/iio/light/lm3533-als.c @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * lm3533-als.c -- LM3533 Ambient Light Sensor driver * * Copyright (C) 2011-2012 Texas Instruments * * Author: Johan Hovold <jhovold@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. */ #include <linux/atomic.h> diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 830a2d45aa4d..71f99d2a22c1 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * ltr501.c - Support for Lite-On LTR501 ambient light and proximity sensor * * Copyright 2014 Peter Meerwald <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * 7-bit I2C slave address 0x23 * * TODO: IR LED characteristics diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c index d3fb460cfbdc..d6d8007ba430 100644 --- a/drivers/iio/light/max44000.c +++ b/drivers/iio/light/max44000.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * MAX44000 Ambient and Infrared Proximity Sensor * * Copyright (c) 2016, Intel Corporation. * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * Data sheet: https://datasheets.maximintegrated.com/en/ds/MAX44000.pdf * * 7-bit I2C slave address 0x4a diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c index 54d88b60e303..e666879007d2 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /** * opt3001.c - Texas Instruments OPT3001 Light Sensor * @@ -5,15 +6,6 @@ * * Author: Andreas Dannenberg <dannenberg@ti.com> * Based on previous work from: Felipe Balbi <balbi@ti.com> - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 of the License - * as published by the Free Software Foundation. - * - * 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. */ #include <linux/bitops.h> diff --git a/drivers/iio/light/pa12203001.c b/drivers/iio/light/pa12203001.c index 30ea1a088dd9..0295783f036a 100644 --- a/drivers/iio/light/pa12203001.c +++ b/drivers/iio/light/pa12203001.c @@ -1,11 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015 Intel Corporation * * Driver for TXC PA12203001 Proximity and Ambient Light Sensor. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. * To do: Interrupt support. */ diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c index ffe9ce798ea2..a0a7aeae5a82 100644 --- a/drivers/iio/light/rpr0521.c +++ b/drivers/iio/light/rpr0521.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * RPR-0521 ROHM Ambient Light and Proximity Sensor * * Copyright (c) 2015, Intel Corporation. * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * IIO driver for RPR-0521RS (7-bit I2C slave address 0x38). * * TODO: illuminance channel diff --git a/drivers/iio/light/si1145.c b/drivers/iio/light/si1145.c index 76f16f9c7616..6579d2418814 100644 --- a/drivers/iio/light/si1145.c +++ b/drivers/iio/light/si1145.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * si1145.c - Support for Silabs SI1132 and SI1141/2/3/5/6/7 combined ambient * light, UV index and proximity sensors @@ -5,10 +6,6 @@ * Copyright 2014-16 Peter Meerwald-Stadler <pmeerw@pmeerw.net> * Copyright 2016 Crestez Dan Leonard <leonard.crestez@intel.com> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * SI1132 (7-bit I2C slave address 0x60) * SI1141/2/3 (7-bit I2C slave address 0x5a) * SI1145/6/6 (7-bit I2C slave address 0x60) diff --git a/drivers/iio/light/st_uvis25.h b/drivers/iio/light/st_uvis25.h index 5e970ab480cd..78bc56aad129 100644 --- a/drivers/iio/light/st_uvis25.h +++ b/drivers/iio/light/st_uvis25.h @@ -1,11 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * STMicroelectronics uvis25 sensor driver * * Copyright 2017 STMicroelectronics Inc. * * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> - * - * Licensed under the GPL-2. */ #ifndef ST_UVIS25_H diff --git a/drivers/iio/light/st_uvis25_core.c b/drivers/iio/light/st_uvis25_core.c index 302635836e6b..d262c254b895 100644 --- a/drivers/iio/light/st_uvis25_core.c +++ b/drivers/iio/light/st_uvis25_core.c @@ -1,11 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * STMicroelectronics uvis25 sensor driver * * Copyright 2017 STMicroelectronics Inc. * * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> - * - * Licensed under the GPL-2. */ #include <linux/kernel.h> diff --git a/drivers/iio/light/st_uvis25_i2c.c b/drivers/iio/light/st_uvis25_i2c.c index afd6eb01a202..dacbac6a6662 100644 --- a/drivers/iio/light/st_uvis25_i2c.c +++ b/drivers/iio/light/st_uvis25_i2c.c @@ -1,11 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * STMicroelectronics uvis25 i2c driver * * Copyright 2017 STMicroelectronics Inc. * * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> - * - * Licensed under the GPL-2. */ #include <linux/kernel.h> diff --git a/drivers/iio/light/st_uvis25_spi.c b/drivers/iio/light/st_uvis25_spi.c index cdfee5e84d5e..a9ceae4f58b3 100644 --- a/drivers/iio/light/st_uvis25_spi.c +++ b/drivers/iio/light/st_uvis25_spi.c @@ -1,11 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * STMicroelectronics uvis25 spi driver * * Copyright 2017 STMicroelectronics Inc. * * Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> - * - * Licensed under the GPL-2. */ #include <linux/kernel.h> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index 6e2a169da950..eff7ac9ae669 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /** * Sensortek STK3310/STK3311 Ambient Light and Proximity Sensor * * Copyright (c) 2015, Intel Corporation. * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * IIO driver for STK3310/STK3311. 7-bit I2C address: 0x48. */ diff --git a/drivers/iio/light/tcs3414.c b/drivers/iio/light/tcs3414.c index 205e5659ce6b..7c0291c5fe76 100644 --- a/drivers/iio/light/tcs3414.c +++ b/drivers/iio/light/tcs3414.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * tcs3414.c - Support for TAOS TCS3414 digital color sensor * * Copyright (c) 2014 Peter Meerwald <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * Digital color sensor with 16-bit channels for red, green, blue, clear); * 7-bit I2C slave address 0x39 (TCS3414) or 0x29, 0x49, 0x59 (TCS3413, * TCS3415, TCS3416, resp.) diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index e7923b514d7a..12ad34441010 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * tcs3472.c - Support for TAOS TCS3472 color light-to-digital converter * * Copyright (c) 2013 Peter Meerwald <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * Color light sensor with 16-bit channels for red, green, blue, clear); * 7-bit I2C slave address 0x39 (TCS34721, TCS34723) or 0x29 (TCS34725, * TCS34727) diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c index 6bbb0b1e6032..d8c40a83097d 100644 --- a/drivers/iio/light/tsl2563.c +++ b/drivers/iio/light/tsl2563.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * drivers/iio/light/tsl2563.c * @@ -8,20 +9,6 @@ * * Converted to IIO driver * Amit Kucheria <amit.kucheria@verdurent.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA */ #include <linux/module.h> diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c index 4b5d9988f025..a760d14e146a 100644 --- a/drivers/iio/light/tsl2583.c +++ b/drivers/iio/light/tsl2583.c @@ -1,19 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Device driver for monitoring ambient light intensity (lux) * within the TAOS tsl258x family of devices (tsl2580, tsl2581, tsl2583). * * Copyright (c) 2011, TAOS Corporation. * Copyright (c) 2016-2017 Brian Masney <masneyb@onstation.org> - * - * 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. */ #include <linux/kernel.h> diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c index 06171cb76e23..0dfc664205c7 100644 --- a/drivers/iio/light/tsl4531.c +++ b/drivers/iio/light/tsl4531.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * tsl4531.c - Support for TAOS TSL4531 ambient light sensor * * Copyright 2013 Peter Meerwald <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * IIO driver for the TSL4531x family * TSL45311/TSL45313: 7-bit I2C slave address 0x39 * TSL45315/TSL45317: 7-bit I2C slave address 0x29 diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c index 68e52943879a..b995f21a3347 100644 --- a/drivers/iio/light/us5182d.c +++ b/drivers/iio/light/us5182d.c @@ -1,17 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015 Intel Corporation * * Driver for UPISEMI us5182d Proximity and Ambient Light Sensor. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - * - * This program is distributed in the hope 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. - * * To do: Interrupt support. */ diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index 04fd0d4b6f19..51421ac32517 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -1,22 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only /* - * vcnl4000.c - Support for Vishay VCNL4000/4010/4020/4200 combined ambient + * vcnl4000.c - Support for Vishay VCNL4000/4010/4020/4040/4200 combined ambient * light and proximity sensor * * Copyright 2012 Peter Meerwald <pmeerw@pmeerw.net> - * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. + * Copyright 2019 Pursim SPC * * IIO driver for: * VCNL4000/10/20 (7-bit I2C slave address 0x13) + * VCNL4040 (7-bit I2C slave address 0x60) * VCNL4200 (7-bit I2C slave address 0x51) * * TODO: * allow to adjust IR current * proximity threshold and event handling * periodic ALS/proximity measurement (VCNL4010/20) - * interrupts (VCNL4010/20, VCNL4200) + * interrupts (VCNL4010/20/40, VCNL4200) */ #include <linux/module.h> @@ -30,6 +29,7 @@ #define VCNL4000_DRV_NAME "vcnl4000" #define VCNL4000_PROD_ID 0x01 #define VCNL4010_PROD_ID 0x02 /* for VCNL4020, VCNL4010 */ +#define VCNL4040_PROD_ID 0x86 #define VCNL4200_PROD_ID 0x58 #define VCNL4000_COMMAND 0x80 /* Command register */ @@ -49,6 +49,8 @@ #define VCNL4200_AL_DATA 0x09 /* Ambient light data */ #define VCNL4200_DEV_ID 0x0e /* Device ID, slave address and version */ +#define VCNL4040_DEV_ID 0x0c /* Device ID and version */ + /* Bit masks for COMMAND register */ #define VCNL4000_AL_RDY BIT(6) /* ALS data ready? */ #define VCNL4000_PS_RDY BIT(5) /* proximity data ready? */ @@ -58,6 +60,7 @@ enum vcnl4000_device_ids { VCNL4000, VCNL4010, + VCNL4040, VCNL4200, }; @@ -90,6 +93,7 @@ static const struct i2c_device_id vcnl4000_id[] = { { "vcnl4000", VCNL4000 }, { "vcnl4010", VCNL4010 }, { "vcnl4020", VCNL4010 }, + { "vcnl4040", VCNL4040 }, { "vcnl4200", VCNL4200 }, { } }; @@ -128,31 +132,53 @@ static int vcnl4000_init(struct vcnl4000_data *data) static int vcnl4200_init(struct vcnl4000_data *data) { - int ret; + int ret, id; ret = i2c_smbus_read_word_data(data->client, VCNL4200_DEV_ID); if (ret < 0) return ret; - if ((ret & 0xff) != VCNL4200_PROD_ID) - return -ENODEV; + id = ret & 0xff; + + if (id != VCNL4200_PROD_ID) { + ret = i2c_smbus_read_word_data(data->client, VCNL4040_DEV_ID); + if (ret < 0) + return ret; + + id = ret & 0xff; + + if (id != VCNL4040_PROD_ID) + return -ENODEV; + } + + dev_dbg(&data->client->dev, "device id 0x%x", id); data->rev = (ret >> 8) & 0xf; /* Set defaults and enable both channels */ - ret = i2c_smbus_write_byte_data(data->client, VCNL4200_AL_CONF, 0x00); + ret = i2c_smbus_write_word_data(data->client, VCNL4200_AL_CONF, 0); if (ret < 0) return ret; - ret = i2c_smbus_write_byte_data(data->client, VCNL4200_PS_CONF1, 0x00); + ret = i2c_smbus_write_word_data(data->client, VCNL4200_PS_CONF1, 0); if (ret < 0) return ret; data->al_scale = 24000; data->vcnl4200_al.reg = VCNL4200_AL_DATA; data->vcnl4200_ps.reg = VCNL4200_PS_DATA; - /* Integration time is 50ms, but the experiments show 54ms in total. */ - data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000); - data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000); + switch (id) { + case VCNL4200_PROD_ID: + /* Integration time is 50ms, but the experiments */ + /* show 54ms in total. */ + data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000); + data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000); + break; + case VCNL4040_PROD_ID: + /* Integration time is 80ms, add 10ms. */ + data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000); + data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000); + break; + } data->vcnl4200_al.last_measurement = ktime_set(0, 0); data->vcnl4200_ps.last_measurement = ktime_set(0, 0); mutex_init(&data->vcnl4200_al.lock); @@ -271,6 +297,12 @@ static const struct vcnl4000_chip_spec vcnl4000_chip_spec_cfg[] = { .measure_light = vcnl4000_measure_light, .measure_proximity = vcnl4000_measure_proximity, }, + [VCNL4040] = { + .prod = "VCNL4040", + .init = vcnl4200_init, + .measure_light = vcnl4200_measure_light, + .measure_proximity = vcnl4200_measure_proximity, + }, [VCNL4200] = { .prod = "VCNL4200", .init = vcnl4200_init, @@ -363,9 +395,31 @@ static int vcnl4000_probe(struct i2c_client *client, return devm_iio_device_register(&client->dev, indio_dev); } +static const struct of_device_id vcnl_4000_of_match[] = { + { + .compatible = "vishay,vcnl4000", + .data = "VCNL4000", + }, + { + .compatible = "vishay,vcnl4010", + .data = "VCNL4010", + }, + { + .compatible = "vishay,vcnl4010", + .data = "VCNL4020", + }, + { + .compatible = "vishay,vcnl4200", + .data = "VCNL4200", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, vcnl_4000_of_match); + static struct i2c_driver vcnl4000_driver = { .driver = { .name = VCNL4000_DRV_NAME, + .of_match_table = vcnl_4000_of_match, }, .probe = vcnl4000_probe, .id_table = vcnl4000_id, diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c index f4bf3c5b5eda..a3138e1b5803 100644 --- a/drivers/iio/light/veml6070.c +++ b/drivers/iio/light/veml6070.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * veml6070.c - Support for Vishay VEML6070 UV A light sensor * * Copyright 2016 Peter Meerwald-Stadler <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * IIO driver for VEML6070 (7-bit I2C slave addresses 0x38 and 0x39) * * TODO: integration time, ACK signal diff --git a/drivers/iio/light/vl6180.c b/drivers/iio/light/vl6180.c index 192c77ef3608..d9533a76b8f6 100644 --- a/drivers/iio/light/vl6180.c +++ b/drivers/iio/light/vl6180.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * vl6180.c - Support for STMicroelectronics VL6180 ALS, range and proximity * sensor @@ -5,10 +6,6 @@ * Copyright 2017 Peter Meerwald-Stadler <pmeerw@pmeerw.net> * Copyright 2017 Manivannan Sadhasivam <manivannanece23@gmail.com> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * IIO driver for VL6180 (7-bit I2C slave address 0x29) * * Range: 0 to 100mm diff --git a/drivers/iio/light/zopt2201.c b/drivers/iio/light/zopt2201.c index 041ac9effdb0..5f54f39e7a4c 100644 --- a/drivers/iio/light/zopt2201.c +++ b/drivers/iio/light/zopt2201.c @@ -1,12 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * zopt2201.c - Support for IDT ZOPT2201 ambient light and UV B sensor * * Copyright 2017 Peter Meerwald-Stadler <pmeerw@pmeerw.net> * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * * Datasheet: https://www.idt.com/document/dst/zopt2201-datasheet * 7-bit I2C slave addresses 0x53 (default) or 0x52 (programmed) * |