summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure
AgeCommit message (Collapse)Author
2016-07-04iio:st_pressure:lps22hb: temperature supportGregor Boirie
Implement lps22hb temperature sampling channel. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04iio:st_pressure:lps22hb: open drain supportGregor Boirie
Add support for open drain interrupt line. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04iio:st_pressure: temperature triggered bufferingGregor Boirie
Enable support for triggered buffering of temperature samples. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04iio:st_pressure: document sampling gainsGregor Boirie
Details scaling factors and offsets applied to raw temperature and pressure samples. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04iio:st_pressure: align storagebits on power of 2Gregor Boirie
Sampled pressure data are 24 bits long and should be stored in a 32 bits word. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: pressure: bmp280: read calibration data onceLinus Walleij
The calibration data is described as coming from an E2PROM and that means it does not change. Just read it once at probe time and store it in the device state container. Also toss the calibration data into the entropy pool since it is device unique. Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: pressure: bmp280: add power managementLinus Walleij
The PM280 has an internal standby-mode, but to really save power we should shut the sensor down and disconnect the power. With the proper .pm hooks we can enable both runtime and system power management of the sensor. We use the *force callbacks from the system PM hooks. When the sensor comes back we always reconfigure it to make sure it is ready to roll as expected. Cc: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: pressure: bmp280: add support for BMP085 EOC interruptLinus Walleij
The first version of this sensor, BMP085, supports sending an End-of-Conversion (EOC) interrupt. Add code to support this using a completion, in a similar vein as drivers/misc/bmp085.c does. Make sure to check that we are given a rising edge, because the EOC line goes from low-to-high when the conversion is ready. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: pressure: bmp280: add SPI interface driverLinus Walleij
This patch mimics the SPI functionality found in the misc driver in drivers/misc/bh085-spi.c to make it possible to reuse the existing BMP280/BMP180/BMP085 driver with all clients of the other driver. The adoption is straight-forward since like the other driver, it is a simple matter of using regmap. This driver is also so obviously inspired/copied from the old misc driver in drivers/misc/bmp085.c that I just took the liberty to add in the authors of the other drivers + self in the core driver file. The MISC driver also supports a variant named "BMP181" so include that here to be complete in comparison to the old driver. The bus mapping code for SPI was written by Akinobu Mita. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Tested-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: pressure: bmp280: split off an I2C Kconfig entryLinus Walleij
This creates a separate BMP280_I2C Kconfig entry that gets selected by BMP280 for I2C transport. As we currently only support I2C transport there is not much practical change other than getting a separate object file (or module) for the I2C driver part. The old Kconfig symbol BMP280 will still select the stuff we need so that oldconfig and old defconfigs works fine. Tested-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: pressure: bmp280: split driver in logical partsLinus Walleij
This splits the BMP280 driver in three logical parts: the core driver bmp280-core that only operated on a struct device * and a struct regmap *, the regmap driver bmp280-regmap that can be shared between I2C and other transports and the I2C module driver bmp280-i2c. Cleverly bake all functionality into a single object bmp280.o so that we still get the same module binary built for the device in the end, without any fuzz exporting symbols to the left and right. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: pressure: bmp280: support supply regulatorsLinus Walleij
The BMP085/BMP180/BMP280 is supplied with two power sources: VDDA (analog power) and VDDD (digital power). As these may come from regulators (as on the APQ8060 Dragonboard) we need the driver to attempt to fetch and enable these regulators. We FAIL if we cannot: boards should either define: - Proper regulators if present - Define fixed regulators if power is hardwired to the component - Rely on dummy regulators (will be present on all DT systems and any boardfile system that calls regulator_has_full_constraints(). Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-30iio: pressure: bmp280: add reset GPIO line handlingLinus Walleij
On the APQ8060 Dragonboard the reset line to the BMP085 pressure sensor is not deasserted on boot, so the driver needs to handle this. For a simple GPIO line supplied as a descriptor (from a board file, device tree or ACPI) this does the trick. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-30iio: pressure: bmp280: support device tree initializationLinus Walleij
This adds device tree support to the BMP085, BMP180 and BMP280 pressure sensors. Tested on the Qualcomm APQ8060 Dragonboard: iio:device1$ cat in_temp_input 26700 iio:device1$ cat in_pressure_input 99.185000000 Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-30iio:core: timestamping clock selection supportGregor Boirie
Adds a new per-device sysfs attribute "current_timestamp_clock" to allow userspace to select a particular POSIX clock for buffered samples and events timestamping. Following clocks, as listed in clock_gettime(2), are supported: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and CLOCK_TAI. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-29Merge tag 'iio-for-4.8b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second round of new iio device support, features and cleanups in the 4.8 cycle Firstly some contact detail updates: * NXP took over freescale. Update the mma8452 header to reflect this. * Martin Kepplinger email address change in mma8452 header. * Adriana Reus has changed email address. Update .mailmap. * Matt Ranostay has changed email address. Update .mailmap. New Device Support * max1363 - add the missing i2c_device_ids for a couple of parts so they can actually be used. * ms5867 - add device ids for ms5805 and ms5837 parts. New Features * ad5755 - DT support. This one was a bit controversial and under review for a long time. Still no one could come up with a better solution. * stx104 - add gpio support * ti-adc081c - Add ACPI device ID matching. Core changes * Refuse to register triggers with duplicate names. There is no way to distinguish between them so this makes no sense. A few drivers do not generate unique names for each instance of the device present. We can't fix this without changing ABI so leave them and wait for someone to actually take the rare step of two identical accelerometers on the same board. * buffer-dma - use ARRAY_SIZE in a few appropriate locations. Tools * Fix the fact that the --trigger-num option in generic_buffer didn't allow 0 which is perfectly valid in the ABI. Cleanups * as3935 - improve error reporting. - remove redundant zeroing of a field in iio_priv. * gp2ap020a00f - use the iio_device_claim_*_mode helpers rather than open coding locking around mode changes. * isl29125 - use the iio_device_claim_*_mode helpers rather than open coding locking. * lidar - use the iio_device_claim_*_mode helpers rather than open coding locking. * mma8452 - more detail in devices supported description in comments (addresses and similar) * sca3000 - add a missing error check. * tcs3414 - use the iio_device_claim_*_mode helpers rather than open coding locking. * tcs3472 - use the iio_device_claim_*_mode helpers rather than open coding locking.
2016-06-20Merge 4.7-rc4 into staging-nextGreg Kroah-Hartman
We want the fixes in here, and we can resolve a merge issue in drivers/iio/industrialio-trigger.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-11iio: ms5637 Add Measurement Specialties explicit MS5805 and MS5837 supportMarkezana, William
Signed-off-by: William Markezana <william.markezana@meas-spec.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio: st_sensors: switch to a threaded interruptLinus Walleij
commit 98ad8b41f58dff6b30713d7f09ae3834b8df7ded ("iio: st_sensors: verify interrupt event to status") caused a regression when reading ST sensors from a HRTimer trigger rather than the intrinsic interrupts: the HRTimer may trigger faster than the sensor provides new values, and as the check against new values available as a cause of the interrupt trigger was done in the poll function, this would bail out of the HRTimer interrupt with IRQ_NONE. So clearly we need to only check the new values available from the proper interrupt handler and not from the poll function, which should rather just read the raw values from the registers, put them into the buffer and be happy. To achieve this: switch the ST Sensors over to using a true threaded interrupt handler. In the interrupt thread, check if new values are available, else yield to the (potential) next device on the same interrupt line to check the registers. If the interrupt was ours, proceed to poll the values. Instead of relying on iio_trigger_generic_data_rdy_poll() as a top half to wake up the thread that polls the sensor for new data, have the thread call iio_trigger_poll_chained() after determining that is is the proper source of the interrupt. This is modelled on drivers/iio/accel/mma8452.c which is already using a properly threaded interrupt handler. In order to get the same precision in timestamps as previously, where samples would be timestamped in the poll function pf->timestamp when calling iio_trigger_generic_data_rdy_poll() we introduce a local timestamp in the sensor data, set it in the top half (fastpath) of the interrupt handler and provide that to the core when calling iio_push_to_buffers_with_timestamp(). Additionally: if the active scanmask is not set for the sensor no IRQs should be enabled and we need to bail out with IRQ_NONE. This can happen if spurious IRQs fire when installing the threaded interrupt handler. Tested with hard interrupt triggers on LIS331DL, then also tested with hrtimers on the same sensor by creating a 75Hz HRTimer and using it to poll the sensor. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Giuseppe Barba <giuseppe.barba@st.com> Cc: Denis Ciocca <denis.ciocca@st.com> Reported-by: Crestez Dan Leonard <cdleonard@gmail.com> Tested-by: Crestez Dan Leonard <cdleonard@gmail.com> Tested-by: Jonathan Cameron <jic23@kernel.org> Fixes: 97865fe41322 ("iio: st_sensors: verify interrupt event to status") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio:st_sensors: fix power regulator usageGregor Boirie
Ensure failure to enable power regulators is properly handled. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio:st_pressure: fix sampling gains (bring inline with ABI)Gregor Boirie
Temperature channels report scaled samples in Celsius although expected as milli degree Celsius in Documentation/ABI/testing/sysfs-bus-iio. Gains are not implemented at all for LPS001WP pressure and temperature channels. This patch ensures that proper offsets and scales are exposed to userpace for both pressure and temperature channels. Also fix a NULL pointer exception when userspace reads content of sysfs scale attribute when gains are not defined. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-29iio:st_pressure:initial lps22hb sensor supportGregor Boirie
Initial support for ST LPS22HB pressure sensor. Datasheet: http://www2.st.com/resource/en/datasheet/lps22hb.pdf Features: * pressure data and timestamping channels * sampling frequency selection * interrupt based trigger * over I2C or SPI Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: pressure: bmp280: add humidity supportMatt Ranostay
Enable humidity support for the BME280 part Signed-off-by: Matt Ranostay <matt.ranostay@intel.com> Acked-by: Vlad Dogaru <vlad.dogaru@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-21iio: Export I2C module alias informationJavier Martinez Canillas
The I2C drivers have an i2c_device_id array but that information isn't exported to the modules using the MODULE_DEVICE_TABLE() macro. So the modules autoloading won't work if the I2C device is registered using OF or legacy board files due missing alias information in the modules. The issue was found using Kieran Bingham's coccinelle semantic patch: https://lkml.org/lkml/2016/5/10/520 Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-05-14iio: pressure: bmp280: fix error message for wrong chip idAkinobu Mita
The bmp280 driver also supports BMP180 which has a different chip id with BMP280. The probe routine verifies that the device reports the correct chip id but the error message is confusing as if BMP280's chip id is always expected. Reported-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Matt Ranostay <mranostay@gmail.com> Cc: Vlad Dogaru <vlad.dogaru@intel.com> Cc: Christoph Mair <christoph.mair@gmail.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-25iio: pressure: bmp280: add ability to control oversampling rateAkinobu Mita
This adds ability to control the oversampling ratio of the temperature and pressure measurement for both bmp180 and bmp280. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Vlad Dogaru <vlad.dogaru@intel.com> Cc: Christoph Mair <christoph.mair@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-25iio: pressure: bmp280: add support for BMP180Akinobu Mita
This adds support for the BMP180 to the bmp280 iio driver. The BMP180 has already been supported by misc/bmp085 driver but it doesn't use iio framework. This change adds the kconfig dependency not to be selected both of them in order to avoid any issues. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Vlad Dogaru <vlad.dogaru@intel.com> Cc: Christoph Mair <christoph.mair@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-24iio: pressure: hp03: Add Hope RF HP03 sensor supportMarek Vasut
Add support for HopeRF pressure and temperature sensor. This device uses two fixed I2C addresses, one for storing calibration coefficients and another for accessing the ADC. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Matt Ranostay <mranostay@gmail.com> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-19iio: st_sensors: support open drain modeLinus Walleij
Some types of ST Sensors can be connected to the same IRQ line as other peripherals using open drain. Add a device tree binding and a sensor data property to flip the right bit in the interrupt control register to enable open drain mode on the INT line. If the line is set to be open drain, also tag on IRQF_SHARED to the IRQ flags when requesting the interrupt, as the whole point of using open drain interrupt lines is to share them with more than one peripheral (wire-or). Cc: devicetree@vger.kernel.org Cc: Giuseppe Barba <giuseppe.barba@st.com> Cc: Denis Ciocca <denis.ciocca@st.com> Acked-by: Rob Herring <rob@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-19iio: st_sensors: verify interrupt event to statusLinus Walleij
This makes all ST sensor drivers check that they actually have new data available for the requested channel(s) before claiming an IRQ, by reading the status register (which is conveniently the same for all ST sensors) and check that the channel has new data before proceeding to read it and fill the buffer. This way sensors can share an interrupt line: it can be flaged as shared and then the sensor that did not fire will return NO_IRQ, and the sensor that fired will handle the IRQ and return IRQ_HANDLED. Cc: Giuseppe Barba <giuseppe.barba@st.com> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-16iio: pressure: ms5611: use tab for indentionJonathan Cameron
This fixes the errors reported by checkpatch.pl: ERROR: code indent should use tabs where possible Signed-off-by: Slawomir Stepien <sst@poczta.fm> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-03hp206c: Initial support for reading sensor valuesCrestez Dan Leonard
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-20iio:pressure:ms5611: fix missing regulator_disableGregor Boirie
Ensure optional regulator is properly disabled when present. Fixes: 3145229f9191 ("iio:pressure:ms5611: power regulator support") Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-05iio:pressure:ms5611: oversampling rate supportGregor Boirie
Add support for setting and retrieving OverSampling Rate independently for each of the temperature and pressure channels. This allows userspace to fine tune hardware sampling process according to the following tradeoffs : * the higher the OSR, the finer the resolution ; * the higher the OSR, the lower the noise ; BUT: * the higher the OSR, the larger the drift ; * the higher the OSR, the longer the response time, i.e. less samples per unit of time. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-05iio:pressure:ms5611: complete DT supportGrégor Boirie
Add device-tree ID tables and document bindings. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-27iio: convert to common i2c_check_functionality() return valueMatt Ranostay
Previously most drivers that used a i2c_check_functionality() check condition required various error codes on failure. This patchset converts to a standard of -EOPNOTSUPP Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-24iio:pressure:ms5611: power regulator supportGrégor Boirie
Add support for an optional regulator which, if found into device-tree, will power on device at probing time. The regulator is declared into ms5611 DTS entry as a "vdd-supply" property. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-24iio:pressure:ms5611: use probed device nameGrégor Boirie
Use name of probed device instead of driver's one when registering device. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-24iio:pressure:ms5611: fix ms5607 temp compensationGregor Boirie
Computation of sens2 was wrong and is fixed by this patch, sens2 should be: 2 * (t - 2000)^2 See page 8 of ms5607 datasheet here: http://www.meas-spec.com/product/pressure/MS5607-02BA03.aspx Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-17iio: pressure: ms5611: select IIO_BUFFERArnd Bergmann
The ms5611 driver started using the IIO_TRIGGERED_BUFFER infrastructure which in turn depend on IIO_BUFFER, and it produces a build error now if that is not enabled: warning: (... && MS5611 && ...) selects IIO_TRIGGERED_BUFFER which has unmet direct dependencies (IIO && IIO_BUFFER) buffer/industrialio-triggered-buffer.c: In function 'iio_triggered_buffer_setup': buffer/industrialio-triggered-buffer.c:58:2: error: implicit declaration of function 'iio_device_attach_buffer' [-Werror=implicit-function-declaration] pressure/ms5611_core.c: In function 'ms5611_trigger_handler': pressure/ms5611_core.c:193:2: error: implicit declaration of function 'iio_push_to_buffers_with_timestamp' [-Werror=implicit-function-declaration] This adds the second select. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 713bbb4efb9d ("iio: pressure: ms5611: Add triggered buffer support") Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-14Merge tag 'iio-for-4.6b' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: 2nd round of new IIO device support, features and cleanups for the 4.6 cycle. New Device Support * Apex stx104 DAC - new driver for this PC104 board. Right now DAC support only. * ADI ad5064 - Add support for ad5625, ad5627, ad5645, ad5665, ad5667 DACs. - Add support for Linear Technology ltc2606, ltc2607, ltc2609, ltc2616, ltc2617, ltc2619, ltc2626, ltc2627 and ltc2629. * ADI ad7192 - add support for the ad7193 * Invensense mpu6050 - substantial rework of driver to use regmap allowing SPI support extending the now split driver to cover the MPU6000. * TI adc0832 - new driver supporting ADC0831, ADC0832, ADC0834 and ADC0838 ADCs. * TI ads1015 - new driver, note that there is an existing hwmon driver. The long term intention is to probably remove the hwmon driver but for now we just have guards in place to ensure this driver is not built if that one is enabled. * TI afe4403 - new driver for this heart rate monitor / pulse oximeter front end chip. * TI afe4404 - new driver for this heart rate monitor / pulse oximeter front end chip. Staging Graduations * mxs-lradc - A combined general purpose and touch screen (input) device driver. Originally held in staging to allow reworking into and MFD but as that wasn't happening and isn't an absolute requirement we are moving it out of staging. Driver new features * ms5611 - triggered buffer support - IIO_CHAN_INFO_SCALE to aid the triggered buffer support. Driver cleanups / reworks / fixes * ad5064 - Use an enum for the register map layout to allow support of additional chips (precursor to the new support listed above). - Structural driver changes to allow support of the slightly different handling for the ltc parts above. * ad5933 - drop an exceptional & unnecessary for a function pointer. * ad7606 - Cleanup the repeated copies of pm ops. - consolidate the various channels specs via a sport of rearranging so only one version is needed. * atlas ph sensor - add select IRQ_WORK * hmc8543 (soon to move out of staging) - Comment style fixes - functionality of suspend and resume was swapped. * spear-adc - use devm_clk_dev instead of managing the clk lifetime by hand. Core * Use new dmaengine_terminate_sync call to avoid a theoretical race. * Fix docs for mlock in struct iio_dev as it is correctly taken in some drivers (docs used to say for core only). * Add a helper function for calculating the scan index storage size within the core cutting out some cut and paste versions of the same code.
2016-02-07Merge 4.5-rc3 into staging-nextGreg Kroah-Hartman
We want the upstream staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06iio: pressure: ms5611: Add triggered buffer supportDaniel Baluta
This will be used together with an external trigger (e.g hrtimer based software trigger). Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-06iio: pressure: ms5611: Add IIO_CHAN_INFO_SCALE to maskDaniel Baluta
This allows data exported via buffer interface to be converted to standard units in userspace. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-30iio:pressure:Kconfig white space cleanup.Jonathan Cameron
Clearly a high degree of cut and paste has gone on in this file, propogating a particularly random combination of tabs and spaces. This patch at least should make it all consistent going forward. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-30iio: pressure: mpl115: support MPL115A1Akinobu Mita
mpl115 driver currently supports i2c interface (MPL115A2). There is also SPI version (MPL115A1). The difference between them is only physical transport so we can easily support both while sharing most of the code. Split the driver into a core support module and one module each for I2C and SPI support. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-30iio: pressure: mpl115: don't set unused i2c clientdataAkinobu Mita
mpl115 sets i2c clientdata, but it is not used anywhere. So remove it. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-30iio: pressure: mpl115: fix temperature offset signAkinobu Mita
According to the datasheet, the resolusion of temperature sensor is -5.35 counts/C. Temperature ADC is 472 counts at 25C. (https://www.sparkfun.com/datasheets/Sensors/Pressure/MPL115A1.pdf NOTE: This is older revision, but this information is removed from the latest datasheet from nxp somehow) Temp [C] = (Tadc - 472) / -5.35 + 25 = (Tadc - 605.750000) * -0.186915888 So the correct offset is -605.750000. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-10iio: st_sensors: support active-low interruptsLinus Walleij
Most ST MEMS Sensors that support interrupts can also handle sending an active low interrupt, i.e. going from high to low on data ready (or other interrupt) and thus triggering on a falling edge to the interrupt controller. Set up logic to inspect the interrupt line we get for a sensor: if it is triggering on rising edge, leave everything alone, but if it triggers on falling edges, set up active low, and if unsupported configurations appear: warn with errors and reconfigure the interrupt to a rising edge, which all interrupt generating sensors support. Create a local header for st_sensors_core.h to share functions between the sensor core and the trigger setup code. Cc: Giuseppe Barba <giuseppe.barba@st.com> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-05Merge tag 'spi-v4.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "Quite a lot of activity in SPI this cycle, almost all of it in drivers with a few minor improvements and tweaks in the core. - Updates to pxa2xx to support Intel Broxton and multiple chip selects. - Support for big endian in the bcm63xx driver. - Multiple slave support for the mt8173 - New driver for the auxiliary SPI controller in bcm2835 SoCs. - Support for Layerscale SoCs in the Freescale DSPI driver" * tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits) spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI spi: pxa2xx: Add support for Intel Broxton spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals spi: pxa2xx: Add output control for multiple Intel LPSS chip selects spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific spi: Add DSPI support for layerscape family spi: ti-qspi: improve ->remove() callback spi/spi-xilinx: Fix race condition on last word read spi: Drop owner assignment from spi_drivers spi: Add THIS_MODULE to spi_driver in SPI core spi: Setup the master controller driver before setting the chipselect spi: dw: replace magic constant by DW_SPI_DR spi: mediatek: mt8173 spi multiple devices support spi: mediatek: handle controller_data in mtk_spi_setup spi: mediatek: remove mtk_spi_config spi: mediatek: Update document devicetree bindings to support multiple devices spi: fix kernel-doc warnings about missing return desc in spi.c spi: fix kernel-doc warnings about missing return desc in spi.h spi: pxa2xx: Align a few defines spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select ...