From 8c125f5f325e5caf171f6af95b7cfe7f3e3ba78b Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Sun, 10 Jan 2021 00:11:44 +0100 Subject: iio:pressure:ms5637: introduce hardware differentiation Some sensors in the ms58xx family have a different PROM length and a different number of available resolution. introduce struct ms_tp_hw_data to handle those differences. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210109231148.1168104-3-alexandre.belloni@bootlin.com Signed-off-by: Jonathan Cameron --- drivers/iio/common/ms_sensors/ms_sensors_i2c.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/iio/common') diff --git a/drivers/iio/common/ms_sensors/ms_sensors_i2c.h b/drivers/iio/common/ms_sensors/ms_sensors_i2c.h index bad09c80e47a..f4a88148c113 100644 --- a/drivers/iio/common/ms_sensors/ms_sensors_i2c.h +++ b/drivers/iio/common/ms_sensors/ms_sensors_i2c.h @@ -25,6 +25,16 @@ struct ms_ht_dev { u8 res_index; }; +/** + * struct ms_hw_data - Temperature/Pressure sensor hardware data + * @prom_len: number of words in the PROM + * @max_res_index: maximum sensor resolution index + */ +struct ms_tp_hw_data { + u8 prom_len; + u8 max_res_index; +}; + /** * struct ms_tp_dev - Temperature/Pressure sensor device structure * @client: i2c client @@ -36,6 +46,7 @@ struct ms_ht_dev { struct ms_tp_dev { struct i2c_client *client; struct mutex lock; + const struct ms_tp_hw_data *hw; u16 prom[MS_SENSORS_TP_PROM_WORDS_NB + 1]; u8 res_index; }; -- cgit