- 11 3月, 2018 1 次提交
-
-
由 Michael Nosthoff 提交于
Commit 7383d44b added a pointer pdata which get set to the default platform_data when non was defined in the device. But it did not pass this pointer to the st_sensors_init_sensor call but still used the maybe uninitialized platform_data from dev. This breaks initialization when no platform_data is given and the optional st,drdy-int-pin devicetree option is not set. This commit fixes this. Cc: stable@vger.kernel.org Fixes: 7383d44b ("iio: st_pressure: st_accel: Initialise sensor platform data properly") Signed-off-by: NMichael Nosthoff <committed@heine.so> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 11 10月, 2017 2 次提交
-
-
由 Lorenzo Bianconi 提交于
Define st_sensor_int_drdy structure in st_sensor_data_ready_irq in order to contain irq line parameters of the device. Moreover separate data-ready open-drain configuration parameters for INT1 and INT2 pins in st_sensor_data_ready_irq data structure. That change will be used to properly support LIS3DHH accel sensor. Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Lorenzo Bianconi 提交于
Add SPI Serial Interface Mode (SIM) register information to STM pressure framework Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 10 10月, 2017 2 次提交
-
-
由 Lorenzo Bianconi 提交于
Separate data-ready configuration parameters for INT1 and INT2 pins in st_sensor_data_ready_irq data structure. That change will be use to properly support LIS2DW12 accel sensor. Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@st.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
由 Lorenzo Bianconi 提交于
Introduce register mask for data-ready status register since pressure sensors (e.g. LPS22HB) export just two channels (BIT(0) and BIT(1)) and BIT(2) is marked reserved while in st_sensors_new_samples_available() value read from status register is masked using 0x7. Moreover do not mask status register using active_scan_mask since now status value is properly masked and if the result is not zero the interrupt has to be consumed by the driver. This fix an issue on LPS25H and LPS331AP where channel definition is swapped respect to status register. Furthermore that change allows to properly support new devices (e.g LIS2DW12) that report just ZYXDA (data-ready) field in status register to figure out if the interrupt has been generated by the device. Fixes: 97865fe4 (iio: st_sensors: verify interrupt event to status) Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@st.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 04 9月, 2017 1 次提交
-
-
由 Lorenzo Bianconi 提交于
add support to STMicroelectronics LPS33HW and LPS35HW pressure sensors to st_pressure framework http://www.st.com/resource/en/datasheet/lps33hw.pdf http://www.st.com/resource/en/datasheet/lps35hw.pdfSigned-off-by: NLorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 23 8月, 2017 1 次提交
-
-
由 Jonathan Cameron 提交于
The equivalent of both of these are now done via macro magic when the relevant register calls are made. The actual structure elements will shortly go away. Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
-
- 12 8月, 2017 1 次提交
-
-
由 Lorenzo Bianconi 提交于
Remove int2 configuration parameter for LPS22HB and LPS25H since these devices export just int1 as data-ready line Fixes: 93187840 (iio:pressure: Add support for LPS25H pressure sensor) Fixes: e039e2f5 (iio:st_pressure:initial lps22hb sensor support) Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
-
- 25 6月, 2017 1 次提交
-
-
由 Lorenzo Bianconi 提交于
Set multiread variable to false for LPS22HB pressure sensor since it is already enabled in CTRL_REG2. Previous configuration does not cause any issue in I2C communication since SUB Msb has no meaning whereas it breaks register address in SPI communication Fixes: e039e2f5 (iio:st_pressure:initial lps22hb sensor support) Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 26 4月, 2017 1 次提交
-
-
由 Shrirang Bagul 提交于
This patch fixes the sensor platform data initialisation for st_pressure and st_accel device drivers. Without this patch, the driver fails to register the sensors when the user removes and re-loads the driver. 1. Unload the kernel modules for st_pressure $ sudo rmmod st_pressure_i2c $ sudo rmmod st_pressure 2. Re-load the driver $ sudo insmod st_pressure $ sudo insmod st_pressure_i2c Signed-off-by: NJonathan Cameron <jic23@kernel.org> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 02 4月, 2017 1 次提交
-
-
由 Shrirang 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: NShrirang Bagul <shrirang.bagul@canonical.com> Cc: <Stable@vger.kernel.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 30 12月, 2016 2 次提交
-
-
由 Marcin Niestroj 提交于
Both devices are using the same iio_chan_spec to define which settings are exported with sysfs. Both are properly configured to set/get sampling frequency for pressure and temperature. They also properly export available sampling frequencies. The only missing thing is sampling_frequency sysfs file, which allows to set/get this property from userspace. Add sampling frequency to iio channel info mask, so sampling_frequency file is properly exported using sysfs. Signed-off-by: NMarcin Niestroj <m.niestroj@grinn-global.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Marcin Niestroj 提交于
Datasheet of each device (lps331ap, lps25h, lps001wp, lps22hb) says that the pressure and temperature data is a 2's complement. I'm sending this the slow way, as negative pressures on these are pretty unusual and the nature of the fixing of multiple device introduction patches will make it hard to apply to older kernels - Jonathan. Fixes: 217494e5 ("iio:pressure: Add STMicroelectronics pressures driver") Fixes: 2f5effcb ("iio: pressure-core: st: Expand and rename LPS331AP's channel descriptor") Fixes: 7885a8ce ("iio: pressure: st: Add support for new LPS001WP pressure sensor") Fixes: e039e2f5 ("iio:st_pressure:initial lps22hb sensor support") Signed-off-by: NMarcin Niestroj <m.niestroj@grinn-global.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 12 11月, 2016 1 次提交
-
-
由 Linus Walleij 提交于
We have #defines for all the individual sensor registers and value/mask pairs #defined at the top of the file and used at exactly one spot. This is usually good if the #defines give a meaning to the opaque magic numbers. However in this case, the semantic meaning is inherent in the name of the C99-addressable fields, and that means duplication of information, and only makes the code hard to maintain since you every time have to add a new #define AND update the site where it is to be used. Get rid of the #defines and just open code the values into the appropriate struct elements. Make sure to explicitly address the .hz and .value fields in the st_sensor_odr_avl struct so that the meaning of all values is clear. This patch is purely syntactic should have no semantic effect. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 05 7月, 2016 6 次提交
-
-
由 Gregor Boirie 提交于
Some static channels are explicitly initialized with default values. Remove them to enhance readability. Signed-off-by: NGregor Boirie <gregor.boirie@parrot.com> Tested-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Gregor Boirie 提交于
Implement lps22hb temperature sampling channel. Signed-off-by: NGregor Boirie <gregor.boirie@parrot.com> Tested-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Gregor Boirie 提交于
Add support for open drain interrupt line. Signed-off-by: NGregor Boirie <gregor.boirie@parrot.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Gregor Boirie 提交于
Enable support for triggered buffering of temperature samples. Signed-off-by: NGregor Boirie <gregor.boirie@parrot.com> Tested-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Gregor Boirie 提交于
Details scaling factors and offsets applied to raw temperature and pressure samples. Signed-off-by: NGregor Boirie <gregor.boirie@parrot.com> Tested-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Gregor Boirie 提交于
Sampled pressure data are 24 bits long and should be stored in a 32 bits word. Signed-off-by: NGregor Boirie <gregor.boirie@parrot.com> Tested-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 30 5月, 2016 1 次提交
-
-
由 Linus 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: NLinus Walleij <linus.walleij@linaro.org> Cc: Giuseppe Barba <giuseppe.barba@st.com> Cc: Denis Ciocca <denis.ciocca@st.com> Reported-by: NCrestez Dan Leonard <cdleonard@gmail.com> Tested-by: NCrestez Dan Leonard <cdleonard@gmail.com> Tested-by: NJonathan Cameron <jic23@kernel.org> Fixes: 97865fe4 ("iio: st_sensors: verify interrupt event to status") Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 29 5月, 2016 3 次提交
-
-
由 Gregor Boirie 提交于
Ensure failure to enable power regulators is properly handled. Signed-off-by: NGregor Boirie <gregor.boirie@parrot.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 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: NGregor Boirie <gregor.boirie@parrot.com> Cc: <Stable@vger.kernel.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Gregor 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: NGregor Boirie <gregor.boirie@parrot.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 20 4月, 2016 2 次提交
-
-
由 Linus 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: NRob Herring <rob@kernel.org> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Linus 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: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 10 1月, 2016 1 次提交
-
-
由 Linus 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: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 16 8月, 2015 1 次提交
-
-
由 Linus Walleij 提交于
This adds a debugfs hook to read/write registers in the ST sensors using debugfs. Proved to be awesome help when trying to debug why IRQs do not arrive. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NDenis Ciocca <denis.ciocca@st.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 24 7月, 2015 1 次提交
-
-
由 Giuseppe Barba 提交于
This patch permits to configure the WhoAmI register address because some device could have not a standard address for this register. Signed-off-by: NGiuseppe Barba <giuseppe.barba@st.com> Reviewed-by: NDenis Ciocca <denis.ciocca@st.com> Acked-by: NDenis Ciocca <denis.ciocca@st.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 27 4月, 2015 1 次提交
-
-
由 Alban 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: NAlban Bedel <alban.bedel@avionic-design.de> Acked-by: NDenis Ciocca <denis.ciocca@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 04 10月, 2014 3 次提交
-
-
由 Denis CIOCCA 提交于
This patch fix pressure data variable name. Usually pdata name it is used for platform data. Signed-off-by: NDenis Ciocca <denis.ciocca@st.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Denis CIOCCA 提交于
Signed-off-by: NDenis Ciocca <denis.ciocca@st.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Denis CIOCCA 提交于
This patch change structure name and related variables names. Signed-off-by: NDenis Ciocca <denis.ciocca@st.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 07 7月, 2014 1 次提交
-
-
由 Jonathan Cameron 提交于
This allows in kernel client drivers to access this Signed-off-by: NJonathan Cameron <jic23@kernel.org> Cc: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: NHartmut Knaack <knaack.h@gmx.de>
-
- 26 4月, 2014 2 次提交
-
-
由 Linus 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: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Linus 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: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 22 2月, 2014 1 次提交
-
-
由 Denis CIOCCA 提交于
This patch adds support for the new barometer sensor: LPS25H. Signed-off-by: NDenis Ciocca <denis.ciocca@st.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 24 9月, 2013 2 次提交
-
-
由 Lee 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: NLee Jones <lee.jones@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
由 Lee 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: NLee Jones <lee.jones@linaro.org> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-
- 22 9月, 2013 1 次提交
-
-
由 Denis CIOCCA 提交于
This patch fix buffer registration that allows to use generic IIO trigger. Signed-off-by: NDenis Ciocca <denis.ciocca@st.com> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
-