summaryrefslogtreecommitdiff
path: root/drivers/iio
Commit message (Collapse)AuthorAge
* iio: chemical: ccs811: Fix output of IIO_CONCENTRATION channelsNarcisa Ana Maria Vasile2018-01-08
| | | | | | | | | | | | | | | | | | | | | in_concentration_raw should report, according to sysfs-bus-iio documentation, a "Raw (unscaled no offset etc.) percentage reading of a substance." Modify scale to convert from ppm/ppb to percentage: 1 ppm = 0.0001% 1 ppb = 0.0000001% There is no offset needed to convert the ppm/ppb to percentage, so remove offset from IIO_CONCENTRATION (IIO_MOD_CO2) channel. Cc'd stable to reduce chance of userspace breakage in the long run as we fix this wrong bit of ABI usage. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Cc: <Stable@vger.kernel.org> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* imu:adis16480: fix debugfs_simple_attr.cocci warningsVenkat Prashanth B U2018-01-08
| | | | | | | | | | | | | | | | Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* gyro:adis16136: fix debugfs_simple_attr.cocci warningsVenkat Prashanth B U2018-01-08
| | | | | | | | | | | | | | | | Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: imu: st_lsm6dsx: remove st_lsm6dsx_write_with_mask() declarationLorenzo Bianconi2018-01-08
| | | | | | | | | Remove st_lsm6dsx_write_with_mask() declaration since it has been removed in commit 6674bef628e6 ("iio: imu: st_lsm6dsx: add regmap API support") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: imu: st_lsm6dsx: pre-allocate read buffer at bootstrapLorenzo Bianconi2018-01-08
| | | | | | | | | | | | | | | | Allocate device read buffer at bootstrap and do not put it on the stack since it is pretty big (~200B) and its size will increase adding support to device hw timestamp. Moreover this patch fixes following sparse warnings: drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:250:17: warning: Variable length array is used. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:283:55: error: cannot size expression Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: stm32: fix scan of multiple channels with DMAFabrice Gasnier2018-01-08
| | | | | | | | | | | | | | | By default, watermark is set to '1'. Watermark is used to fine tune cyclic dma buffer period. In case watermark is left untouched (e.g. 1) and several channels are being scanned, buffer period is wrongly set (e.g. to 1 sample). As a consequence, data is never pushed to upper layer. Fix buffer period size, by taking scan channels number into account. Fixes: 2763ea0585c9 ("iio: adc: stm32: add optional dma support") Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Drivers:iio:adc:ti_am335x_adc remove comparison to boolVenkat Prashanth B U2018-01-08
| | | | | | | | | | | This is the patch to the file ti_am335x_adc.c which fixes the following coccinelle warning: WARNING: Comparison to bool Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: common: ssp_sensors: account for const type of of_device_id.dataJulia Lawall2018-01-08
| | | | | | | | | | | | | | | | This driver creates a number of const structures that it stores in the data field of an of_device_id array. Add const to the declaration of the location that receives a value from the data field to ensure that the compiler will continue to check that the value is not modified and remove the const-dropping cast on the access to the data field. Done using Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: imu: st_lsm6dsx: add regmap API supportLorenzo Bianconi2018-01-08
| | | | | | | | | | | | | Introduce regmap API support to access to i2c/spi bus instead of using a custom support. Set max bulk read to (32 / SAMPLE_SIZE) * SAMPLE_SIZE since spi_write_then_read() used in regmap_spi indicates that is the max buffer length to use in order to avoid a kmalloc for each bus access. Remove lock mutex since concurrency is already managed by regmap API Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: imu: st_lsm6dsx: introduce conf_lock mutexLorenzo Bianconi2018-01-08
| | | | | | | | | Add conf_lock mutex to prevent concurrent FIFO configuration update Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()Lorenzo Bianconi2018-01-08
| | | | | | | | | | Apply le16_to_cpu() to data read from the sensor in order to take into account architecture endianness Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: humidity: hts221: move common code in hts221_coreLorenzo Bianconi2018-01-08
| | | | | | | | Move duplicated i2c/spi probe code in hts221_probe() Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio:pressure:bmp280: Read calibration data in probeStefan Tatschner2018-01-08
| | | | | | | | | | | | | | | | | | This patch affects BME280 and BMP280. The readout of the calibration data is moved to the probe function. Each sensor data access triggered reading the full calibration data before this patch. According to the datasheet, Section 4.4.2., the calibration data is stored in non-volatile memory. Since the calibration data does not change, and cannot be changed by the user, we can reduce bus traffic by reading the calibration data once. Additionally, proper organization of the data types enables removing some odd casts in the compensation formulas. Signed-off-by: Stefan Tatschner <stefan.tatschner@gmail.com> Tested-by: Andreas Klinger <ak@it-klinger.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Actually align the loop with the conversion ready flagStefan Brüns2018-01-08
| | | | | | | | | | | | | | | | | | | | | | Currently, the registers are read out once per conversion interval. If the reading is delayed as the conversion has not yet finished, this extra time is treated as being part of the readout, although it should delay the start of the poll interval. This results in the interval starting slightly earlier in each iteration, until all time between reads is spent polling the status registers instead of sleeping. To fix this, the delay has to account for the state of the conversion ready flag. Whenever the conversion is already finished, schedule the next read on the regular interval, otherwise schedule it one interval after the flag bit has been set. Split the work function in two functions, one for the status poll and one for reading the values, to be able to note down the time when the flag bit is raised. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Align timestamp with conversion ready flagStefan Brüns2018-01-08
| | | | | | | | | As the timestamp is no longer (ab-)used to measure the function run time, it can be taken at the correct time, i.e. when the conversion has finished. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Use a monotonic clock for delay calculationStefan Brüns2018-01-08
| | | | | | | | | | | | | | | The iio timestamp clock is user selectable and may be non-monotonic. Also, only part of the acquisition time is measured, thus the delay was longer than intended. Use a monotonic timestamp to track the time for the next poll iteration. The timestamp is advanced by the sampling interval each iteration. In case the conversion overrruns the register readout (i.e. fast sampling combined with a slow bus), one or multiple samples will be dropped. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Make calibration register value fixedMaciej Purski2018-01-08
| | | | | | | | | | | | | | | | | | | | | | | | Calibration register is used for calculating current register in hardware according to datasheet: current = shunt_volt * calib_register / 2048 (ina 226) current = shunt_volt * calib_register / 4096 (ina 219) Fix calib_register value to 2048 for ina226 and 4096 for ina 219 in order to avoid truncation error and provide best precision allowed by shunt_voltage measurement. Make current scale value follow changes of shunt_resistor from sysfs as calib_register value is now fixed. Power_lsb value should also follow shunt_resistor changes as stated in datasheet: power_lsb = 25 * current_lsb (ina 226) power_lsb = 20 * current_lsb (ina 219) This is a part of the patchset: https://lkml.org/lkml/2017/11/22/394 Signed-off-by: Maciej Purski <m.purski@samsung.com> Reviewed-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Drivers: iio:adc: fix brace coding style issue in at91_adc.cVenkat Prashanth B U2018-01-08
| | | | | | | | | This is a patch to the at91_adc.c file that fixes up a brace warning found by the checkpatch.pl tool Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: hx711: fix bug in reset functionalityAndreas Klinger2018-01-08
| | | | | | | | | | | | | | | | | | Return value in hx711_reset() should indicate status of dout otherwise the calling function is reporting an error as false positive If there are two reads too close to each other, then the second one will never succeed. This happens especially when using buffered mode with both channels enabled. When changing the channel on every trigger event the former 100 ms are not enough for waiting until the device indicates normal mode. Wait up to 1 second until the device turns into normal mode. Signed-off-by: Andreas Klinger <ak@it-klinger.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: hx711: add triggered buffer supportAndreas Klinger2018-01-08
| | | | | | | | | | | | | | | | Add buffer to device data struct and add trigger function Data format is quite simple: voltage - channel 0 32 Bit voltage - channel 1 32 Bit timestamp 64 Bit Using both channels at the same time is working quite slow because of changing the channel which needs a dummy read. Signed-off-by: Andreas Klinger <ak@it-klinger.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Do not udelay for several secondsStefan Brüns2018-01-08
| | | | | | | | | The conversion time can be up to 16 seconds (8 ms per channel, 2 channels, 1024 times averaging). Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Remove unneeded dummy read to clear CNVR flagStefan Brüns2018-01-08
| | | | | | | | | | | | | Although the datasheet states the CNVR flag is cleared by reading the BUS_VOLTAGE register, it is actually cleared by reading any of the voltage/current/power registers. The behaviour has been confirmed by TI support: http://e2e.ti.com/support/amplifiers/current-shunt-monitors/f/931/p/647053/2378282 Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Clarify size requirement for data bufferStefan Brüns2018-01-08
| | | | | | | | | | The timestamp is inserted into the buffer after the sample data by iio_push_to_buffers_with_timestamp, document the space requirement for the timestamp. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: ina2xx: Remove bogus cast for data argumentStefan Brüns2018-01-08
| | | | | | | | | iio_push_to_buffers_with_timestamp expects a void pointer, so the cast is both unnecessary and misleading. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: meson-saradc: program the channel muxes during initializationMartin Blumenstingl2018-01-08
| | | | | | | | | | | | | | | | | | | | | On some Meson8 devices the channel muxes are not programmed. This results in garbage values when trying to read channels that are not set up. Fix this by initializing the channel 0 and 1 muxes in MESON_SAR_ADC_CHAN_10_SW as well as the muxes for all other channels in MESON_SAR_ADC_AUX_SW based on what the vendor driver does (which is simply a 1:1 mapping of channel number and channel mux). This only showed up on Meson8 devices, because for GXBB and newer BL30 is taking care of initializing the channel muxes. This additionally fixes a typo in the MESON_SAR_ADC_AUX_SW_MUX_SEL_CHAN_MASK macro because the old definition assumed that the register fields were 2 bit wide, while they are actually 3 bit wide. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: adc: meson-saradc: fix the clock frequency on Meson8 and Meson8bMartin Blumenstingl2018-01-08
| | | | | | | | | | | | | | | | | | | GX SoCs use a 1.2 MHz ADC clock, while the older SoCs use a 1.14 MHz clock. A comment in the driver from Amlogic's GPL kernel says that it's running at 1.28 MHz. However, it's actually programming a divider of 20 + 1. With a XTAL clock of 24 MHz this results in a frequency of 1.14 MHz. (their calculation might be based on a 27 MHz XTAL clock, but this is not what we have on the Meson8 and Meson8b SoCs). The ADC was still working with the 1.2MHz clock. In my own tests I did not see a difference between 1.2 and 1.14 MHz (regardless of the clock frequency used, the ADC results were identical). Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers: iio: gyro: remove duplicate includesPravin Shedge2018-01-08
| | | | | | | | | 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-08
| | | | | | | | 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-08
| | | | | | | | | | 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-08
| | | | | | | | | | | | | | | | 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-08
| | | | | | | | | | 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-08
| | | | | | | | | | | | 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-08
| | | | | | | | | | | | | | | | | | 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-08
| | | | | | | | | | | 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-06
|\ | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | 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>