summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* iio: tsl2772: Use devm_add_action_or_resetChuhong Yuan2019-08-051-3/+3
| | | | | | | | | | Use devm_add_action_or_reset to remove the call to tsl2772_disable_regulators_action to simplify the error path. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Reviewed-by: Brian Masney <masneyb@onstation.org> Tested-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: Remove dev_err() usage after platform_get_irq()Stephen Boyd2019-08-0520-56/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: si1145: Use device-managed APIsChuhong Yuan2019-08-051-37/+5
| | | | | | | | | Use device-managed APIs to simplify the code. The remove functions are redundant now and can be deleted. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:pressure: preenable/postenable/predisable fixup for ST press bufferDenis Ciocca2019-08-051-21/+17
| | | | | | | | | | | | | | | | | This patch is trying to cleanup for good the buffers operation functions. There is no need of using preenable, all can be done into postenable. Let's also use logical sequence of operations as already done in accel driver. Finally also rename the goto label using operation to perform and not where it fails. Not stable material as not fixing a 'bug' but rather bringing the driver in line with general 'patterns' to allow a subsystem wide cleanup. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:magn: preenable/postenable/predisable fixup for ST magn bufferDenis Ciocca2019-08-051-14/+16
| | | | | | | | | | | | | | This patch is trying to cleanup for good the buffers operation functions. Let's rename the goto label using operation to perform and not where it fails. Not stable material as not fixing a 'bug' but rather bringing the driver in line with general 'patterns' to allow a subsystem wide cleanup. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:gyro: preenable/postenable/predisable fixup for ST gyro bufferDenis Ciocca2019-08-051-25/+24
| | | | | | | | | | | | | | | | | This patch is trying to cleanup for good the buffers operation functions. There is no need of using preenable, all can be done into postenable. Let's also use logical sequence of operations as already done in accel driver. Finally also rename the goto label using operation to perform and not where it fails. Not stable material as not fixing a 'bug' but rather bringing the driver in line with general 'patterns' to allow a subsystem wide cleanup. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:accel: preenable/postenable/predisable fixup for ST accel bufferDenis Ciocca2019-08-051-25/+20
| | | | | | | | | | | | | | | This patch is trying to cleanup for good the buffers operation functions. There is no need of using preenable, all can be done into postenable. Let's also rename the goto label using operation to perform and not where it fails. Note, not stable material. This is cleaning up the logic flow rather than fixing a bug. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* dt-bindings: iio: imu: st_lsm6dsx: add ism330dhcx device bindingsLorenzo Bianconi2019-08-051-0/+1
| | | | | Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: add support to ISM330DHCXLorenzo Bianconi2019-08-056-5/+22
| | | | | | | | Add support to STM ISM330DHCX 6-axis (acc + gyro) Mems sensor https://www.st.com/resource/en/datasheet/ism330dhcx.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: move iio chan definitions in st_lsm6dsx_sensor_settingsLorenzo Bianconi2019-08-052-20/+81
| | | | | | | | | | | Move IIO channel definitions in st_lsm6dsx_sensor_settings in order to support sensors with different channels maps. This is a preliminary patch to add support for LSM9DS1 sensor to st_lsm6dsx driver. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: inline output acc/gyro output regsLorenzo Bianconi2019-08-051-20/+6
| | | | | | | | | | Remove output register definition and inline register value since they are used only for iio channel definition. This is a preliminary patch to add support for LSM9DS1 sensor to st_lsm6dsx driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: move fs_table in st_lsm6dsx_sensor_settingsLorenzo Bianconi2019-08-052-33/+144
| | | | | | | | | | Move fs_table in st_lsm6dsx_sensor_settings in order to support sensors with different gain maps. This is a preliminary patch to add support for LSM9DS1 sensor to st_lsm6dsx driver Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: move odr_table in st_lsm6dsx_sensor_settingsLorenzo Bianconi2019-08-052-32/+166
| | | | | | | | | | Move sensor odr table in st_lsm6dsx_sensor_settings in order to support sensors with different odr maps. This is a preliminary patch to add support for LSM9DS1 sensor to st_lsm6dsx driver Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: light: cm3323: Use device-managed APIsChuhong Yuan2019-08-051-24/+9
| | | | | | | | | Use device-managed APIs to simplify the code. The remove functions are redundant now and can be deleted. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* dt-bindings: iio: potentiometer: add max5432.yaml bindingMartin Kaiser2019-08-051-0/+44
| | | | | | | | | Add a binding for the Maxim Integrated MAX5432-MAX5435 family of digital potentiometers. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: potentiometer: add a driver for Maxim 5432-5435Martin Kaiser2019-08-053-0/+147
| | | | | | | | | | | | | | | | | | Add a driver for the Maxim Integrated MAX5432-MAX5435 family of digital potentiometers. These potentiometers are connected via I2C and have 32 wiper positions. Supported functionality - set the volatile wiper position - read the potentiometer scale Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX5432-MAX5435.pdf Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: ad7606: Add debug mode for ad7616Beniamin Bia2019-07-281-1/+32
| | | | | | | | Support for register access was added for devices which have software mode. Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: ad7606: Add support for software mode for ad7616Beniamin Bia2019-07-283-9/+213
| | | | | | | | | | | | | | | Support for ad7616 running in software was added. In order to activate the software mode, HW_RNGSEL pins must be pulled low. Oversampling and input ranges are now configured in corresponding registers. Ad7616 has multiple scale options when it is configured in software mode. Also, in order to support multiple devices in software mode, the spi calculation of registers address must be generic. Because the length of address and bit which specifies the read/write operation is different for every device, calculation of address was made generic. Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: ad7606: Allow reconfigration after resetBeniamin Bia2019-07-281-0/+4
| | | | | | | | According to datasheet, ad7616 require at least 15ms after a restart to fully reconfigure and being able to receive new commands via spi. Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: ad7606: Move spi dependent features to spi fileBeniamin Bia2019-07-282-27/+5
| | | | | | | | | | | | Because software mode and register access are only available in spi, they were moved in spi file and are accessbile via bops structure. The write_os/scale will be overwritten by sw_mode_config function. This patch was made in order to support devices in software mode without making the driver dependent to spi and increase the abstraction of the core. Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: ad7606: Move common channel definition to headerBeniamin Bia2019-07-282-23/+23
| | | | | | | | | | The common channel definition which are going to be used by both core file but also spi file, were moved in header file. Some devices have different channel definitions when are used in software mode, feature available only with spi, and those definitions will be added in spi file. Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: document bindings for mounting matricesLinus Walleij2019-07-281-0/+203
| | | | | | | | | | | | | | | | | | | | | | | | | The mounting matrix for sensors was introduced in commit dfc57732ad38 ("iio:core: mounting matrix support") However the device tree bindings are very terse and since this is a widely applicable property, we need a proper binding for it that the other bindings can reference. This will also be useful for other operating systems and sensor engineering at large. I think all 3D sensors should support it, the current situation is probably that the mounting information is confined in magic userspace components rather than using the mounting matrix, which is not good for portability and reuse. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Gregor Boirie <gregor.boirie@parrot.com> Cc: Sebastian Reichel <sre@kernel.org> Cc: Samu Onkalo <samu.onkalo@intel.com> Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: common: cros_ec_sensors: Expose cros_ec_sensors frequency range via iio ↵Fabien Lahoudere2019-07-284-0/+92
| | | | | | | | | | | | | | | | | | | | | sysfs Embedded controller return minimum and maximum frequencies, unfortunately we have no way to know the step for all available frequencies. Even if not complete, we can return a list of known values using the standard read_avail callback (IIO_CHAN_INFO_SAMP_FREQ) to provide them to userland. Now cros_ec_* sensors provides frequencies values in sysfs like this: "0 min max". 0 is always true to disable the sensor. Default frequencies are provided for earlier protocol. Signed-off-by: Nick Vaccaro <nvaccaro@chromium.org> Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> [rebased on top of iio/testing and solved conflicts] Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: cros_ec_accel_legacy: Add support for veyron-minnieGwendal Grignou2019-07-281-2/+38
| | | | | | | | | | Veyron minnie embedded controller presents 2 accelerometers using an older interface. Add function to query the data in cros_ec_accel. Verify accelerometers on veyron-minnie are presented and working. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: cros_ec_accel_legacy: Use cros_ec_sensors_coreGwendal Grignou2019-07-282-285/+55
| | | | | | | | | | | Remove duplicate code in cros-ec-accel-legacy, use cros-ec-sensors-core functions and structures when possible. On glimmer, check the 2 accelerometers are presented and working. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: cros_ec_accel_legacy: Fix incorrect channel settingGwendal Grignou2019-07-281-1/+0
| | | | | | | | INFO_SCALE is set both for each channel and all channels. iio is using all channel setting, so the error was not user visible. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: cros_ec: Add sign vector in core for backward compatibilityGwendal Grignou2019-07-282-1/+5
| | | | | | | | | | | | | To allow cros_ec iio core library to be used with legacy device, add a vector to rotate sensor data if necessary: legacy devices are not reporting data in HTML5/Android sensor referential. Check the data is not rotated on recent chromebooks that use the HTML5 standard to present sensor data. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: common: cros_ec_sensors: determine protocol versionFabien Lahoudere2019-07-271-1/+34
| | | | | | | | | | | | | This patch adds a function to determine which version of the protocol is used to communicate with EC. Signed-off-by: Nick Vaccaro <nvaccaro@chromium.org> Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> [rebased on top of iio/testing and solved conflicts] Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* counter/ftm-quaddec: Use device-managed registration APIChuhong Yuan2019-07-271-18/+12
| | | | | | | | | Make use of devm_counter_register. Then we can remove redundant unregistration API usage to make code simpler. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: flip irq return logicSean Nyekjaer2019-07-271-1/+1
| | | | | | | | No need for using reverse logic in the irq return, fix this by flip things around. Signed-off-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: add i3c basic support for LSM6DSO and LSM6DSRVitor Soares2019-07-273-1/+65
| | | | | | | | | | | | | For today the st_lsm6dsx driver support LSM6DSO and LSM6DSR sensor only in spi and i2c mode. The LSM6DSO and LSM6DSR are also i3c capable so let's give i3c support to them. Signed-off-by: Vitor Soares <vitor.soares@synopsys.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Merge tag 'tags/i3c/export-i3c_device_match_id' into HEADJonathan Cameron2019-07-273-45/+57
|\ | | | | | | Needed for the st_lsm6dsx_i3c.c driver
| * i3c: move i3c_device_match_id to device.c and export itVitor Soares2019-07-273-45/+57
| | | | | | | | | | | | | | | | | | | | | | Some I3C device drivers need to know which entry matches the i3c_device object passed to the probe function Let's move i3c_device_match_id() to device.c and export it so it can be used by drivers. Signed-off-by: Vitor Soares <vitor.soares@synopsys.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
* | iio: magnetometer: mmc35240: Fix a typo in the name of a constantChristophe JAILLET2019-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | Everything is about mmc35240_ except MMC53240_WAIT_SET_RESET (3 and 5 switched). This is likely a typo. Define and use MMC35240_WAIT_SET_RESET instead. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: pressure: hp03: convert to i2c_new_dummy_deviceWolfram Sang2019-07-271-3/+3
| | | | | | | | | | | | | | | | Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: light: veml6070: convert to i2c_new_dummy_deviceWolfram Sang2019-07-271-3/+3
| | | | | | | | | | | | | | | | Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: light: cm36651: convert to i2c_new_dummy_deviceWolfram Sang2019-07-271-6/+6
| | | | | | | | | | | | | | | | Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | dt-bindings: iio: imu: add bindings for ADIS16460Alexandru Ardelean2019-07-272-0/+54
| | | | | | | | | | | | | | | | This change adds device-tree bindings for the ADIS16460. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: imu: Add support for the ADIS16460 IMUAlexandru Ardelean2019-07-274-0/+509
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ADIS16460 device is a complete inertial system that includes a triaxial gyroscope and a triaxial accelerometer. It's more simplified design than that of the ADIS16480, and does not offer the triaxial magnetometers & pressure sensors. It does also have a temperature sensor (like the ADIS16480). Since it is part of the ADIS16XXX family, it re-uses parts of the ADIS library. Naturally, the register map is different and much more simplified than the ADIS16480 subfamily, so it cannot be integrated into that driver. A major difference is that the registers are not paged. One thing that is particularly special about it, is that it requires a higher delay between CS changes (i.e. when CS goes up, the spec recommends that it be brought down after a minimum of 16 uS). Other ADIS chips require (via spec) a minimum of 2 uS between CS changes. The kernel's 10 uS default should be fine for those other chips; they haven't been tested with lower CS change delays yet. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/adis16460.pdf Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: imu: adis: Add support for SPI transfer cs_change_delayAlexandru Ardelean2019-07-272-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ADIS16460 requires a higher delay before the next transfer. Since the SPI framework supports configuring the delay before the next transfer, this driver will become the first user of it. The support for this functionality in ADIS16460 requires an addition to the ADIS lib to support the `cs_change_delay` functionality from the SPI subsystem. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: mxc4005: Use device-managed APIsChuhong Yuan2019-07-271-34/+6
| | | | | | | | | | | | | | | | | | Use device-managed APIs to simplify the code. The remove function is redundant now and can be deleted. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: humidity: Use device-managed APIsChuhong Yuan2019-07-272-37/+6
| | | | | | | | | | | | | | | | | | Use device-managed APIs to simplify the code. The remove functions are redundant now and can be deleted. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | staging: iio: ad2s1210: Use device-managed APIChuhong Yuan2019-07-271-11/+1
| | | | | | | | | | | | | | | | | | | | Use device-managed API to simplify the code. The remove function is redundant now and can be deleted. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: maxim_thermocouple: Use device-managed APIsChuhong Yuan2019-07-271-22/+3
| | | | | | | | | | | | | | | | | | Use device-managed APIs to simplify the code. The remove functions are redundant now and can be deleted. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: make st_sensors drivers use regmapDenis Ciocca2019-07-2719-212/+104
| | | | | | | | | | | | | | | | | | This patch is meant to replace the i2c/spi transfer functions with regmap. SPI framework requires DMA safe buffers so let's add GFP_DMA flag for memory allocation used by bulk_read functions. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio: move 3-wire spi initialization to st_sensors_spiDenis Ciocca2019-07-2712-71/+97
| | | | | | | | | | | | | | | | | | | | | | Some devices need to be configured with special bit in order to use spi 3-wire. This was done during device identification phase. Instead, let's move this part as spi specific. Doing this the check_device_support function becomes a simple device id check, so let's rename it. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio:pressure: device settings are set immediately during probeDenis Ciocca2019-07-272-13/+32
| | | | | | | | | | | | | | | | | | This patch set pressure settings right after probe start. This is done in preparation of regmap that needs different configuration based on multiread bit value. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio:magn: device settings are set immediately during probeDenis Ciocca2019-07-272-7/+27
| | | | | | | | | | | | | | | | | | This patch set magn settings right after probe start. This is done in preparation of regmap that needs different configuration based on multiread bit value. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio:gyro: device settings are set immediately during probeDenis Ciocca2019-07-272-7/+27
| | | | | | | | | | | | | | | | | | This patch set gyro settings right after probe start. This is done in preparation of regmap that needs different configuration based on multiread bit value. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* | iio:accel: device settings are set immediately during probeDenis Ciocca2019-07-272-8/+27
| | | | | | | | | | | | | | | | | | This patch set accel settings right after probe start. This is done in preparation of regmap that needs different configuration based on multiread bit value. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>