summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/st_pressure_core.c
AgeCommit message (Collapse)Author
2015-04-26iio:st_sensors: Fix oops when probing SPI devicesAlban Bedel
In SPI mode the transfer buffer is locked with a mutex. However this mutex is only initilized after the probe, but some transfer needs to be done in the probe. To fix this bug we move the mutex initialization at the beginning of the device probe. Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Acked-by: Denis Ciocca <denis.ciocca@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04iio:pressure: Changed pressure data variable name to press_dataDenis CIOCCA
This patch fix pressure data variable name. Usually pdata name it is used for platform data. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04iio:pressure: Removed unnecessary parameter on common_probe functionDenis CIOCCA
Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04iio:imu: changed structure name from st_sensors to st_sensor_settingsDenis CIOCCA
This patch change structure name and related variables names. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07iio:st sensors: remove custom sampling frequence attribute in favour of core ↵Jonathan Cameron
support. This allows in kernel client drivers to access this Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
2014-04-26iio: st_sensors: move regulator retrieveal to coreLinus Walleij
Currently the pressure sensor has code to retrieve and enable two regulators for Vdd and Vdd IO, but actually these voltage inputs are found on all of these ST sensors, so move the regulator handling to the core and make sure all the ST sensors call these functions on probe() and remove() to enable/disable power. Here also mover over to obtaining the regulator from the *parent* device of the IIO device, as the IIO device is created on-the-fly in this very subsystem it very unlikely evert have any regulators attached to it whatsoever. It is much more likely that the parent is a platform device, possibly instantiated from a device tree, which in turn have Vdd and Vdd IO supplied assigned to it. Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-04-26iio: st_sensors: announce registered sensorsLinus Walleij
It is pretty helpful to know already from dmesg that a certain device is successfully registered, instead of having to browse sysfs to see if it's actually there. Cc: Lee Jones <lee.jones@linaro.org> Cc: Denis CIOCCA <denis.ciocca@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-02-22iio:pressure: Add support for LPS25H pressure sensorDenis CIOCCA
This patch adds support for the new barometer sensor: LPS25H. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-23iio: pressure-core: st: Provide support for the Vdd_IO power supplyLee Jones
The power to some of the sensors are controlled by regulators. In most cases these are 'always on', but if not they will fail to work until the regulator is enabled using the relevant APIs. This patch allows for the Vdd_IO power supply to be specified by either platform data or Device Tree. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-23iio: pressure-core: st: Provide support for the Vdd power supplyLee Jones
The power to some of the sensors are controlled by regulators. In most cases these are 'always on', but if not they will fail to work until the regulator is enabled using the relevant APIs. This patch allows for the Vdd power supply to be specified by either platform data or Device Tree. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-21iio:press: Register buffer also without specific triggerDenis CIOCCA
This patch fix buffer registration that allows to use generic IIO trigger. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-21iio: pressure: st: Add support for new LPS001WP pressure sensorLee Jones
Here we use existing practices to introduce support for another pressure/temperature sensor, the LPS001WP. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-21iio: pressure-core: st: Clean-up probe() functionLee Jones
This patch contains some pretty basic clean-ups in probe() pertaining to the simplification of error handling and a couple of readability adaptions. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-21iio: sensors-core: st: Support sensors which don't have a Data Ready pinLee Jones
Not all ST's sensors support data ready, so let's make the declaration of one conditional. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14iio: pressure-core: st: Allow for number of channels to varyLee Jones
At the moment the number of channels specified is dictated by the first sensor supported by the driver. As we add support for more sensors this is likely to vary. Instead of using the ARRAY_SIZE() of the LPS331AP's channel specifier we'll use a new adaptable 'struct st_sensors' element instead. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14iio: pressure-core: st: Expand and rename LPS331AP's channel descriptorLee Jones
Due to the MACRO used, the task of reading, understanding and maintaining the LPS331AP's channel descriptor is substantially difficult. This patch is based on the view that it's better to have easy to read, maintainable code than to save a few lines here and there. For that reason we're expanding the array so initialisation is completed in full. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14iio: pressure-core: st: Describe LPS331AP defines by nameLee Jones
They're currently named *_1_*, for 'Sensor 1', but the code will be much more readable if we use the naming convention *_LPS331AP_* instead. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14iio: sensors-core: st: Allow full-scale to be an optional featureLee Jones
Some chips either don't support it or fail to provide adequate documentation, so sometimes it's impossible to enable the feature even if it is supported. Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: pressure: st_pressure: Use devm_iio_device_allocSachin Kamat
Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: lps331ap: Modify in_temp_scale calculation wayJacek Anaszewski
This patch modifies the way how the in_temp_scale output value is calculated. With this implementation it is more clear how the value is obtained. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: Added ST-sensors platform data to select the DRDY interrupt pinDenis CIOCCA
This patch add support to redirect the DRDY interrupt on INT1 or INT2 on accelerometer and pressure sensors. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-07-16iio: lps331ap: Fix wrong in_pressure_scale output valueJacek Anaszewski
This patch fixes improper in_pressure_scale output that is returned by the lps331ap barometer sensor driver. According to the documentation the pressure after applying the scale has to be expressed in kilopascal units. With erroneous implementation the scale value larger by two orders of magnitude is returned - 2441410 instead of 24414. Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-05iio:pressure: Add STMicroelectronics pressures driverDenis CIOCCA
This patch adds a generic pressure driver for STMicroelectronics pressure sensors, currently it supports: LPS331AP. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>