summaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)Author
2017-04-10Merge 4.11-rc6 into staging-nextGreg Kroah-Hartman
We want the staging and iio fixes in here to handle merging easier. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-03Merge tag 'iio-for-4.12c' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Third set of new device support, cleanups and features for IIO in the 4.12 cycle Somewhat dominated in patch numbers of last of the outreachy application window related patches (they are still coming, despite window being closed which is good to see!) Good set of new drivers as well. New device support * ASPEED ADC - new driver * cpcap PMIC ADC - new driver * hid-humidity - driver for HID compatible humidity sensors. * ltc2497 ADC - new driver * mpu6050 - bring bindings up to date and add trivial support for 9250 * rockchip-saradc - update bindings to cover rk3328 * vl6180 light, proximity and time of flight sensor. - new driver Features * meson-saradc - add calibration Cleanup and minor fixes * ad5504 - constify attribute_group structure - drop casting of void * * ad7150 - replace some shifts of 1 by BIT macro usage * ad7152 - blank lines between function definitions * ad7280a - octal permissions. * ad7606 - replace use of core mlock mutex with a local lock * ad7746 - replace some shifts of 1 by BIT macro usage - function parameter alignment - drop some excessive brackets (introduced in last pull request) * ad7753 - white space cleanup * ad7754 - includes in alphabetical order and groupped appropriately. - change from missuse of internal mlock mutex to using the buffer lock to also protect values during frequency update. * ad779x - constify attribute_group structures * ad9832 - octal permissions * adis16060 - remove use of core mlock mutex in favour of adding a local _spi_write_then_read which can use the local buffer protection lock. - fix naming of above function. * adis16203 - remove locking during reads of calibbias that doesn't protect anything not protected elsewhere. * adis16209 - remove unnecessary braces in single statement if * adis16240 - remove unnecessary braces in single statement if * adt7136 - drop excess blank lines and put some in between functions. * ams-iaq - replace comma with semi colon. Not actual bug, just unusual syntax. * apds9960 - constify attribute group structure * as3935 - constify attribute group structure * bm1750 - constify attribute group structure * cros_ec - devm version of triggered buffer setup to simplify code. * exynos - drop casting of void * * hdc100x - constify attribute_group structure * hid-accel - fix wrong scale for newly introduced gravity sensor. * hts221 - drop casting of void * * hx711 - constify attribute_group structure * imx7d_adc - drop casting of void * * lm35333 - constify attribute_group structure * lsm6dsx - drop casting of void * - hold ODR configuration until enabling to avoid a race condition. * max1027 - drop casting of void * * max11100 - fix a comma where semicolon was intended (no actual bug, just odd) * max1363 - constify attribute_group structure * ms sensors - drop casting of void * * rockchip_saradc - drop casting of void * * sun4i-gpadc - fix missing dependency on THERMAL or presence of stubs (issue only introduced in pervious set) - drop casting of void * * tsl2x7x - fix wrong standard deviation calc. Note these aren't actually used for anything at the moment so bug didn't really matter. - constify attribute group structure. * vf610adc - drop casting of void * * vz89x - replace comma with semicolon. Not actual bug, just odd syntax. * zpa2326 - drop casting of void *
2017-04-02iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handlerLorenzo Bianconi
This patch allows to avoid a transitory that occurs when a given sensor has been already enabled (e.g. gyroscope) and the user is configuring the sample frequency of the other one (e.g. accelerometer). The transitory lasts until the accelerometer is enabled. During that time slice the gyroscope ODR is incorrectly modified as well. At the end of the transitory both sensors work at the right frequency. Fix it introducing st_lsm6dsx_check_odr() routine to check ODR consistency in write_raw handler in order to apply frequency configuration just in st_lsm6dsx_set_odr() Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: hid-sensor-attributes: Fix sensor property setting failure.Song Hongyan
When system bootup without get sensor property, set sensor property will be fail. If no get_feature operation done before set_feature, the sensor properties will all be the initialized value, which is not the same with sensor real properties. When set sensor property it will write back to sensor the changed perperty data combines with other sensor properties data, it is not right and may be dangerous. In order to get all sensor properties, choose to read one of the sensor properties(no matter read any sensor peroperty, driver will get all the peroperties and return the requested one). Fixes: 73c6768b710a ("iio: hid-sensors: Common attribute and trigger") Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: adc: sun4i: add THERMAL dependencyArnd Bergmann
With CONFIG_THERMAL=m and CONFIG_SUN4I_GPADC=y, we get a link error from calling devm_thermal_zone_of_sensor_register: drivers/iio/built-in.o: In function `sun4i_gpadc_probe': :(.text+0x1c284): undefined reference to `devm_thermal_zone_of_sensor_register' This adds a Kconfig dependency to ensure we can only have the ADC driver as built-in when this function is also built-in, or when we see the empty stub implementation. When the thermal code is a module, we can still build the adc driver as a module, too. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d1caa99055382 ("iio: adc: add support for Allwinner SoCs ADC") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: accel: hid-sensor-accel-3d: Fix duplicate scan index errorSrinivas Pandruvada
When both accel_3d and gravity sensor are present, iio_device_register() fails with "Duplicate scan index" error. The reason for this is setting of indio_dev->num_channels based on accel_3d channel for both gravity and accel-3d sensor. But number of channels are not same, so for gravity it is pointing to some invalid memory and getting scan_index to compare which may match. To fix this issue, set the indio_dev->num_channels correctly based on the sensor type. Fixes: 0e377f3b9ae9 ('iio: Add gravity sensor support') Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative valuesNikolaus Schulz
Fix formatting of negative values of type IIO_VAL_FRACTIONAL_LOG2 by switching from do_div(), which can't handle negative numbers, to div_s64_rem(). Also use shift_right for shifting, which is safe with negative values. Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio:adc: Driver for Linear Technology LTC2497 ADCMichael Hennerich
This patch adds support for the Analog Devices / Linear Technology LTC2497 ADCs. The LTC2497 is a 16-channel (eight differential), 16-bit, high precision, delta-sigma ADC with an automatic, differential, input current cancellation front end and a 2-wire, I2C interface. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: st_pressure: initialize lps22hb bootimeShrirang Bagul
This patch initializes the bootime in struct st_sensor_settings for lps22hb sensor. Without this, sensor channels read from sysfs always report stale values. Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio:imu:mpu6050 add explicit mpu9250 supportJonathan Cameron
The mpu9250 is a SIP containing an mpu6500 and an ak8975. If this was all there was too it there would be no need for explicit handling in the driver. Arguably the bindings would also only reflect the presence of an mpu6500 with the ak8975 hanging off it, as the kernel doesn't care that they are in one package. However, the WHOAMI value changes as well so best to add explicit support. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: pressure: zpa2326: Remove unnecessary cast on void pointersimran singhal
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointersimran singhal
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: humidity: hts221: Remove unnecessary cast on void pointersimran singhal
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: dac: ad5504: Remove unnecessary cast on void pointersimran singhal
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: common: ms_sensors: Remove unnecessary cast on void pointersimran singhal
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: adc: Remove unnecessary cast on void pointersimran singhal
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: light: lm3533-als: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; As the attrs field of iio_info structures is also constant, so these attribute_group structures can also be declared constant. Done manually. File size before: text data bss dec hex filename 5798 2376 0 8174 1fee drivers/iio/light/lm3533-als.o File size after: text data bss dec hex filename 5926 2248 0 8174 1fee drivers/iio/light/lm3533-als.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01iio: Aspeed ADCRick Altherr
Aspeed BMC SoCs include a 16 channel, 10-bit ADC. Low and high threshold interrupts are supported by the hardware but are not currently implemented. Signed-off-by: Rick Altherr <raltherr@google.com> Tested-by: Xo Wang <xow@google.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01iio: adc: hx711: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the attrs filed of iio_info structure. As the attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 3042 480 0 3522 dc2 drivers/iio/adc/hx711.o File size after: text data bss dec hex filename 3098 416 0 3514 dba drivers/iio/adc/hx711.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01iio: humidity: hdc100x: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the attrs filed of iio_info structure. As the attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 3459 488 0 3947 f6b drivers/iio/humidity/hdc100x.o File size after: text data bss dec hex filename 3507 424 0 3931 f5b drivers/iio/humidity/hdc100x.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01iio: light: apds9960: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the attrs filed of iio_info structure. As the attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 8503 488 0 8991 231f drivers/iio/light/apds9960.o File size after: text data bss dec hex filename 8567 424 0 8991 231f drivers/iio/light/apds9960.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01iio: light: bh1750: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the attrs filed of iio_info structure. As the attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 2276 352 0 2628 a44 drivers/iio/light/bh1750.o File size after: text data bss dec hex filename 2340 320 0 2660 a64 drivers/iio/light/bh1750.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01iio: proximity: as3935: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the attrs filed of iio_info structure. As the attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 4037 288 0 4325 10e5 drivers/iio/proximity/as3935.o File size after: text data bss dec hex filename 4101 256 0 4357 1105 drivers/iio/proximity/as3935.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-30iio: adc: cpcap: Add minimal support for CPCAP PMIC ADCTony Lindgren
On Motorola phones like droid 4 there is a custom CPCAP PMIC. This PMIC has ADCs that are used for battery charging and USB PHY VBUS and ID pin detection. Unfortunately the only documentation for this ADC seems to be the Motorola mapphone Linux kernel tree. I have tested that reading raw and scaled values works, but I have not used the timed sampling that the ADC seems to support. Let's add a minimal support for it so we can eventually provide IIO channels for the related battery charging and USB PHY drivers. Cc: devicetree@vger.kernel.org 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> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-30drivers: iio: chemical: replace comma with a semicolonArushi Singhal
Replace a comma between expression statements by a semicolon. This changes the semantics of the code, but given the current indentation appears to be what is intended. A simplified version of the Coccinelle semantic patch that performs this transformation is as follows: // <smpl> @r@ expression e1,e2; @@ e1 -, +; e2; // </smpl> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-30iio: adc: replace comma with a semicolonArushi Singhal
Replace a comma between expression statements by a semicolon. This changes the semantics of the code, but given the current indentation appears to be what is intended. A simplified version of the Coccinelle semantic patch that performs this transformation is as follows: // <smpl> @r@ expression e1,e2; @@ e1 -, +; e2; // </smpl> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-29iio: adc: ad799x: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 26051 464 0 26515 6793 drivers/iio/adc/ad799x.o File size after: text data bss dec hex filename 26115 400 0 26515 6793 drivers/iio/adc/ad799x.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-29iio: adc: max1363: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 36951 448 0 37399 9217 drivers/iio/adc/max1363.o File size after: text data bss dec hex filename 37015 384 0 37399 9217 drivers/iio/adc/max1363.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-29iio: dac: ad5504: constify attribute_group structuressimran singhal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 3046 360 0 3406 d4e drivers/iio/dac/ad5504.o File size after: text data bss dec hex filename 3110 296 0 3406 d4e drivers/iio/dac/ad5504.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-27Merge 4.11-rc4 into staging-nextGreg Kroah-Hartman
We need the IIO fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-25iio: bmg160: reset chip when probingQuentin Schulz
The gyroscope chip might need to be reset to be used. Without the chip being reset, the driver stopped at the first regmap_read (to get the CHIP_ID) and failed to probe. The datasheet of the gyroscope says that a minimum wait of 30ms after the reset has to be done. This patch has been checked on a BMX055 and the datasheet of the BMG160 and the BMI055 give the same reset register and bits. Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: hid: Add humidity sensor supportSong Hongyan
Environmental humidity sensor is a hid defined sensor, it shows raw humidity measurement of air. More information can be found in: http://www.usb.org/developers/hidpage/HUTRR39b.pdf According to IIO ABI definition, humidityrelative data output unit is milli percent. Add the unit convert from percent to milli percent. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: hid-sensor-attributes: Fix gravity sensor scale value not right issueSong Hongyan
Scale value include two parts: unit conversion and exponent conversion. Add gravity unit convert table to fix gravity sensor scale value not right issue. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio:light: Add support for STMicro VL6180 sensorManivannan Sadhasivam
This patch adds support for STMicro VL6180 - ALS, range and proximity sensor. Sensor is capable of measuring the light intensity as well as object distance using TOF (Time of Flight) technology. Signed-off-by: Manivannan Sadhasivam <manivannanece23@gmail.com> Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: cros_ec_sensors: Use devm to setup the triggered buffer.Enric Balletbo i Serra
Use resourced managed function devm_iio_triggered_buffer_setup to make error path simpler and be able to get rid of the remove function. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: cros_ec_sensors: Fix return value to get raw and calibbias data.Enric Balletbo i Serra
The cros_ec_sensors_read function must return the type of value on all cases. This was always true except for RAW and CALIBBIAS data which returned an error or 0. This patch just fixes the mistake I introduced when submitting the series. Fixes: commit c14dca07a31d (iio: cros_ec_sensors: add ChromeOS EC Contiguous Sensors driver) Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25iio: adc: meson-saradc: add calibrationHeiner Kallweit
This patch adds calibration for the Meson SAR ADC. Points 25% vref and 75% vref are used for calibration. It uses a simple linear calibration function: SCALE * val + BIAS Successfully tested on a Odroid C2. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-21iio: dac: Add support for ltc2632 DACsMaxime Roussin-Belanger
Add support for Linear Technology LTC2632 (SPI) family of· dual 12- 10-, and 8-bits output DACs. Signed-off-by: Maxime Roussin-Belanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: gyro: itg3200: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: accel: mma7660: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: pressure: mpl3115: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: accel: mma7455_i2c: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: magnetometer: mag3110: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: adc: ti-ads1015: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: dac: max5821: Set .of_match_table to OF device ID tableJavier Martinez Canillas
The driver has a OF device ID table but the struct i2c_driver .of_match_table field is not set. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: light: apds9960: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: accel: bma180: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: imu: inv_mpu6050: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: pressure: hp03: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19iio: light: tsl2563: Add OF device ID tableJavier Martinez Canillas
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. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>