summaryrefslogtreecommitdiffstats
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'hwmon-for-linus-v4.13-rc1' of ↵Linus Torvalds2017-07-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: - Add PMBus client driver for IR35221 - Add support for NCT6795D to nct6775 driver - Functional improvements to adt7475, aspeed-pwm-tacho, and ibmpowernv drivers - Minor fixes and cleanups in various drivers * tag 'hwmon-for-linus-v4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (22 commits) hwmon: (aspeed-pwm-tacho) Poll with short sleeps. hwmon: (aspeed-pwm-tacho) reduce fan_tach period hwmon: (ibmpowernv) Add current(A) sensor hwmon: (ibmpowernv) introduce a legacy_compatibles array hwmon: (pwm-fan) Switch to new atomic PWM API hwmon: (scpi) Fix the scale of SCP sensor readings hwmon: (aspeed-pwm-tacho) Enable both edge measurement. hwmon: (ibmpowernv) Add highest/lowest attributes to sensors hwmon: (pmbus) move header file out of I2C realm hwmon: (max6639) move header file out of I2C realm hwmon: (ltc4245) move header file out of I2C realm hwmon: (ds620) move header file out of I2C realm hwmon: (ads1015) move header file out of I2C realm hwmon: (adt7475) temperature smoothing hwmon: (adt7475) add high frequency support hwmon: (adt7475) fan stall prevention hwmon: (adt7475) replace find_nearest() with find_closest() hwmon: (pmbus) Add client driver for IR35221 hwmon: (nct6775) Add support for NCT6795D hwmon: (nct6775) Improve fan detection ...
| * hwmon: (ads1015) move header file out of I2C realmWolfram Sang2017-06-111-1/+1
| | | | | | | | | | | | | | | | include/linux/i2c is not for client devices. Move the header file to a more appropriate location. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* | Merge tag 'char-misc-4.13-rc1' of ↵Linus Torvalds2017-07-036-0/+545
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc updates from Greg KH: "Here is the "big" char/misc driver patchset for 4.13-rc1. Lots of stuff in here, a large thunderbolt update, w1 driver header reorg, the new mux driver subsystem, google firmware driver updates, and a raft of other smaller things. Full details in the shortlog. All of these have been in linux-next for a while with the only reported issue being a merge problem with this tree and the jc-docs tree in the w1 documentation area" * tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (147 commits) misc: apds990x: Use sysfs_match_string() helper mei: drop unreachable code in mei_start mei: validate the message header only in first fragment. DocBook: w1: Update W1 file locations and names in DocBook mux: adg792a: always require I2C support nvmem: rockchip-efuse: add support for rk322x-efuse nvmem: core: add locking to nvmem_find_cell nvmem: core: Call put_device() in nvmem_unregister() nvmem: core: fix leaks on registration errors nvmem: correct Broadcom OTP controller driver writes w1: Add subsystem kernel public interface drivers/fsi: Add module license to core driver drivers/fsi: Use asynchronous slave mode drivers/fsi: Add hub master support drivers/fsi: Add SCOM FSI client device driver drivers/fsi/gpio: Add tracepoints for GPIO master drivers/fsi: Add GPIO based FSI master drivers/fsi: Document FSI master sysfs files in ABI drivers/fsi: Add error handling for slave drivers/fsi: Add tracepoints for low-level operations ...
| * \ Merge 4.12-rc5 into char-misc-nextGreg Kroah-Hartman2017-06-127-35/+44
| |\ \ | | |/ | | | | | | | | | | | | We want the char/misc driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | iio: multiplexer: new iio category and iio-mux driverPeter Rosin2017-06-035-0/+485
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a multiplexer changes how an iio device behaves (for example by feeding different signals to an ADC), this driver can be used to create one virtual iio channel for each multiplexer state. Depends on the generic multiplexer subsystem. Cache any ext_info values from the parent iio channel, creating a private copy of the ext_info attributes for each multiplexer state/channel. Reviewed-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | iio: inkern: api for manipulating ext_info of iio channelsPeter Rosin2017-06-031-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the inkern api with functions for reading and writing ext_info of iio channels. Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | Merge tag 'iio-for-4.13b' of ↵Greg Kroah-Hartman2017-06-2626-415/+1585
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of IIO new device support, features and cleanups for the 4.13 cycle. A few reverts here. One was a general failure to notice a device was already supported by another driver. The second is due to a review comment pointing out that the original patch was a bad idea and would break existing systems. Reverts * bma180 - Revert addition of support for the BMA250E it is already supported by the bmc150-accel and better supported at that. Oops. * hi8435 - The fix for cleanup of the reset gpio stuff isn't a good way to go. It breaks systems where an inverting level convertor is used. The right fix is to make the original devicetree correct - even if it involves patching the devicetree in kernel. New Device Support * stm32-adc - STM32H7 support and bindings. Features * core - add a hardware triggered operating mode for systems in which the actual trigger is never seen by the kernel. This is typically only used when a device 'can' use other triggers, but if a particular magic one is enabled the interrupt is effectively handled in hardware and we never see it. * st-lsm6dsx - support active low interrupts. * stm32-adc - Make the core adc clock optional as not all hardware supported requires it. - Make the bus clock optional in the per instance driver as it may be shared by all instances of the ADC and is handled by the core. - Rework to have a data structure representing the device type specific elements. * stm32-trigger (and counter) - Use the INDIO_HARDWARE_TRIGGERED_MODE where appropriate. - Add an attribute to configure device modes for quadrature counting etc. Clean ups and minor fixes * IIO core. - use __sysfs_match_string() helper rather than open coding the same. * ad7791 - use sysfs_match_string() helper rather than open coding the same. * aspeed-adc - handle return value of clk_prepare_enable * cpcap - Fix default register values and ensure the battery thermistor is enabled correctly. - Fix the reported die temperature where we can - docs are lacking. - Remove the hung interrupt quirk as no longer happens due to fix in the mfd driver. * hi8435 - Remove &s from hi8435_info definition as unneeded and inconsistent. * hid-sensor-trgger - Add kconfig depends on IIO_BUFFER (fixes patch in previous series) * ina2xx - Make the use of iio_info_mask* elements consistent for all channels. This doesn't have any visible effect, but acts as clear documentation of which channels various resulting attributes apply to. * lpc32xx - handle the return value of clk_prepare_enable. * meson-saradc - NULL instead of 0 for pointer. * mma9551 - use NULL for GPIO connection ID to aid implementation fo ACPI support. Here the connection ID doesn't actually tell us anything and it is much easier to deal with the driver if it's not there. * mpu6050 - Fix lock issues through use of a local mux. - Replace sprintf with scnprintf as appropriate. - Check whoami against all known values. This allows for a small number of boards where we are really fishing for the part not being present at all. It is unfortunately common to have undescribed changes to use newer chips. We paper over this but just emitting a warning for those cases as long as we know about. * mxs-lradc - Fix some non static warnings. * rcar-adc - Part of making the naming for this part consistent across the kernel. * st_accel - drop some spi_device_id entries for variants with no SPI support * st_magn - drop some spi_device_id entries for variants with no SPI support. * sx9500 - Use devm_gpiod_get instead of indexed value with an index of 0 on all occasions. * twl4030 - Drop unused twl4030_get_madc_conversion as callers removed now throughout kernel. - Unexport twl4030_madc_conversion() as no used only within this driver. - Drop twl4030_madc_user_params as not used now. - Drop twl4030_madc_request.func_cb as not used now. - Fold the twl4030-madc.h header into the driver as no longer used anywhere else in the kernel. * xilinx - Handle the return value of clk_prepare_enable
| * | | iio: imu: inv_mpu6050: test whoami first and against all known valuesJean-Baptiste Maneyrol2017-06-131-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPI bus is never generating error during transfer, so to check if a chip is correctly connected on a SPI bus we enforce whoami check to be correct. In this way we can assure SPI probe is failing if there is no chip connected. Note that this is really papering over boards that claim the device is there when it isn't. Not a bad thing to cope with, but not necessarily stable material. Fixes: cec0154556f8 ("iio: inv_mpu6050: Check WHO_AM_I register on probe") Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio hid-sensor-trigger: add Kconfig depends on IIO_BUFFERAlexander Wuerstlein2017-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building a kernel with my configuration failed with: > drivers/built-in.o: In function `hid_sensor_setup_batch_mode': staging/drivers/iio/common/hid-sensors/hid-sensor-trigger.c:104: undefined reference to `iio_buffer_set_attrs' which is fixed by this patch. Signed-off-by: Alexander Wuerstlein <arw@arw.name> Fixes: 138bc7969c24 ("iio: hid-sensor-hub: Implement batch mode") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: accel: mma9551: use NULL for GPIO connection IDAndy Shevchenko2017-06-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While using GPIO library API we might get into troubles in the future, because we can't rely on label name in the driver since vendor firmware might provide any GPIO pin there, e.g. "reset", and even mark it in _DSD (in which case the request will fail). To avoid inconsistency and potential issues we have two options: a) generate GPIO ACPI mapping table and supply it via acpi_dev_add_driver_gpios(), or b) just pass NULL as connection ID. The b) approach is much simpler and would work since the driver relies on GPIO indices only. Moreover, the _CRS fallback mechanism, when requesting GPIO, is going to be stricter, and supplying non-NULL connection ID when neither _DSD, nor GPIO ACPI mapping is present, will make request fail. See https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=ed7fcf1ed5ea4ea01243995ae085757a77cf0f3e for more background. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: make stm32 trigger driver use INDIO_HARDWARE_TRIGGERED modeBenjamin Gaignard2017-06-111-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add validate function to be use to use the correct trigger. Add an attribute to configure device mode like for quadrature and enable modes Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: add hardware triggered operating modeBenjamin Gaignard2017-06-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices, like stm32 timer, could be triggered by hardware events which are not buffer or software events. However it could be necessary to validate the triggers like it is done for buffer or event triggered modes. This patch add a new INDIO_HARDWARE_TRIGGERED operating mode for this kind of devices and allow this mode to register trigger consumer. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: Aspeed ADC - Handle return value of clk_prepare_enableArvind Yadav2017-06-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Rick Altherr <raltherr@google.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | Revert "iio: accel: bma180: Add support for BMA250E"Hans de Goede2017-06-111-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f1320b09517bceb261fed887fe261d6cbab2094e. The BMA250E is already handled by the bmc150-accel-i2c driver, which supports the "E" variants of the BMA??? accelerometers better then the bma180 driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | Revert "iio: accel: bma180: Add ACPI enumeration support for BMA250E"Hans de Goede2017-06-111-19/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5333e88661f2079d5ca8b94690ac920976300de3. The BMA250E is already handled by the bmc150-accel-i2c driver, which supports the "E" variants of the BMA??? accelerometers better then the bma180 driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: magnetometer: st_magn_spi: fix spi_device_id tableLorenzo Bianconi2017-06-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove LSM303DLHC, LSM303DLM from st_magn_id_table since LSM303DL series does not support spi interface Fixes: 872e79add756 (iio: magn: Add STMicroelectronics magn driver) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: accel: st_accel_spi: fix spi_device_id tableLorenzo Bianconi2017-06-111-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove LSM303DL, LSM303DLM, LSM303DLH, LSM303DLHC from st_accel_id_table since LSM303DL series does not support spi interface Fixes: d62511689de5 (iio: accel: Add STMicroelectronics accel driver) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: imu: inv_mpu6050: replace sprintf with scnprintfJean-Baptiste Maneyrol2017-06-111-1/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: imu: inv_mpu6050: fix lock issues by using our own mutexJean-Baptiste Maneyrol2017-06-115-74/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several locks issues when using buffer and direct polling data at the same time. Use our own mutex for managing locking and block simultaneous use of buffer and direct polling by using iio_device_{claim/release}_direct_mode. This makes chip_config enable bit obsolete, so delete it. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: imu: st_lsm6dsx: support active-low interruptsLorenzo Bianconi2017-06-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for active low interrupts (IRQF_TRIGGER_LOW and IRQF_TRIGGER_FALLING). Configure the device as active high or low according to the requested irq line. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: ad7791: Use sysfs_match_string() helperAndy Shevchenko2017-06-111-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sysfs_match_string() helper instead of open coded variant. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: core: Use __sysfs_match_string() helperAndy Shevchenko2017-06-111-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use __sysfs_match_string() helper instead of open coded variant. Cc: Jonathan Cameron <jic23@kernel.org> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: proximity: sx9500: Use devm_gpiod_get()Andy Shevchenko2017-06-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since index is always 0 replace devm_gpiod_get_index() by devm_gpiod_get(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: twl4030: Fold twl4030-madc.h into driverSebastian Reichel2017-06-111-1/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | twl4030-madc.h is no longer used by anything outside of the iio driver, so it can be merged into the driver. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: twl4030: Remove twl4030_madc_request.func_cbSebastian Reichel2017-06-111-70/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This functionality is not used by the IIO subsystem. Due to removal of legacy API it can also be removed. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: twl4030: Unexport twl4030_madc_conversion()Sebastian Reichel2017-06-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All madc users have been converted to IIO API, so drop the legacy API. The function is still used inside of the driver. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: twl4030: Drop twl4030_get_madc_conversion()Sebastian Reichel2017-06-111-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop legacy twl4030_get_madc_conversion() method. It has been used by drivers to get madc data before it conversion to IIO API. There are no users in the mainline kernel anymore. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: stm32: add support for STM32H7Fabrice Gasnier2017-06-113-4/+701
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for STM32H7 Analog to Digital Converter. It has up to 20 external channels, resolution ranges from 8 to 16bits. Either bus or asynchronous adc clock may be used. Add registers & bitfields definition. Also add new configuration options to enter/exit powerdown and perform self-calibration. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: stm32: make per instance bus clock optionalFabrice Gasnier2017-06-111-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STM32F4 requires one clock per ADC instance for register access. But, newer version of ADC hardware block have common bus clock for all instances (per instance driver isn't responsible for getting it). So, make it optional by default. Still, enforce it's required on STM32F4. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: stm32: introduce compatible data cfgFabrice Gasnier2017-06-112-59/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare support for stm32h7 adc variant by introducing compatible configuration data. Move STM32F4 specific stuff to compatible data structure: - registers & bit fields - input channels data - start/stop procedures - trigger definitions Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: stm32: make core adc clock optional by defaultFabrice Gasnier2017-06-111-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analog clock input is mandatory on stm32f4. But newer version of ADC hardware block allow to select either bus clock or asynchronous clock, for analog circuitry. So, make it optional by default, but enforce clk presence on stm32f4. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: Fix integration time/averaging for INA219/220Stefan Brüns2017-06-031-22/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INA226/230/231 has integration times per voltage channel and common averaging setting for both channels, while the INA219/220 only has a combined integration time/averaging setting per channel. Only expose the averaging attribute for the INA226, and expose the correct integration times for the INA219. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: meson-saradc: use NULL instead of 0 for pointerPaolo Cretaro2017-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix sparse warning: Using plain integer as NULL pointer Signed-off-by: Paolo Cretaro <paolocretaro@gmail.com> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio:adc:lpc32xx Handle return value of clk_prepare_enableArvind Yadav2017-06-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: mxs-lradc: fix non-static symbol warningsPaolo Cretaro2017-06-031-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix sparse warning "symbol foo was not declared. Should it be static?" for the following symbols: mx23_lradc_adc_irq_names mx28_lradc_adc_irq_names iio_dev_attr_in_voltage0_scale_available iio_dev_attr_in_voltage1_scale_available iio_dev_attr_in_voltage2_scale_available iio_dev_attr_in_voltage3_scale_available iio_dev_attr_in_voltage4_scale_available iio_dev_attr_in_voltage5_scale_available iio_dev_attr_in_voltage6_scale_available iio_dev_attr_in_voltage7_scale_available iio_dev_attr_in_voltage10_scale_available iio_dev_attr_in_voltage11_scale_available iio_dev_attr_in_voltage12_scale_available iio_dev_attr_in_voltage13_scale_available iio_dev_attr_in_voltage14_scale_available iio_dev_attr_in_voltage15_scale_available Signed-off-by: Paolo Cretaro <paolocretaro@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | Revert "iio: hi8435: cleanup reset gpio"Jonathan Cameron2017-06-031-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 61305664a542f874283f74bf0b27ddb31f5045d7. This commit was applied prematurely and will break some existing situations where the signal is inverted as part of voltage level conversions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: xilinx: Handle return value of clk_prepare_enableArvind Yadav2017-06-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: ina2xx: Make use of attribute flags consistent on all channelsStefan Brüns2017-06-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flags for shared channel attributes should be set on all channels of a channel set. I.e. SAMP_FREQUENCY and OVERSAMPLING_RATIO are set on the in_voltage{0,1} channels, thus should be set on in_power, in_current. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: hi8435: remote ampersands from hi8435_info definitionNikita Yushchenko2017-06-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C syntax allows apersands when initializing structures fields with function pointers, but in Linux sources ampersands are normally not used in thix context. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: cpcap: Remove hung interrupt quirkTony Lindgren2017-06-031-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is no longer needed as the real problem was interrupt flags not getting passed properly from device tree to the cpcap-core.c mfd driver. This got fixed with commit ac89473213c6 ("mfd: cpcap: Fix interrupt to use level interrupt") So let's remove ADC interrupt specific the quirk. Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Reviewed-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: cpcap: Fix die temperatureTony Lindgren2017-06-031-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that "MC13783 Power Management and Audio Ciruit User's Guide" MC1378UG.pdf documents several similar components as in the CPCAP PMIC. Chapter "9.5.5 Die Temperature and UID" says that the die temperature value is 282 at 25C with LSB of -1.14C. Converting CPCAP PMIC channel3 values with following seems to produce values that make sense for a PMIC die: temperature = 25000 + ((regval - 282) * 114) As we don't have any other documentation, let's assume the die temperature is unconfigured in the Motorola mapphone Linux kernel and the current temperature conversion table should be only used for the battery thermistor and not for the die temperature. Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | iio: adc: cpcap: Fix default register values and battery temperatureTony Lindgren2017-06-031-8/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at the register dumps from Android kernel on droid 4, I noticed the values with the mainline kernel don't match. Let's fix this by initializing the ADC registers to what Android does. For getting correct values from the battery thermistor, we need to toggle the CPCAP_BIT_THERMBIAS_EN when measuring battery temperature to get correct battery temperatures. And looks like we also need to wait a little bit before reading the battery temperature as otherwise the results are inaccurate. Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | | Merge 4.12-rc6 into staging-nextGreg Kroah-Hartman2017-06-206-7/+48
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | | iio: buffer-dmaengine: Add missing header buffer_impl.hPhil Reid2017-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add buffer_impl.h as buffer.h was split into interface for using and for internals. Without this industrialio-buffer-dmaengine.c fails to compile. Fixes: commit 33dd94cb972175249258329c4aaffddcc82c2005 ("iio:buffer.h - split into buffer.h and buffer_impl.h") Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | | iio: buffer-dma: Add missing header buffer_impl.hPhil Reid2017-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add buffer_impl.h as buffer.h was split into interface for using and for internals. Without this industrialio-buffer-dma.c fails to compile. Fixes: commit 33dd94cb972175249258329c4aaffddcc82c2005 ("iio:buffer.h - split into buffer.h and buffer_impl.h") Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | | iio: adc: meson-saradc: fix potential crash in meson_sar_adc_clear_fifoMartin Blumenstingl2017-06-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | meson_sar_adc_clear_fifo passes a 0 as value-pointer to regmap_read(). In case of the meson-saradc driver this ends up in regmap_mmio_read(), where the value-pointer is de-referenced unconditionally to assign the value which was read. Fix this by passing an actual pointer, even though all we want to do is to discard the value. As a side-effect this fixes a sparse warning ("Using plain integer as NULL pointer") as reported by Paolo Cretaro. Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs") Reported-by: Paolo Cretaro <paolocretaro@gmail.com> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | | iio: adc: mxs-lradc: Fix return value check in mxs_lradc_adc_probe()Wei Yongjun2017-06-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Also add NULL test for iores. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * | | | iio: imu: inv_mpu6050: add accel lpf setting for chip >= MPU6500Jean-Baptiste Maneyrol2017-06-032-3/+39
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting from MPU6500, accelerometer dlpf is set in a separate register named ACCEL_CONFIG_2. Add this new register in the map and set it for the corresponding chips. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | | | Merge 4.12-rc5 into staging-nextGreg Kroah-Hartman2017-06-127-35/+44
|\ \ \ \ | |/ / / | | / / | |/ / |/| | | | | We want the IIO fixes and other staging driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Merge tag 'iio-fixes-for-4.12a' of ↵Greg Kroah-Hartman2017-05-227-35/+44
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: First set of IIO fixes in the 4.12 cycle. Matt finally set up the lightning storm he needed to test the as3935. * core - Fix a null pointer deference in iio_trigger_write_current when changing from a non existent trigger to another non existent trigger. * a3935 - Recalibrate the RCO after resume. - Fix interrupt mask so that we actually get some interrupts. - Use iio_trigger_poll_chained as we aren't in interrupt context. * am335x - Fix wrong allocation size provided for private data to iio_device_alloc. * bcm_iproc - Swapped primary and secondary isr handlers. * ltr501 - Fix swapped als/ps register fields when enabling interrupts * max9611 - Wrong scale factor for the shunt_resistor attribute. * sun4-gpadc - Module autoloading fixes by adding the device table declarations. - Fix parent device being used in devm functions.
OpenPOWER on IntegriCloud