Commit 20b840a1 authored by Gregor Boirie's avatar Gregor Boirie Committed by Thadeu Lima de Souza Cascardo

iio:st_pressure: temperature triggered buffering

BugLink: https://bugs.launchpad.net/bugs/1676356

Enable support for triggered buffering of temperature samples.
Signed-off-by: default avatarGregor Boirie <gregor.boirie@parrot.com>
Tested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
(cherry picked from commit b4701fd6)
Signed-off-by: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 1262c110
...@@ -105,8 +105,6 @@ ...@@ -105,8 +105,6 @@
#define ST_PRESS_LSB_PER_CELSIUS 480UL #define ST_PRESS_LSB_PER_CELSIUS 480UL
#define ST_PRESS_MILLI_CELSIUS_OFFSET 42500UL #define ST_PRESS_MILLI_CELSIUS_OFFSET 42500UL
#define ST_PRESS_NUMBER_DATA_CHANNELS 1
/* FULLSCALE */ /* FULLSCALE */
#define ST_PRESS_FS_AVL_1100MB 1100 #define ST_PRESS_FS_AVL_1100MB 1100
#define ST_PRESS_FS_AVL_1260MB 1260 #define ST_PRESS_FS_AVL_1260MB 1260
...@@ -226,7 +224,7 @@ static const struct iio_chan_spec st_press_1_channels[] = { ...@@ -226,7 +224,7 @@ static const struct iio_chan_spec st_press_1_channels[] = {
.type = IIO_PRESSURE, .type = IIO_PRESSURE,
.channel2 = IIO_NO_MOD, .channel2 = IIO_NO_MOD,
.address = ST_PRESS_1_OUT_XL_ADDR, .address = ST_PRESS_1_OUT_XL_ADDR,
.scan_index = ST_SENSORS_SCAN_X, .scan_index = 0,
.scan_type = { .scan_type = {
.sign = 'u', .sign = 'u',
.realbits = 24, .realbits = 24,
...@@ -241,7 +239,7 @@ static const struct iio_chan_spec st_press_1_channels[] = { ...@@ -241,7 +239,7 @@ static const struct iio_chan_spec st_press_1_channels[] = {
.type = IIO_TEMP, .type = IIO_TEMP,
.channel2 = IIO_NO_MOD, .channel2 = IIO_NO_MOD,
.address = ST_TEMP_1_OUT_L_ADDR, .address = ST_TEMP_1_OUT_L_ADDR,
.scan_index = -1, .scan_index = 1,
.scan_type = { .scan_type = {
.sign = 'u', .sign = 'u',
.realbits = 16, .realbits = 16,
...@@ -254,7 +252,7 @@ static const struct iio_chan_spec st_press_1_channels[] = { ...@@ -254,7 +252,7 @@ static const struct iio_chan_spec st_press_1_channels[] = {
BIT(IIO_CHAN_INFO_OFFSET), BIT(IIO_CHAN_INFO_OFFSET),
.modified = 0, .modified = 0,
}, },
IIO_CHAN_SOFT_TIMESTAMP(1) IIO_CHAN_SOFT_TIMESTAMP(2)
}; };
static const struct iio_chan_spec st_press_lps001wp_channels[] = { static const struct iio_chan_spec st_press_lps001wp_channels[] = {
...@@ -262,7 +260,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = { ...@@ -262,7 +260,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = {
.type = IIO_PRESSURE, .type = IIO_PRESSURE,
.channel2 = IIO_NO_MOD, .channel2 = IIO_NO_MOD,
.address = ST_PRESS_LPS001WP_OUT_L_ADDR, .address = ST_PRESS_LPS001WP_OUT_L_ADDR,
.scan_index = ST_SENSORS_SCAN_X, .scan_index = 0,
.scan_type = { .scan_type = {
.sign = 'u', .sign = 'u',
.realbits = 16, .realbits = 16,
...@@ -278,7 +276,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = { ...@@ -278,7 +276,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = {
.type = IIO_TEMP, .type = IIO_TEMP,
.channel2 = IIO_NO_MOD, .channel2 = IIO_NO_MOD,
.address = ST_TEMP_LPS001WP_OUT_L_ADDR, .address = ST_TEMP_LPS001WP_OUT_L_ADDR,
.scan_index = -1, .scan_index = 1,
.scan_type = { .scan_type = {
.sign = 'u', .sign = 'u',
.realbits = 16, .realbits = 16,
...@@ -290,7 +288,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = { ...@@ -290,7 +288,7 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = {
BIT(IIO_CHAN_INFO_SCALE), BIT(IIO_CHAN_INFO_SCALE),
.modified = 0, .modified = 0,
}, },
IIO_CHAN_SOFT_TIMESTAMP(1) IIO_CHAN_SOFT_TIMESTAMP(2)
}; };
static const struct iio_chan_spec st_press_lps22hb_channels[] = { static const struct iio_chan_spec st_press_lps22hb_channels[] = {
...@@ -660,7 +658,13 @@ int st_press_common_probe(struct iio_dev *indio_dev) ...@@ -660,7 +658,13 @@ int st_press_common_probe(struct iio_dev *indio_dev)
if (err < 0) if (err < 0)
goto st_press_power_off; goto st_press_power_off;
press_data->num_data_channels = ST_PRESS_NUMBER_DATA_CHANNELS; /*
* Skip timestamping channel while declaring available channels to
* common st_sensor layer. Look at st_sensors_get_buffer_element() to
* see how timestamps are explicitly pushed as last samples block
* element.
*/
press_data->num_data_channels = press_data->sensor_settings->num_ch - 1;
press_data->multiread_bit = press_data->sensor_settings->multi_read_bit; press_data->multiread_bit = press_data->sensor_settings->multi_read_bit;
indio_dev->channels = press_data->sensor_settings->ch; indio_dev->channels = press_data->sensor_settings->ch;
indio_dev->num_channels = press_data->sensor_settings->num_ch; indio_dev->num_channels = press_data->sensor_settings->num_ch;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment