summaryrefslogtreecommitdiff
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
* drivers: iio: gyro: remove duplicate includesPravin Shedge2018-01-081-1/+0
| | | | | | | | | These duplicate includes have been found with scripts/checkincludes.pl but they have been removed manually to avoid removing false positives. Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: dac: mcp4725: Remove unneeded conversions to boolAndrew F. Davis2018-01-081-1/+1
| | | | | | | | Found with scripts/coccinelle/misc/boolconv.cocci. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: stm32: Adopt SPDX identifierBenjamin Gaignard2018-01-089-85/+9
| | | | | | | | | | Add SPDX identifier in stm32's files in IIO directory Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com> Acked-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: light: make a couple of config structures staticColin Ian King2018-01-082-2/+2
| | | | | | | | | | | | | | | | Structures st_uvis25_i2c_regmap_config and st_uvis25_spi_regmap_config are local to the source and do not need to be in global scope, so make them both static. Cleans up sparse warnings: warning: symbol 'st_uvis25_i2c_regmap_config' was not declared. Should it be static? warning: symbol 'st_uvis25_spi_regmap_config' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: buffer: Expose data availableMatt Fornero2018-01-081-0/+15
| | | | | | | | | | Add a sysfs attribute that exposes buffer data available to userspace. This attribute can be checked at runtime to determine the overall buffer fill level (across all allocated buffers). Signed-off-by: Matt Fornero <matt.fornero@mathworks.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: mma8452: replace license description with SPDX specifierMartin Kepplinger2018-01-081-3/+1
| | | | | | | | | | | | This replaces the custom license information text with the appropriate SPDX identifier. While the information here stays the same, it is easier to read. Signed-off-by: Martin Kepplinger <martink@posteo.de> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Harinath Nampally <harinath922@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: common: ssp_sensors: use ktime_get_real_ns() timestampsArnd Bergmann2018-01-081-4/+1
| | | | | | | | | | | | | | | | | | getnstimeofday() suffers from the overflow in y2038 on 32-bit architectures and requires a conversion into the nanosecond format that we want here. This changes ssp_parse_dataframe() to use ktime_get_real_ns() directly, which does not have that problem. An open question is what time base should be used here. Normally timestamps should use ktime_get_ns() or ktime_get_boot_ns() to read monotonic time instead of "real" time, which suffers from time jumps due to settimeofday() calls or leap seconds. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: dummy_evgen: modify the return value check for irq_sim_init()Bartosz Golaszewski2018-01-081-1/+1
| | | | | | | | | | | As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. This will be modified later - first, change the way users handle the return value of these routines. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge Linus's staging merge point into staging-nextGreg Kroah-Hartman2017-12-065-14/+55
|\ | | | | | | | | | | | | | | This resolves the merge issue pointed out by Stephen in drivers/iio/adc/meson_saradc.c. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * iio: health: max30102: Temperature should be in milli CelsiusPeter Meerwald-Stadler2017-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | As per ABI temperature should be in milli Celsius after scaling, not Celsius Note on stable cc. This driver is breaking the standard IIO ABI. (JC) Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: fix kernel-doc build errorsRandy Dunlap2017-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fix build errors in kernel-doc notation. Symbols that end in '_' have a special meaning, but adding a '*' makes them OK. ../drivers/iio/industrialio-core.c:635: ERROR: Unknown target name: "iio_val". ../drivers/iio/industrialio-core.c:642: ERROR: Unknown target name: "iio_val". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: meson-saradc: Meson8 and Meson8b do not have REG11 and REG13Martin Blumenstingl2017-12-021-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | The Meson GXBB and newer SoCs have a few more registers than the older Meson8 and Meson8b SoCs. Use a separate regmap config to limit the older SoCs to the DELTA_10 register. Fixes: 6c76ed31cd05 ("iio: adc: meson-saradc: add Meson8b SoC compatibility") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: meson-saradc: initialize the bandgap correctly on older SoCsMartin Blumenstingl2017-12-021-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson8 and Meson8b do not have the MESON_SAR_ADC_REG11 register. The bandgap setting for these SoCs is configured in the MESON_SAR_ADC_DELTA_10 register instead. Make the driver aware of this difference and use the correct bandgap register depending on the SoC. This has worked fine on Meson8 and Meson8b because the bootloader is already initializing the bandgap setting. Fixes: 6c76ed31cd05 ("iio: adc: meson-saradc: add Meson8b SoC compatibility") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: meson-saradc: fix the bit_idx of the adc_en clockMartin Blumenstingl2017-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson8 and Meson8b SoCs use the the SAR ADC gate clock provided by the MESON_SAR_ADC_REG3 register within the SAR ADC register area. According to the datasheet (and the existing MESON_SAR_ADC_REG3_CLK_EN definition) the gate is on bit 30. The fls() function returns the last set bit, which is "bit index + 1" (fls(MESON_SAR_ADC_REG3_CLK_EN) returns 31). Fix this by switching to __ffs() which returns the first set bit, which is bit 30 in our case. This off by one error results in the ADC not being usable on devices where the bootloader did not enable the clock. Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: proximity: sx9500: Assign interrupt from GpioIo()Andy Shevchenko2017-12-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 0f0796509c07 ("iio: remove gpio interrupt probing from drivers that use a single interrupt") removed custom IRQ assignment for the drivers which are enumerated via ACPI or OF. Unfortunately, some ACPI tables have IRQ line defined as GpioIo() resource and thus automatic IRQ allocation will fail. Partially revert the commit 0f0796509c07 to restore original behaviour. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: adc: cpcap: fix incorrect validationPan Bian2017-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function platform_get_irq_byname() returns a negative error code on failure, and a zero or positive number on success. However, in function cpcap_adc_probe(), positive IRQ numbers are also taken as error cases. Use "if (ddata->irq < 0)" instead of "if (!ddata->irq)" to validate the return value of platform_get_irq_byname(). Signed-off-by: Pan Bian <bianpan2016@163.com> Fixes: 25ec249632d50 ("iio: adc: cpcap: Add minimal support for CPCAP PMIC ADC") Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: Tony Lindgren <tony@atomide.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: Add macro to populate struct iio_map arrayLukas Wunner2017-12-021-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GPIO core provides a handy GPIO_LOOKUP() macro to populate a struct gpiod_lookup array without having to spell out attribute names (but still avoid breakage when attributes within the struct are rearranged or added). The axp288_adc.c driver uses a similar macro to populate a struct iio_map array. Make it available to others. Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: accel: bmc150: Add OF device ID tableJavier Martinez Canillas2017-12-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. The I2C device ID table entries have the .driver_data field set, but they are not used in the driver so weren't set in the OF device table entries. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: meson-saradc: remove irrelevant clock "sana"Xingyu Chen2017-12-021-20/+0
| | | | | | | | | | | | | | | | | | | | The "sana" clock is not used at SAR ADC module in Amlogic Meson SoC, it is irrelevant for the SAR ADC. Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com> Signed-off-by: Yixun Lan <yixun.lan@amlogic.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: accel: st_accel: remove redundant pointer pdataColin Ian King2017-12-021-5/+0
| | | | | | | | | | | | | | | | | | | | | | Pointer pdata is being assigned but it is never being used, hence it is redundant and can be removed. Cleans up clang warning: drivers/iio/accel/st_accel_core.c:952:3: warning: Value stored to 'pdata' is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio:accel:da280: Linx 820 Windows tablet has a da280 mapped via ACPILuke Ross2017-12-021-2/+29
| | | | | | | | | | | | | | | | This adds an ACPI table to the driver and the ACPI ID of the sensor on the tablet. Signed-off-by: Luke Ross <luke@lukeross.name> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: light: add support for UVIS25 sensorLorenzo Bianconi2017-12-026-0/+560
| | | | | | | | | | | | | | | | | | | | | | | | | | | | add support for STMicroelectronics UVIS25 uv sensor http://www.st.com/resource/en/datasheet/uvis25.pdf - continuos mode support - i2c support - spi support - trigger mode support - system PM support Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: aspeed: Deassert reset in probeJoel Stanley2017-12-021-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | The ASPEED SoC must deassert a reset in order to use the ADC peripheral. The device tree bindings are updated to document the resets phandle, and the example is updated to match what is expected for both the reset and clock phandle. Note that the bindings should have always had the reset controller, as the hardware is unusable without it. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Add MAX30105 supportPeter Meerwald-Stadler2017-12-021-14/+130
| | | | | | | | | | | | | | | | | | The Maxim MAX30105 part adds a third LED (green) and uses a multi-LED measuring mode producing three measurements Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Prepare for copying varying number of measurementsPeter Meerwald-Stadler2017-12-021-5/+10
| | | | | | | | | | | | | | | | | | Current code assumes always 2 measurements (6 bytes) have to be copied, prepare for more flexibility Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Move mode setting to buffer_postenablePeter Meerwald-Stadler2017-12-021-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the programming of the mode setting from init() to buffer_postenable() Split out a separate function to only update the power/shutdown bit This changes permits to more easily implement different modes of measurements in further patches Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Introduce indices for LED channelsPeter Meerwald-Stadler2017-12-021-3/+11
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Add power enable parameter to get_temp functionPeter Meerwald-Stadler2017-12-021-13/+23
| | | | | | | | | | | | | | | | | | Chip must not be in shutdown for reading temperature, so briefly leave shutdown if buffer is not already running Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Introduce intensity channel macroPeter Meerwald-Stadler2017-12-021-28/+16
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stalder <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Add check for part IDPeter Meerwald-Stadler2017-12-021-0/+18
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Check retval of powermode functionPeter Meerwald-Stadler2017-12-021-1/+4
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Fix mode config valuesPeter Meerwald-Stadler2017-12-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | Table 4 of the datasheet specifies the mode control, these are not individual bits; add multi LED mode Add multi-LED mode and fix MODE_MASK (3 bits wide, not 2) Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Remove inconsistent full stop in error messagePeter Meerwald-Stadler2017-12-021-1/+1
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: health: max30102: Fix missing newline in dev_errPeter Meerwald-Stadler2017-12-021-1/+1
| | | | | | | | | | | | Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: stm32: add support for differential channelsFabrice Gasnier2017-12-021-20/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STM32H7 ADC channels can be configured either as single ended or differential with 'st,adc-channels' or 'st,adc-diff-channels' (positive and negative input pair: <vinp vinn>, ...). Differential channels have different offset and scale, from spec: raw value = (full_scale / 2) * (1 + (vinp - vinn) / vref). Add offset attribute. Differential channels are selected by DIFSEL register. Negative inputs must be added to pre-selected channels as well (PCSEL). Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: stm32: remove const channel names definitionFabrice Gasnier2017-12-021-52/+14
| | | | | | | | | | | | | | | | | | Remove const array that defines channels. Build channels definition at probe time, when initializing channels (only for requested ones). This will ease adding differential channels support. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: ina2xx: Allow setting Shunt Voltage PGA gain and Bus Voltage rangeStefan Brüns2017-12-021-3/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reducing shunt and bus voltage range improves the accuracy, so allow altering the default settings. Both settings are exposed as gain values. While for the shunt voltage this is straightforward, the bus range settings of 32V (default) and 16V are mapped to gain values of 1 resp. 2, to provide a uniform API to userspace. As the gain settings are incorporated into the raw values by the sensor itself, adjusting of the scale attributes is not necessary. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: ina2xx: Use LSB specifier instead of divider in configStefan Brüns2017-12-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | While the config uses the physical value corresponding to the LSB for both the power and the bus voltage register, the shunt voltage is specified as parts of 1 mV. Use the LSB physical value for all registers. No functional change. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: ina2xx: Shift bus voltage register to mask flag bitsStefan Brüns2017-12-021-9/+17
| | | | | | | | | | | | | | | | | | | | | | Lower bits of the INA219/220 bus voltage register are conversion status flags, properly shift the value. When reading via IIO buffer, the value is passed on unaltered, shifting is the responsibility of the user. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: imu: inv_mpu6050: Remove duplicate NULL checkAndy Shevchenko2017-12-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: magnetometer: ak8975: Add another ACPI IDAndy Shevchenko2017-12-021-0/+1
| | | | | | | | | | | | | | Add new ACPI ID for ak9911 as had been found on prototype board. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: proximity: sx9500: Add another ACPI IDAndy Shevchenko2017-12-021-0/+1
| | | | | | | | | | | | | | Add new ACPI ID for sx9500 as had been found on prototype board. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: accel: mma8452: Rename config structs for readabilityHarinath Nampally2017-12-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | Rename structs holding event configuration registers to more appropriate names. This naming is consistent with the event config register names given in the mma845x and fxls8471 datasheets. Signed-off-by: Harinath Nampally <harinath922@gmail.com> Acked-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: accel: mma8452: Rename a struct for code readibilityHarinath Nampally2017-12-021-3/+3
| | | | | | | | | | | | | | | | | | | | Rename time step look up struct to generic name as the values in the look table are same for all the other events like pulse, transient etc. Signed-off-by: Harinath Nampally <harinath922@gmail.com> Acked-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: light: Add driver for IDT ZOPT2201 ambient light and UVB sensorPeter Meerwald-Stadler2017-12-023-0/+579
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver for 20-bit ALS and UV B sensor with I2C interface exposing the following API: in_uvindex_input in_illuminance_raw in_illuminance_scale in_illuminance_scale_available in_intensity_uv_raw in_intensity_uv_scale in_intensity_uv_scale_available integration_time integration_time_available Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: core: Mark expected switch fall-throughGustavo A. R. Silva2017-12-021-0/+1
| | | | | | | | | | | | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1397962 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: cros_ec: Remove unused variablesPaolo Cretaro2017-12-022-4/+0
| | | | | | | | | | | | | | | | | | | | Fix gcc warnings about variable 'ec_device' being set but not used in these files: common/cros_ec_sensors/cros_ec_sensors.c:194:25 light/cros_ec_light_prox.c:184:25 Signed-off-by: Paolo Cretaro <paolocretaro@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: at91-sama5d2_adc: ack DRDY irq in direct modeEugen Hristev2017-12-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | Need to acknowledge DRDY irq in direct mode/ software triggered mode. Otherwise, on the next conversion, overrun flag will be raised, which is not a correct state. This doesn't affect the functionality, but will generate possible incorrect overrun reports. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc: at91-sama5d2_adc: add support for DMAEugen Hristev2017-12-022-20/+434
| | | | | | | | | | | | | | | | | | | | | | | | | | Added support for DMA transfers. The implementation uses the user watermark to decide whether DMA will be used or not. For watermark 1, DMA will not be used. If watermark is bigger, DMA will be used. Sysfs attributes are created to indicate whether the DMA is used, with hwfifo_enabled, and the current DMA watermark is readable in hwfifo_watermark. Minimum and maximum values are in hwfifo_watermark_min and hwfifo_watermark_max. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: adc/accel: Fix up module licensesLinus Walleij2017-12-022-0/+7
|/ | | | | | | | | | | The module license checker complains about these two so just fix it up. They are both GPLv2, both written by me or using code I extracted while refactoring from the GPLv2 drivers. Cc: Randy Dunlap <rdunlap@infradead.org> Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>