summaryrefslogtreecommitdiff
path: root/drivers/iio/common/ms_sensors
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-10 02:11:44 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-01-22 11:52:06 +0300
commit8c125f5f325e5caf171f6af95b7cfe7f3e3ba78b (patch)
treed649725fbd6f08e3bcff40e19f5e7fad09318bb3 /drivers/iio/common/ms_sensors
parentd1004b707d8b4c05f20bed7506b99d58495d9046 (diff)
downloadlinux-8c125f5f325e5caf171f6af95b7cfe7f3e3ba78b.tar.xz
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 <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210109231148.1168104-3-alexandre.belloni@bootlin.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/common/ms_sensors')
-rw-r--r--drivers/iio/common/ms_sensors/ms_sensors_i2c.h11
1 files changed, 11 insertions, 0 deletions
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
@@ -26,6 +26,16 @@ struct ms_ht_dev {
};
/**
+ * 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
* @lock: lock protecting the i2c conversion
@@ -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;
};