aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/light (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 396Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 2 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190531081038.470437358@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 336Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 246 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000436.674189849@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 111 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000436.567572064@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330Thomas Gleixner17-69/+17
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 55 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000436.108941081@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 309Thomas Gleixner1-13/+1
Based on 2 normalized pattern(s): 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 you should have received a copy of the gnu general public license along with this program 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 11 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000434.249870634@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 263 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201Thomas Gleixner1-12/+1
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 228 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528171438.107155473@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177Thomas Gleixner4-8/+4
Based on 1 normalized pattern(s): licensed under the gpl 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 135 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170026.071193225@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner2-20/+2
Based on 3 normalized pattern(s): 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 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 [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] 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 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 [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1334 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner1-5/+1
Based on 1 normalized pattern(s): 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 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner1-0/+1
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier for more missed filesThomas Gleixner2-0/+2
Add SPDX license identifiers to all files which: - Have no license information of any form - Have MODULE_LICENCE("GPL*") inside which was used in the initial scan/conversion to ignore the file These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-04iio: light: vcnl4000 add support for the VCNL4040 proximity and light sensorAngus Ainslie (Purism)1-8/+43
The VCNL4040 is almost identical to the VCNL4200 as far as register layout goes but just need to check a different ID register location. Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04iio: light: vcnl4000 add devicetree hooksAngus Ainslie (Purism)1-0/+22
Add an of_match table for devicetree probing. Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04iio: light: vcnl4000 use word writes instead of byte writesAngus Ainslie (Purism)1-2/+2
The VCNL4200 datasheet says that word read and writes should be used to access the registers. Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> Tested-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04iio: cros_ec: Switch to SPDX identifier.Enric Balletbo i Serra1-9/+1
Adopt the SPDX license identifier headers to ease license compliance management. Also fix MODULE_LICENSE for cros_ec_accel_legacy to match the SPDX and boiler plate license. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04iio: cros_ec: Drop unnecessary include filesGuenter Roeck1-2/+0
The cros_ec sensors drivers do not call any sysfs functions or use any sysfs defines, and thus do not need to include linux/sysfs.h. Also, some cros_ec drivers include linux/delay.h and is not used. Signed-off-by: Guenter Roeck <groeck@chromium.org> [remove linux/delay.h] Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04drivers: iio: Kconfig: pedantic cleanupEnrico Weigelt, metux IT consult1-137/+137
Formatting of Kconfig files doesn't look so pretty, so just take damp cloth and clean it up. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-02-02iio: light: add driver for MAX44009Robert Eshleman3-0/+566
The MAX44009 is a low-power ambient light sensor from Maxim Integrated. It differs from the MAX44000 in that it doesn't have proximity sensing and that it requires far less current (1 micro-amp vs 5 micro-amps). The register mapping and feature set between the two are different enough to require a new driver for the MAX44009. Developed and tested with a BeagleBone Black and UDOO Neo (i.MX6SX) Supported features: * Reading lux (processed value) * Rising and falling illuminance threshold events * Configuring integration time https://datasheets.maximintegrated.com/en/ds/MAX44009.pdf Signed-off-by: Robert Eshleman <bobbyeshleman@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-12iio: light: isl29018: add vcc regulator operation supportAnson Huang1-1/+45
The light sensor's power supply could be controllable by regulator on some platforms, such as i.MX6Q-SABRESD board, the light sensor isl29023's power supply is controlled by a GPIO fixed regulator, need to make sure the regulator is enabled before any operation of sensor, this patch adds vcc regulator operation support. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-12-03Merge 4.20-rc5 into staging-nextGreg Kroah-Hartman2-6/+10
We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-22Merge tag 'iio-for-4.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-testingGreg Kroah-Hartman3-0/+690
Jonathan writes: First set of new device support, features and cleanups for IIO in the 4.21 cycle Along with the headline feature of 5 new drivers, we have the substantial addition of auxilliary sensor support on the lsm6sdx parts for ST. There has also been a good set of staging cleanup in this period with more underway. An ever increasing number of devices supported with just a new ID which is a good sign that at least some manufacturers are continuing to stabilise their interfaces. New device support, * ad7124 - New driver supporting Analog Devices' ad7124-4 and ad7124-8 parts with the inevitable DT binding. * ad7949 - New driver supporting Analog Devices' ad7949, AD7682 and AD7689 ADCs. * rm3100 - New driver supporting PNIs RM3100 magnometer with bindings and vendor prefix. * ti-dac7311 - New driver supporting DAC7311, DAC6311 and DAC5311 TI DACs, with DT bindings. * vcnl5035 - New driver supporting the light sensor part of the VCNL4035, with DT bindings Features, * bindings - Add a generic ADC channel binding as we keep reinventing this wheel. * adc128s052 - Add IDs for additional pin compatible parts. - Add APCI ID seen on E3940 UP squared boards. * ad_sigma_delta - Allow for custom data register overiding default. * kxcjk1013 - Add KIOX0009 ACPI ID as seen on the Acer One 10. * lsm6dsx - Rework leading to... - External sensor support using the built in I2C master. - Initial support for a slave lis2mdl magnetometer. * meson-saradc - Add temperature sensor support and bindings. * st_magn - New ID for lsm9dsl_magn with bindings - New ID for lis3de accelerometer * tpl0102 - Add supprot for IIO_AVAIL_RANGE to report the range available from this device to userspace and in kernel users. Cleanups and minor fixes * tools - Allow outside specification of CFLAGS * ad2s90 - Handle and spi_read error. - Handle spi_setup failure - Drop a pointless assignment. - Prevent a potentail race by moving device registration to after all other setup. - Add missing scale attribute. - Add a sanity check on channel type before trying to read it. * ad2s1210 - Move to modern gpio descriptors. - Drop a gpioin flag which made no sense as far as we can tell. - Add dt table (bindings doc to follow when this is ready for moving out of staging). * ad5933 - Drop camel-case naming of ext_clk_hz. - White space fixes. * ad7150 - Local variable to shorten overly long line. - Alignment and line break fixes. * ad7280a - Handle an error path that was previously ignored. - Use crc8.h to build the crc table replacing custom code. - Avoid unecessary cast. - Power down the device if an error happens in probe - Use devm routines to simplify probe and remove. * ad7606 - Alignment fixes. * ad7780 - This worked as long as by coincidence an uninitialized value was 0. Lets not rely on that. - Ensure gain update is only used with the ad778x chips that actually support it. - Tidy up pattern mask generation. - Read regulator when scale is requested (which should be infrequent) as it might have changed from initialization. * ad7816 - Move to modern gpio descriptors - Don't use a busy_pin for ad7818 as there isn't one. - Ensure RD/WR and CONVST pins are outputs (previously they were brought up as inputs which doesn't seem to make any sense) - DT id table. * adc128s052 - SPDX * adt7316 - Alignment fix. - Fix data reading. When using I2C the driver never actually used the value read. This has been broken a very long time hence no rush to fix it now + the driver is undergoing a lot of cleanup. - Sanity check that the i2c read didn't fail to actually read anything. * dpot-dac - Mark a switch full through with slightly different text so that gcc doesn't warn on it. * gyro-adc - Fix a wrong file in the MAINTAINERS entry and add binding doc to the listed files. * ina2xx - Add some early returns to clarify error paths in switch. * lsm6dsx - MAINTAINERS entry. * max11100 - SPDX * max9611 - SPDX * mcp4131 - use of_device_get_match_data in preference to spi_get_device_id approach. * rcar-adc - SPDX * sc27xx - Add ADC conversion timeout support to avoid possible fault. * ssp_sensors - Don't free managed resources manually. * st-magn - Add a comment to avoid future confusion over when to use -magn postfix (on multi chip in package parts) - Add BDU register for LIS3MDL where it seems to have been missed. * st-sensors - Minor spelling, grammar etc fixes. * tpl0102 - Use a pointer rather than an index of an array to improve conciseness. * tag 'iio-for-4.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (80 commits) Staging: iio: adt7316: Add an extra check for 'ret' equals to 0 Staging: iio: adt7316: Fix i2c data reading, set the data field dt-bindings: iio: adc: Add docs for ad7124 iio: adc: Add ad7124 support dt-bindings: iio: adc: Add common ADCs properties to a separate file iio: ad_sigma_delta: Allow to provide custom data register address staging: iio: ad7816: Add device tree table. iio: imu: st_lsm6dsx: add entry in MAINTAINERS file iio: potentiometer: mcp4131: use of_device_get_match_data() staging: iio: adc: ad7280a: use devm_* APIs staging: iio: adc: ad7280a: power down the device on error in probe dt-bindings: iio: imu: st_lsm6dsx: add support to i2c pullup resistors iio: imu: st_lsm6dsx: add hw FIFO support to i2c controller iio: imu: st_lsm6dsx: add st_lsm6dsx_push_tagged_data routine iio: imu: st_lsm6dsx: add i2c embedded controller support iio: imu: st_lsm6dsx: introduce st_lsm6dsx_sensor_set_enable routine iio: imu: st_lsm6dsx: introduce ST_LSM6DSX_ID_EXT sensor ids iio: imu: st_lsm6dsx: remove static from st_lsm6dsx_set_watermark iio: imu: st_lsm6dsx: reload trimming parameter at bootstrap iio: imu: st_lsm6dsx: introduce locked read/write utility routines ...
2018-11-16iio: light: Add support for vishay vcnl4035Parthiban Nallathambi3-0/+690
Add support for VCNL4035, which is capable of Ambient light sensing (ALS) and proximity function. This patch adds support only for ALS function Signed-off-by: Parthiban Nallathambi <pn@denx.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbersHans de Goede2-6/+10
Before this commit sensor_hub_input_attr_get_raw_value() failed to take the signedness of 16 and 8 bit values into account, returning e.g. 65436 instead of -100 for the z-axis reading of an accelerometer. This commit adds a new is_signed parameter to the function and makes all callers pass the appropriate value for this. While at it, this commit also fixes up some neighboring lines where statements were needlessly split over 2 lines to improve readability. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-10-29Merge tag 'staging-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds3-15/+205
Pull staging/IIO driver updates from Greg KH: "Here is the big staging and IIO driver pull request for 4.20-rc1. There are lots of things here, we ended up adding more lines than removing, thanks to a large influx of Comedi National Instrument device support. Someday soon we need to get comedi out of staging... Other than the comedi drivers, the "big" things here are: - new iio drivers - delete dgnc driver (no one used it and no one had the hardware anymore) - vbox driver updates and fixes - erofs fixes - tons and tons of tiny checkpatch fixes for almost all staging drivers All of these have been in linux-next, with the last few happening a bit "late" due to them getting stuck on my laptop during travel to the Mantainers summit" * tag 'staging-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (690 commits) staging: gasket: Fix sparse "incorrect type in assignment" warnings. staging: gasket: remove debug logs for callback invocation staging: gasket: remove debug logs in page table mapping calls staging: rtl8188eu: core: Use sizeof(*p) instead of sizeof(struct P) for memory allocation staging: ks7010: Remove extra blank line staging: gasket: Remove extra blank line staging: media: davinci_vpfe: Fix spelling mistake in enum staging: speakup: Add a pair of braces staging: wlan-ng: Replace long int with long staging: MAINTAINERS: remove obsolete IPX staging directory staging: MAINTAINERS: remove NCP filesystem entry staging: rtl8188eu: cleanup comparsions to false staging: gasket: Update device virtual address comment staging: gasket: sysfs: fix attribute release comment staging: gasket: apex: fix sysfs_show staging: gasket: page_table: simplify gasket_components_to_dev_address staging: gasket: page_table: fix comment in components_to_dev_address staging: gasket: page table: fixup error path allocating coherent mem staging: gasket: page_table: rearrange gasket_page_table_entry staging: gasket: page_table: remove unnecessary PTE status set to free ...
2018-09-29iio: light: bh1750: Add device tree supportryang1-0/+11
Add device tree support for ROHM BH1750 series ambient light sensors. Signed-off-by: ryang <decatf@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-08iio: light: bh1750: simplify setting PM opsTomasz Duszynski1-7/+2
Relying on CONFIG_PM_SLEEP to set PM ops is not necessary since core will handle everything internally. One have to only make sure that functions that can go unused are marked with __maybe_unused. Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-08iio: light: bh1750: switch to SPDX identifierTomasz Duszynski1-4/+1
Drop boilerplate license text and use SPDX identifier instead. Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-07regmap: split up regmap_config.use_single_rwDavid Frey2-12/+14
Split regmap_config.use_single_rw into use_single_read and use_single_write. This change enables drivers of devices which only support bulk operations in one direction to use the regmap_bulk_*() functions for both directions and have their bulk operation split into single operations only when necessary. Update all struct regmap_config instances where use_single_rw==true to instead set both use_single_read and use_single_write. No attempt was made to evaluate whether it is possible to set only one of use_single_read or use_single_write. Signed-off-by: David Frey <dpfrey@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-19iio: max44000: remove unused variable max44000_alstim_shiftColin Ian King1-1/+0
Variable max44000_alstim_shift is defined but is never used hence it is redundant and can be removed. This variable has been like this since the driver was added back in 2016. Cleans up clang warning: warning: 'max44000_alstim_shift' defined but not used [-Wunused-const-variable=] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-19iio: tsl2772: add support for regulator frameworkBrian Masney1-1/+94
This patch adds support for the regulator framework to the tsl2772 driver. Driver was tested using a LG Nexus 5 (hammerhead) phone with the two regulators and on a Raspberry Pi 2 without any regulators controlling the power to the sensor. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-18iio: tsl2772: add support for avago,apds9930Brian Masney1-2/+16
The Avago APDS9930 has the same register set as the TAOS/AMS TSL2772 so this patch adds the correct bindings and the appropriate LUX table values derived from the values in the datasheet. Driver was tested on a LG Nexus 5 (hammerhead) phone. avago,apds9930 datasheet: https://www.mouser.com/datasheet/2/678/avago_AV02-3190EN_DS_APDS-9930_2014-03-25[1]-1217273.pdf tsl2772 datasheet: https://ams.com/eng/content/download/291503/1066377/file/TSL2772_DS000181_2-00.pdf Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-18iio: tsl2772: add support for reading proximity led settings from device treeBrian Masney1-0/+81
This patch adds support for optionally reading the proximity led diode and current settings from device tree. This was tested using a LG Nexus 5 (hammerhead) which requires a different diode than the driver default for the IR LED. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-01iio: light: si1133: fix uninitialized resp variableMaxime Roussin-Bélanger1-0/+3
Read response register to detect any error. Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-01Merge branch 'fixes-togreg' into togregJonathan Cameron1-1/+1
2018-07-30iio: light: si1133 fix test for val being not zero or not one.Colin Ian King1-1/+1
The current check on val always results in true and so the call to sii1133_update_adcsens never gets called. Fix this check so it returns with -EINVAL only when val is not zero and not one. Detected by CoverityScan, CID#1472099 ("Logically dead code") Fixes: e01e7eaf37d8 ("iio: light: introduce si1133") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-29iio: vcnl4000: add support for VCNL4200Tomas Novotny2-10/+109
VCNL4200 is an integrated long distance (up to 1500mm) proximity and ambient light sensor. The support is very basic. There is no configuration of proximity and ambient light sensing yet. Only the reading of both measured values is done. The reading of ambient light and proximity values is blocking. If you request a new value too early, the driver waits for new value to be ready. Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-29iio: vcnl4000: warn on incorrectly specified device idTomas Novotny1-1/+13
We can detect incorrectly specified device id for some chips, so warn user in that case. Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-29iio: vcnl4000: add VCNL4010 and VCNL4020 device idTomas Novotny1-0/+9
The driver already supports VCNL4010/20 devices. The currently supported features and detectable product id are the same, so add shared id for them. This is a groundwork to extend the driver by detecting incorrectly specified device id. Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-29iio: vcnl4000: make the driver extendableTomas Novotny1-18/+67
There are similar chips in the vcnl4xxx family. The initialization and communication is a bit different for members of the family, so this patch makes the driver extendable for different chips. There is no functional change. Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-25Merge tag 'iio-for-4.19b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman3-0/+1081
Jonathan writes: Second set of IIO new device support, features and cleanups. There are also a couple of fixes that can wait for the coming merge window. Core new features * Support for phase channels (used in time of flight sensors amongst other things) * Support for deep UV light channel modifier. New Device Support * AD4758 DAC - New driver and dt bindings. * adxl345 - Support the adxl375 +-200g part which is register compatible. * isl29501 Time of flight sensor. - New driver * meson-saradc - Support the Meson8m2 Socs - right now this is just an ID, but there will be additional difference in future. * mpu6050 - New ID for 6515 variant. * si1133 UV sensor. - New driver * Spreadtrum SC27xx PMIC ADC - New driver and dt bindings. Features * adxl345 - Add calibration offset readback and writing. - Add sampling frequency control. Fixes and Cleanups * ad5933 - Use a macro for the channel definition to reduce duplication. * ad9523 - Replace use of core mlock with a local lock. Part of ongoing efforts to avoid confusing the purpose of mlock which is only about iio core state changes. - Fix displayed phase which was out by a factor of 10. * adxl345 - Add a link to the datasheet. - Rework the use of the address field in the chan_spec structures to allow addition of more per channel information. * adis imu - Mark switch fall throughs. * at91-sama5d2 - Fix some casting on big endian systems. * bmp280 - Drop some DT elements that aren't used and should mostly be done from userspace rather than in DT. * hx711 - add clock-frequency dt binding and resulting delay to deal with capacitance issue on some boards. - fix a spurious unit-address in the example. * ina2xx - Avoid a possible kthread_stop with a stale task_struct. * ltc2632 - Remove some unused local variables (assigned but value never used). * max1363 - Use device_get_match_data to remove some boilerplate. * mma8452 - Mark switch fall throughs. * sca3000 - Fix a missing return in a switch statement (a bad fallthrough previously!) * sigma-delta-modulator - Drop incorrect unit address from the DT example. * st_accel - Use device_get_match_data to drop some boiler plate. - Move to probe_new for i2c driver as second parameter not used. * st_sensors library - Use a strlcpy (safe in this case). * st_lsm6dsx - Add some error logging. * ti-ads7950 - SPDX - Allow simultaneous buffered and polled reads. Needed on a Lego Mindstorms EV3 where some channels are used for power supply monitoring at a very low rate. * ti-dac5571 - Remove an unused variable. * xadc - Drop some dead code.
2018-07-23iio: light: introduce si1133Maxime Roussin-Bélanger3-0/+1081
e-mail received from Silicon Lab to confirm that the licensing isn't a problem. " Dear Maxime Roussin-Belanger, The LUX calculation code only works with Si1133. As long as the software is used with Silicon Lab's sensor product, I don't see any problem. Regards, Tony " Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Reviewed-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-06-24iio: tsl2x7x/tsl2772: avoid potential division by zeroColin Ian King1-0/+2
It may be possible for tsl2772_get_lux to return a zero lux value and hence a division by zero can occur when lux_val is zero. Check for this case and return -ERANGE to avoid the division by zero. Detected by CoverityScan, CID#1469484 ("Division or modulo by zero") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-20iio: tsl2583: correct values in integration_time_availableBrian Masney1-1/+1
The times reported by the in_illuminance_integration_time_available sysfs attribute are actually in milliseconds, not microseconds. This patch corrects the times with the correct unit. The fixes tag is inaccurate as the issue existed when the driver was still in staging. However, lots of changes occured before it graduated so this is as a good a point as any for backports. Signed-off-by: Brian Masney <masneyb@onstation.org> Fixes: f44d5c8ac399 ("staging: iio: tsl2583: move out of staging") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12staging: iio: tsl2x7x/tsl2772: move out of stagingBrian Masney3-0/+1809
Move the tsl2772 driver out of staging and into mainline. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-17iio: cros_ec: Move cros_ec_sensors_core.h in /includeGwendal Grignou1-2/+1
Similar to other common iio frameworks, move cros_ec_sensors_core.h from drivers/iio/common/cros_ec_sensors/ to include/linux/iio/common. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07iio: Replace occurrences of magic number 0 by IIO_CHAN_INFO_RAWRodrigo Siqueira2-2/+2
Usually, functions responsible for reading raw data typically relies on values from iio_chan_info_enum to correctly identify the type of data to be read. There is a set of a device driver that uses the magic number 0 instead of IIO_CHAN_INFO_RAW. This patch improves the readability by replaces the magic number 0 for the appropriate IIO_CHAN_INFO_RAW in six devices driver in the IIO subsystem. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-03iio: light: lv0104cs: Add support for LV0104CS light sensorJeff LaBundy3-0/+542
This patch adds support for the On Semiconductor LV0104CS ambient light sensor. Signed-off-by: Jeff LaBundy <jeff@labundy.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-03iio: cros_ec: Relax sampling frequency before suspendingGwendal Grignou1-0/+1
If an application set a tight sampling frequency, given the interrupt use is a wakeup source, suspend will not happen: the kernel will receive a wake up interrupt and will cancel the suspend process. Given cros_ec sensors type is non wake up, this patch adds prepare and complete callbacks to set 1s sampling period just before suspend. This ensures the sensor hub will not be a source of interrupt during the suspend process. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>