Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:pressure: introduce st_press_get_settings() function

The function is introduced to retrieve press device settings. It will be
used by probe in order to configure regmap.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Denis Ciocca and committed by
Jonathan Cameron
539b25fa aa4e75c8

+19
+1
drivers/iio/pressure/st_pressure.h
··· 41 41 .drdy_int_pin = 1, 42 42 }; 43 43 44 + const struct st_sensor_settings *st_press_get_settings(const char *name); 44 45 int st_press_common_probe(struct iio_dev *indio_dev); 45 46 void st_press_common_remove(struct iio_dev *indio_dev); 46 47
+18
drivers/iio/pressure/st_pressure_core.c
··· 664 664 #define ST_PRESS_TRIGGER_OPS NULL 665 665 #endif 666 666 667 + /* 668 + * st_press_get_settings() - get sensor settings from device name 669 + * @name: device name buffer reference. 670 + * 671 + * Return: valid reference on success, NULL otherwise. 672 + */ 673 + const struct st_sensor_settings *st_press_get_settings(const char *name) 674 + { 675 + int index = st_sensors_get_settings_index(name, 676 + st_press_sensors_settings, 677 + ARRAY_SIZE(st_press_sensors_settings)); 678 + if (index < 0) 679 + return NULL; 680 + 681 + return &st_press_sensors_settings[index]; 682 + } 683 + EXPORT_SYMBOL(st_press_get_settings); 684 + 667 685 int st_press_common_probe(struct iio_dev *indio_dev) 668 686 { 669 687 struct st_sensor_data *press_data = iio_priv(indio_dev);