aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/humidity/hts221_core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-01-30iio: humidity: hts221: remove unnecessary get_unaligned_le16()Lorenzo Bianconi1-4/+3
Remove unnecessary unaligned access routine in hts221_read_oneshot() and the related include Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-01-30iio: humidity: hts221: add regmap API supportLorenzo Bianconi1-72/+43
Introduce regmap API support to access to i2c/spi bus instead of using a custom support. Remove lock mutex since concurrency is already managed by regmap API Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-01-30iio: humidity: hts221: remove warnings in hts221_parse_{temp,rh}_caldata()Lorenzo Bianconi1-13/+15
Remove following sparse warnings in hts221_parse_temp_caldata() and in hts221_parse_rh_caldata(): drivers/iio/humidity/hts221_core.c:302:19: warning: cast to restricted __le16 drivers/iio/humidity/hts221_core.c:314:18: warning: cast to restricted __le16 drivers/iio/humidity/hts221_core.c:320:18: warning: cast to restricted __le16 drivers/iio/humidity/hts221_core.c:355:18: warning: cast to restricted __le16 drivers/iio/humidity/hts221_core.c:361:18: warning: cast to restricted __le16 Fixes: e4a70e3e7d84 ("iio: humidity: add support to hts221 rh/temp combo device") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-01-08iio: humidity: hts221: move common code in hts221_coreLorenzo Bianconi1-2/+16
Move duplicated i2c/spi probe code in hts221_probe() Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-22iio:humidity: drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron1-1/+0
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: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-07-25iio: humidity: hts221: move drdy enable logic in hts221_trig_set_state()Lorenzo Bianconi1-14/+0
Move data-ready configuration in hts221_buffer.c since it is only related to trigger logic Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-07-22iio: humidity: hts221: support active-low interruptsLorenzo Bianconi1-2/+1
Add support for active low interrupts (IRQF_TRIGGER_LOW and IRQF_TRIGGER_FALLING). Configure the device as active high or low according to the requested irq line. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-07-22iio: humidity: hts221: squash hts221_power_on/off in hts221_set_enableLorenzo Bianconi1-19/+5
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-07-22iio: humidity: hts221: avoid useless ODR reconfigurationLorenzo Bianconi1-9/+8
Configure sensor ODR just in hts221_write_raw() in order to avoid to set device sample rate multiple times. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-07-22iio: humidity: hts221: do not overwrite reserved data during power-downLorenzo Bianconi1-6/+4
GENMASK(6, 3) in CTRL_REG1 and GENMASK(6, 2) in CTRL_REG2 are marked reserved. Do not changed the original value (not declared in the datasheet) during power-down/suspend routines. Fixes: e4a70e3e7d84 (iio: humidity: add support to hts221 rh/temp device) Fixes: b7079eeac5da (iio: humidity: hts221: add power management support) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-07-22iio: humidity: hts221: move BDU configuration in probe routineLorenzo Bianconi1-6/+6
Enable Block Data Update in hts221_probe() in order to avoid to reconfigure it every time the sensor is enabled Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-07-22iio: humidity: hts221: refactor write_with_mask codeLorenzo Bianconi1-52/+42
Move bit-shift in hts221_write_with_mask() instead of coding the shift depth in the configured value. That change will be necessary to fix an issue in device power-down procedure. Simplify hts221_avg_list table management Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-05-14iio: humidity: hts221: add power management supportLorenzo Bianconi1-4/+50
Add system sleep power management support to hts221 driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-23iio: humidity: add support to hts221 rh/temp combo deviceLorenzo Bianconi1-0/+687
Add support to STM HTS221 humidity + temperature sensor http://www.st.com/resource/en/datasheet/hts221.pdf - continuous mode support - i2c support - spi support - trigger mode support Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>