summaryrefslogtreecommitdiffstats
path: root/drivers/iio/pressure
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-22 14:30:12 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-22 14:30:12 -0400
commit3ffdea3feca9e2c95c2e93e217d77c9c368f747a (patch)
treee970c502cbd02244344ee1449af072d0d7086bbd /drivers/iio/pressure
parent9076b09e07da4b2644a17d7d18e117944cbc09be (diff)
parent074b6a8d9d73db27d48abe4200ce149bd4189b39 (diff)
Merge tag 'iio-for-3.13a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: First round of new drivers, functionality and cleanups for IIO in the 3.13 cycle A number of new drivers and some new functionality + a lot of cleanups all over IIO. New Core Elements 1) New INT_TIME info_mask element for integration time, which may have different effects on measurement noise and similar, than an amplifier and hence is different from existing SCALE. Already existed in some drivers as a custom attribute. 2) Introduce a iio_push_buffers_with_timestamp helper to cover the common case of filling the last 64 bits of data to be passed to the buffer with a timestamp. Applied to lots of drivers. Cuts down on repeated code and moves a slightly fiddly bit of logic into a single location. 3) Introduce info_mask_[shared_by_dir/shared_by_all] elements to allow support of elements such as sampling_frequency which is typically shared by all input channels on a device. This reduces code and makes these controls available from in kernel consumers of IIO devices. New drivers 1) MCP3422/3/4 ADC 2) TSL4531 ambient light sensor 3) TCS3472/5 color light sensor 4) GP2AP020A00F ambient light / proximity sensor 5) LPS001WP support added to ST pressure sensor driver. New driver functionality 1) ti_am335x_adc Add buffered sampling support. This device has a hardware fifo that is fed directly into an IIO kfifo buffer based on a watershed interrupt. Note this will act as an example of how to handle this increasingly common type of device. The only previous example - sca3000 - take a less than optimal approach which is largely why it is still in staging. A couple of little cleanups for that new functionality followed later. Core cleanups: 1) MAINTAINERS - Sachin actually brought my email address up to date because I said I'd do it and never got around to it :) 2) Assign buffer list elements as single element lists to simplify the iio_buffer_is_active logic. 3) wake_up_interruptible_poll instead of wake_up_interruptible to only wake up threads waiting for poll notifications. 4) Add O_CLOEXEC flag to anon_inode_get_fd call for IIO event interface. 5) Change iio_push_to_buffers to take a void * pointer so as to avoid some annoying and unnecessary type casts. 6) iio_compute_scan_bytes incorrectly took a long rather than unsigned long. 7) Various minor tidy ups. Driver cleanups (in no particular order) 1) Another set of devm_ allocations patches from Sachin Kamat. 2) tsl2x7x - 0 to NULL cleanup. 3) hmc5843 - fix missing > in MODULE_AUTHOR 4) Set of strict_strto* to kstrto* conversions. 5) mxs-lradc - fix ordering of resource removal to match creation 6) mxs-lradc - add MODULE_ALIAS 7) adc7606 - drop a work pending test duplicated in core functions. 8) hmc5843 - devm_ allocation patch 9) Series of redundant breaks removed. 10) ad2s1200 - pr_err -> dev_err 11) adjd_s311 - use INT_TIME 12) ST sensors - large set of cleanups from Lee Jones and removed restriction to using only triggers provided by the st_sensors themselves from Dennis Ciocca. 13) dummy and tmp006 provide sampling_frequency via info_mask_shared_by_all. 14) tcs3472 - fix incorrect buffer size and wrong device pointer used in suspend / resume functions. 15) max1363 - use defaults for buffer setup ops as provided by the triggered buffer helpers as they are the same as were specified in max1363 driver. 16) Trivial tidy ups in a number of other drivers.
Diffstat (limited to 'drivers/iio/pressure')
-rw-r--r--drivers/iio/pressure/st_pressure.h1
-rw-r--r--drivers/iio/pressure/st_pressure_core.c268
-rw-r--r--drivers/iio/pressure/st_pressure_i2c.c1
3 files changed, 191 insertions, 79 deletions
diff --git a/drivers/iio/pressure/st_pressure.h b/drivers/iio/pressure/st_pressure.h
index b0b630688da6..049c21acf1f0 100644
--- a/drivers/iio/pressure/st_pressure.h
+++ b/drivers/iio/pressure/st_pressure.h
@@ -14,6 +14,7 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/iio/common/st_sensors.h> 15#include <linux/iio/common/st_sensors.h>
16 16
17#define LPS001WP_PRESS_DEV_NAME "lps001wp"
17#define LPS331AP_PRESS_DEV_NAME "lps331ap" 18#define LPS331AP_PRESS_DEV_NAME "lps331ap"
18 19
19/** 20/**
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index ceebd3c27892..2da411b6925b 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -36,94 +36,200 @@
36 ST_PRESS_LSB_PER_CELSIUS) 36 ST_PRESS_LSB_PER_CELSIUS)
37#define ST_PRESS_NUMBER_DATA_CHANNELS 1 37#define ST_PRESS_NUMBER_DATA_CHANNELS 1
38 38
39/* DEFAULT VALUE FOR SENSORS */
40#define ST_PRESS_DEFAULT_OUT_XL_ADDR 0x28
41#define ST_TEMP_DEFAULT_OUT_L_ADDR 0x2b
42
43/* FULLSCALE */ 39/* FULLSCALE */
44#define ST_PRESS_FS_AVL_1260MB 1260 40#define ST_PRESS_FS_AVL_1260MB 1260
45 41
46/* CUSTOM VALUES FOR SENSOR 1 */ 42/* CUSTOM VALUES FOR LPS331AP SENSOR */
47#define ST_PRESS_1_WAI_EXP 0xbb 43#define ST_PRESS_LPS331AP_WAI_EXP 0xbb
48#define ST_PRESS_1_ODR_ADDR 0x20 44#define ST_PRESS_LPS331AP_ODR_ADDR 0x20
49#define ST_PRESS_1_ODR_MASK 0x70 45#define ST_PRESS_LPS331AP_ODR_MASK 0x70
50#define ST_PRESS_1_ODR_AVL_1HZ_VAL 0x01 46#define ST_PRESS_LPS331AP_ODR_AVL_1HZ_VAL 0x01
51#define ST_PRESS_1_ODR_AVL_7HZ_VAL 0x05 47#define ST_PRESS_LPS331AP_ODR_AVL_7HZ_VAL 0x05
52#define ST_PRESS_1_ODR_AVL_13HZ_VAL 0x06 48#define ST_PRESS_LPS331AP_ODR_AVL_13HZ_VAL 0x06
53#define ST_PRESS_1_ODR_AVL_25HZ_VAL 0x07 49#define ST_PRESS_LPS331AP_ODR_AVL_25HZ_VAL 0x07
54#define ST_PRESS_1_PW_ADDR 0x20 50#define ST_PRESS_LPS331AP_PW_ADDR 0x20
55#define ST_PRESS_1_PW_MASK 0x80 51#define ST_PRESS_LPS331AP_PW_MASK 0x80
56#define ST_PRESS_1_FS_ADDR 0x23 52#define ST_PRESS_LPS331AP_FS_ADDR 0x23
57#define ST_PRESS_1_FS_MASK 0x30 53#define ST_PRESS_LPS331AP_FS_MASK 0x30
58#define ST_PRESS_1_FS_AVL_1260_VAL 0x00 54#define ST_PRESS_LPS331AP_FS_AVL_1260_VAL 0x00
59#define ST_PRESS_1_FS_AVL_1260_GAIN ST_PRESS_KPASCAL_NANO_SCALE 55#define ST_PRESS_LPS331AP_FS_AVL_1260_GAIN ST_PRESS_KPASCAL_NANO_SCALE
60#define ST_PRESS_1_FS_AVL_TEMP_GAIN ST_PRESS_CELSIUS_NANO_SCALE 56#define ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN ST_PRESS_CELSIUS_NANO_SCALE
61#define ST_PRESS_1_BDU_ADDR 0x20 57#define ST_PRESS_LPS331AP_BDU_ADDR 0x20
62#define ST_PRESS_1_BDU_MASK 0x04 58#define ST_PRESS_LPS331AP_BDU_MASK 0x04
63#define ST_PRESS_1_DRDY_IRQ_ADDR 0x22 59#define ST_PRESS_LPS331AP_DRDY_IRQ_ADDR 0x22
64#define ST_PRESS_1_DRDY_IRQ_INT1_MASK 0x04 60#define ST_PRESS_LPS331AP_DRDY_IRQ_INT1_MASK 0x04
65#define ST_PRESS_1_DRDY_IRQ_INT2_MASK 0x20 61#define ST_PRESS_LPS331AP_DRDY_IRQ_INT2_MASK 0x20
66#define ST_PRESS_1_MULTIREAD_BIT true 62#define ST_PRESS_LPS331AP_MULTIREAD_BIT true
67#define ST_PRESS_1_TEMP_OFFSET 42500 63#define ST_PRESS_LPS331AP_TEMP_OFFSET 42500
68 64#define ST_PRESS_LPS331AP_OUT_XL_ADDR 0x28
69static const struct iio_chan_spec st_press_channels[] = { 65#define ST_TEMP_LPS331AP_OUT_L_ADDR 0x2b
70 ST_SENSORS_LSM_CHANNELS(IIO_PRESSURE, 66
67/* CUSTOM VALUES FOR LPS001WP SENSOR */
68#define ST_PRESS_LPS001WP_WAI_EXP 0xba
69#define ST_PRESS_LPS001WP_ODR_ADDR 0x20
70#define ST_PRESS_LPS001WP_ODR_MASK 0x30
71#define ST_PRESS_LPS001WP_ODR_AVL_1HZ_VAL 0x01
72#define ST_PRESS_LPS001WP_ODR_AVL_7HZ_VAL 0x02
73#define ST_PRESS_LPS001WP_ODR_AVL_13HZ_VAL 0x03
74#define ST_PRESS_LPS001WP_PW_ADDR 0x20
75#define ST_PRESS_LPS001WP_PW_MASK 0x40
76#define ST_PRESS_LPS001WP_BDU_ADDR 0x20
77#define ST_PRESS_LPS001WP_BDU_MASK 0x04
78#define ST_PRESS_LPS001WP_MULTIREAD_BIT true
79#define ST_PRESS_LPS001WP_OUT_L_ADDR 0x28
80#define ST_TEMP_LPS001WP_OUT_L_ADDR 0x2a
81
82static const struct iio_chan_spec st_press_lps331ap_channels[] = {
83 {
84 .type = IIO_PRESSURE,
85 .channel2 = IIO_NO_MOD,
86 .address = ST_PRESS_LPS331AP_OUT_XL_ADDR,
87 .scan_index = ST_SENSORS_SCAN_X,
88 .scan_type = {
89 .sign = 'u',
90 .realbits = 24,
91 .storagebits = 24,
92 .endianness = IIO_LE,
93 },
94 .info_mask_separate =
71 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), 95 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
72 ST_SENSORS_SCAN_X, 0, IIO_NO_MOD, 'u', IIO_LE, 24, 24, 96 .modified = 0,
73 ST_PRESS_DEFAULT_OUT_XL_ADDR), 97 },
74 ST_SENSORS_LSM_CHANNELS(IIO_TEMP, 98 {
75 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE) | 99 .type = IIO_TEMP,
76 BIT(IIO_CHAN_INFO_OFFSET), 100 .channel2 = IIO_NO_MOD,
77 -1, 0, IIO_NO_MOD, 's', IIO_LE, 16, 16, 101 .address = ST_TEMP_LPS331AP_OUT_L_ADDR,
78 ST_TEMP_DEFAULT_OUT_L_ADDR), 102 .scan_index = -1,
103 .scan_type = {
104 .sign = 'u',
105 .realbits = 16,
106 .storagebits = 16,
107 .endianness = IIO_LE,
108 },
109 .info_mask_separate =
110 BIT(IIO_CHAN_INFO_RAW) |
111 BIT(IIO_CHAN_INFO_SCALE) |
112 BIT(IIO_CHAN_INFO_OFFSET),
113 .modified = 0,
114 },
115 IIO_CHAN_SOFT_TIMESTAMP(1)
116};
117
118static const struct iio_chan_spec st_press_lps001wp_channels[] = {
119 {
120 .type = IIO_PRESSURE,
121 .channel2 = IIO_NO_MOD,
122 .address = ST_PRESS_LPS001WP_OUT_L_ADDR,
123 .scan_index = ST_SENSORS_SCAN_X,
124 .scan_type = {
125 .sign = 'u',
126 .realbits = 16,
127 .storagebits = 16,
128 .endianness = IIO_LE,
129 },
130 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
131 .modified = 0,
132 },
133 {
134 .type = IIO_TEMP,
135 .channel2 = IIO_NO_MOD,
136 .address = ST_TEMP_LPS001WP_OUT_L_ADDR,
137 .scan_index = -1,
138 .scan_type = {
139 .sign = 'u',
140 .realbits = 16,
141 .storagebits = 16,
142 .endianness = IIO_LE,
143 },
144 .info_mask_separate =
145 BIT(IIO_CHAN_INFO_RAW) |
146 BIT(IIO_CHAN_INFO_OFFSET),
147 .modified = 0,
148 },
79 IIO_CHAN_SOFT_TIMESTAMP(1) 149 IIO_CHAN_SOFT_TIMESTAMP(1)
80}; 150};
81 151
82static const struct st_sensors st_press_sensors[] = { 152static const struct st_sensors st_press_sensors[] = {
83 { 153 {
84 .wai = ST_PRESS_1_WAI_EXP, 154 .wai = ST_PRESS_LPS331AP_WAI_EXP,
85 .sensors_supported = { 155 .sensors_supported = {
86 [0] = LPS331AP_PRESS_DEV_NAME, 156 [0] = LPS331AP_PRESS_DEV_NAME,
87 }, 157 },
88 .ch = (struct iio_chan_spec *)st_press_channels, 158 .ch = (struct iio_chan_spec *)st_press_lps331ap_channels,
159 .num_ch = ARRAY_SIZE(st_press_lps331ap_channels),
89 .odr = { 160 .odr = {
90 .addr = ST_PRESS_1_ODR_ADDR, 161 .addr = ST_PRESS_LPS331AP_ODR_ADDR,
91 .mask = ST_PRESS_1_ODR_MASK, 162 .mask = ST_PRESS_LPS331AP_ODR_MASK,
92 .odr_avl = { 163 .odr_avl = {
93 { 1, ST_PRESS_1_ODR_AVL_1HZ_VAL, }, 164 { 1, ST_PRESS_LPS331AP_ODR_AVL_1HZ_VAL, },
94 { 7, ST_PRESS_1_ODR_AVL_7HZ_VAL, }, 165 { 7, ST_PRESS_LPS331AP_ODR_AVL_7HZ_VAL, },
95 { 13, ST_PRESS_1_ODR_AVL_13HZ_VAL, }, 166 { 13, ST_PRESS_LPS331AP_ODR_AVL_13HZ_VAL, },
96 { 25, ST_PRESS_1_ODR_AVL_25HZ_VAL, }, 167 { 25, ST_PRESS_LPS331AP_ODR_AVL_25HZ_VAL, },
97 }, 168 },
98 }, 169 },
99 .pw = { 170 .pw = {
100 .addr = ST_PRESS_1_PW_ADDR, 171 .addr = ST_PRESS_LPS331AP_PW_ADDR,
101 .mask = ST_PRESS_1_PW_MASK, 172 .mask = ST_PRESS_LPS331AP_PW_MASK,
102 .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE, 173 .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
103 .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE, 174 .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
104 }, 175 },
105 .fs = { 176 .fs = {
106 .addr = ST_PRESS_1_FS_ADDR, 177 .addr = ST_PRESS_LPS331AP_FS_ADDR,
107 .mask = ST_PRESS_1_FS_MASK, 178 .mask = ST_PRESS_LPS331AP_FS_MASK,
108 .fs_avl = { 179 .fs_avl = {
109 [0] = { 180 [0] = {
110 .num = ST_PRESS_FS_AVL_1260MB, 181 .num = ST_PRESS_FS_AVL_1260MB,
111 .value = ST_PRESS_1_FS_AVL_1260_VAL, 182 .value = ST_PRESS_LPS331AP_FS_AVL_1260_VAL,
112 .gain = ST_PRESS_1_FS_AVL_1260_GAIN, 183 .gain = ST_PRESS_LPS331AP_FS_AVL_1260_GAIN,
113 .gain2 = ST_PRESS_1_FS_AVL_TEMP_GAIN, 184 .gain2 = ST_PRESS_LPS331AP_FS_AVL_TEMP_GAIN,
114 }, 185 },
115 }, 186 },
116 }, 187 },
117 .bdu = { 188 .bdu = {
118 .addr = ST_PRESS_1_BDU_ADDR, 189 .addr = ST_PRESS_LPS331AP_BDU_ADDR,
119 .mask = ST_PRESS_1_BDU_MASK, 190 .mask = ST_PRESS_LPS331AP_BDU_MASK,
191 },
192 .drdy_irq = {
193 .addr = ST_PRESS_LPS331AP_DRDY_IRQ_ADDR,
194 .mask_int1 = ST_PRESS_LPS331AP_DRDY_IRQ_INT1_MASK,
195 .mask_int2 = ST_PRESS_LPS331AP_DRDY_IRQ_INT2_MASK,
196 },
197 .multi_read_bit = ST_PRESS_LPS331AP_MULTIREAD_BIT,
198 .bootime = 2,
199 },
200 {
201 .wai = ST_PRESS_LPS001WP_WAI_EXP,
202 .sensors_supported = {
203 [0] = LPS001WP_PRESS_DEV_NAME,
204 },
205 .ch = (struct iio_chan_spec *)st_press_lps001wp_channels,
206 .num_ch = ARRAY_SIZE(st_press_lps001wp_channels),
207 .odr = {
208 .addr = ST_PRESS_LPS001WP_ODR_ADDR,
209 .mask = ST_PRESS_LPS001WP_ODR_MASK,
210 .odr_avl = {
211 { 1, ST_PRESS_LPS001WP_ODR_AVL_1HZ_VAL, },
212 { 7, ST_PRESS_LPS001WP_ODR_AVL_7HZ_VAL, },
213 { 13, ST_PRESS_LPS001WP_ODR_AVL_13HZ_VAL, },
214 },
215 },
216 .pw = {
217 .addr = ST_PRESS_LPS001WP_PW_ADDR,
218 .mask = ST_PRESS_LPS001WP_PW_MASK,
219 .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
220 .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
221 },
222 .fs = {
223 .addr = 0,
224 },
225 .bdu = {
226 .addr = ST_PRESS_LPS001WP_BDU_ADDR,
227 .mask = ST_PRESS_LPS001WP_BDU_MASK,
120 }, 228 },
121 .drdy_irq = { 229 .drdy_irq = {
122 .addr = ST_PRESS_1_DRDY_IRQ_ADDR, 230 .addr = 0,
123 .mask_int1 = ST_PRESS_1_DRDY_IRQ_INT1_MASK,
124 .mask_int2 = ST_PRESS_1_DRDY_IRQ_INT2_MASK,
125 }, 231 },
126 .multi_read_bit = ST_PRESS_1_MULTIREAD_BIT, 232 .multi_read_bit = ST_PRESS_LPS001WP_MULTIREAD_BIT,
127 .bootime = 2, 233 .bootime = 2,
128 }, 234 },
129}; 235};
@@ -210,41 +316,46 @@ static const struct iio_trigger_ops st_press_trigger_ops = {
210int st_press_common_probe(struct iio_dev *indio_dev, 316int st_press_common_probe(struct iio_dev *indio_dev,
211 struct st_sensors_platform_data *plat_data) 317 struct st_sensors_platform_data *plat_data)
212{ 318{
213 int err;
214 struct st_sensor_data *pdata = iio_priv(indio_dev); 319 struct st_sensor_data *pdata = iio_priv(indio_dev);
320 int irq = pdata->get_irq_data_ready(indio_dev);
321 int err;
215 322
216 indio_dev->modes = INDIO_DIRECT_MODE; 323 indio_dev->modes = INDIO_DIRECT_MODE;
217 indio_dev->info = &press_info; 324 indio_dev->info = &press_info;
218 325
219 err = st_sensors_check_device_support(indio_dev, 326 err = st_sensors_check_device_support(indio_dev,
220 ARRAY_SIZE(st_press_sensors), st_press_sensors); 327 ARRAY_SIZE(st_press_sensors),
328 st_press_sensors);
221 if (err < 0) 329 if (err < 0)
222 goto st_press_common_probe_error; 330 return err;
223 331
224 pdata->num_data_channels = ST_PRESS_NUMBER_DATA_CHANNELS; 332 pdata->num_data_channels = ST_PRESS_NUMBER_DATA_CHANNELS;
225 pdata->multiread_bit = pdata->sensor->multi_read_bit; 333 pdata->multiread_bit = pdata->sensor->multi_read_bit;
226 indio_dev->channels = pdata->sensor->ch; 334 indio_dev->channels = pdata->sensor->ch;
227 indio_dev->num_channels = ARRAY_SIZE(st_press_channels); 335 indio_dev->num_channels = pdata->sensor->num_ch;
336
337 if (pdata->sensor->fs.addr != 0)
338 pdata->current_fullscale = (struct st_sensor_fullscale_avl *)
339 &pdata->sensor->fs.fs_avl[0];
228 340
229 pdata->current_fullscale = (struct st_sensor_fullscale_avl *)
230 &pdata->sensor->fs.fs_avl[0];
231 pdata->odr = pdata->sensor->odr.odr_avl[0].hz; 341 pdata->odr = pdata->sensor->odr.odr_avl[0].hz;
232 342
233 if (!plat_data) 343 /* Some devices don't support a data ready pin. */
344 if (!plat_data && pdata->sensor->drdy_irq.addr)
234 plat_data = 345 plat_data =
235 (struct st_sensors_platform_data *)&default_press_pdata; 346 (struct st_sensors_platform_data *)&default_press_pdata;
236 347
237 err = st_sensors_init_sensor(indio_dev, plat_data); 348 err = st_sensors_init_sensor(indio_dev, plat_data);
238 if (err < 0) 349 if (err < 0)
239 goto st_press_common_probe_error; 350 return err;
240 351
241 if (pdata->get_irq_data_ready(indio_dev) > 0) { 352 err = st_press_allocate_ring(indio_dev);
242 err = st_press_allocate_ring(indio_dev); 353 if (err < 0)
243 if (err < 0) 354 return err;
244 goto st_press_common_probe_error;
245 355
356 if (irq > 0) {
246 err = st_sensors_allocate_trigger(indio_dev, 357 err = st_sensors_allocate_trigger(indio_dev,
247 ST_PRESS_TRIGGER_OPS); 358 ST_PRESS_TRIGGER_OPS);
248 if (err < 0) 359 if (err < 0)
249 goto st_press_probe_trigger_error; 360 goto st_press_probe_trigger_error;
250 } 361 }
@@ -256,12 +367,11 @@ int st_press_common_probe(struct iio_dev *indio_dev,
256 return err; 367 return err;
257 368
258st_press_device_register_error: 369st_press_device_register_error:
259 if (pdata->get_irq_data_ready(indio_dev) > 0) 370 if (irq > 0)
260 st_sensors_deallocate_trigger(indio_dev); 371 st_sensors_deallocate_trigger(indio_dev);
261st_press_probe_trigger_error: 372st_press_probe_trigger_error:
262 if (pdata->get_irq_data_ready(indio_dev) > 0) 373 st_press_deallocate_ring(indio_dev);
263 st_press_deallocate_ring(indio_dev); 374
264st_press_common_probe_error:
265 return err; 375 return err;
266} 376}
267EXPORT_SYMBOL(st_press_common_probe); 377EXPORT_SYMBOL(st_press_common_probe);
@@ -271,10 +381,10 @@ void st_press_common_remove(struct iio_dev *indio_dev)
271 struct st_sensor_data *pdata = iio_priv(indio_dev); 381 struct st_sensor_data *pdata = iio_priv(indio_dev);
272 382
273 iio_device_unregister(indio_dev); 383 iio_device_unregister(indio_dev);
274 if (pdata->get_irq_data_ready(indio_dev) > 0) { 384 if (pdata->get_irq_data_ready(indio_dev) > 0)
275 st_sensors_deallocate_trigger(indio_dev); 385 st_sensors_deallocate_trigger(indio_dev);
276 st_press_deallocate_ring(indio_dev); 386
277 } 387 st_press_deallocate_ring(indio_dev);
278} 388}
279EXPORT_SYMBOL(st_press_common_remove); 389EXPORT_SYMBOL(st_press_common_remove);
280 390
diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
index 08aac5e6251d..51eab7fcb194 100644
--- a/drivers/iio/pressure/st_pressure_i2c.c
+++ b/drivers/iio/pressure/st_pressure_i2c.c
@@ -49,6 +49,7 @@ static int st_press_i2c_remove(struct i2c_client *client)
49} 49}
50 50
51static const struct i2c_device_id st_press_id_table[] = { 51static const struct i2c_device_id st_press_id_table[] = {
52 { LPS001WP_PRESS_DEV_NAME },
52 { LPS331AP_PRESS_DEV_NAME }, 53 { LPS331AP_PRESS_DEV_NAME },
53 {}, 54 {},
54}; 55};