WIP FPC-III support
[linux/fpc-iii.git] / drivers / iio / pressure / dps310.c
blob0730380ceb692e92d8d109972ff2ccfc097b4adf
1 // SPDX-License-Identifier: GPL-2.0+
2 // Copyright IBM Corp 2019
3 /*
4 * The DPS310 is a barometric pressure and temperature sensor.
5 * Currently only reading a single temperature is supported by
6 * this driver.
8 * https://www.infineon.com/dgdl/?fileId=5546d462576f34750157750826c42242
10 * Temperature calculation:
11 * c0 * 0.5 + c1 * T_raw / kT °C
13 * TODO:
14 * - Optionally support the FIFO
17 #include <linux/i2c.h>
18 #include <linux/limits.h>
19 #include <linux/math64.h>
20 #include <linux/module.h>
21 #include <linux/regmap.h>
23 #include <linux/iio/iio.h>
24 #include <linux/iio/sysfs.h>
26 #define DPS310_DEV_NAME "dps310"
28 #define DPS310_PRS_B0 0x00
29 #define DPS310_PRS_B1 0x01
30 #define DPS310_PRS_B2 0x02
31 #define DPS310_TMP_B0 0x03
32 #define DPS310_TMP_B1 0x04
33 #define DPS310_TMP_B2 0x05
34 #define DPS310_PRS_CFG 0x06
35 #define DPS310_PRS_RATE_BITS GENMASK(6, 4)
36 #define DPS310_PRS_PRC_BITS GENMASK(3, 0)
37 #define DPS310_TMP_CFG 0x07
38 #define DPS310_TMP_RATE_BITS GENMASK(6, 4)
39 #define DPS310_TMP_PRC_BITS GENMASK(3, 0)
40 #define DPS310_TMP_EXT BIT(7)
41 #define DPS310_MEAS_CFG 0x08
42 #define DPS310_MEAS_CTRL_BITS GENMASK(2, 0)
43 #define DPS310_PRS_EN BIT(0)
44 #define DPS310_TEMP_EN BIT(1)
45 #define DPS310_BACKGROUND BIT(2)
46 #define DPS310_PRS_RDY BIT(4)
47 #define DPS310_TMP_RDY BIT(5)
48 #define DPS310_SENSOR_RDY BIT(6)
49 #define DPS310_COEF_RDY BIT(7)
50 #define DPS310_CFG_REG 0x09
51 #define DPS310_INT_HL BIT(7)
52 #define DPS310_TMP_SHIFT_EN BIT(3)
53 #define DPS310_PRS_SHIFT_EN BIT(4)
54 #define DPS310_FIFO_EN BIT(5)
55 #define DPS310_SPI_EN BIT(6)
56 #define DPS310_RESET 0x0c
57 #define DPS310_RESET_MAGIC 0x09
58 #define DPS310_COEF_BASE 0x10
60 /* Make sure sleep time is <= 20ms for usleep_range */
61 #define DPS310_POLL_SLEEP_US(t) min(20000, (t) / 8)
62 /* Silently handle error in rate value here */
63 #define DPS310_POLL_TIMEOUT_US(rc) ((rc) <= 0 ? 1000000 : 1000000 / (rc))
65 #define DPS310_PRS_BASE DPS310_PRS_B0
66 #define DPS310_TMP_BASE DPS310_TMP_B0
69 * These values (defined in the spec) indicate how to scale the raw register
70 * values for each level of precision available.
72 static const int scale_factors[] = {
73 524288,
74 1572864,
75 3670016,
76 7864320,
77 253952,
78 516096,
79 1040384,
80 2088960,
83 struct dps310_data {
84 struct i2c_client *client;
85 struct regmap *regmap;
86 struct mutex lock; /* Lock for sequential HW access functions */
88 s32 c0, c1;
89 s32 c00, c10, c20, c30, c01, c11, c21;
90 s32 pressure_raw;
91 s32 temp_raw;
94 static const struct iio_chan_spec dps310_channels[] = {
96 .type = IIO_TEMP,
97 .info_mask_separate = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO) |
98 BIT(IIO_CHAN_INFO_SAMP_FREQ) |
99 BIT(IIO_CHAN_INFO_PROCESSED),
102 .type = IIO_PRESSURE,
103 .info_mask_separate = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO) |
104 BIT(IIO_CHAN_INFO_SAMP_FREQ) |
105 BIT(IIO_CHAN_INFO_PROCESSED),
109 /* To be called after checking the COEF_RDY bit in MEAS_CFG */
110 static int dps310_get_coefs(struct dps310_data *data)
112 int rc;
113 u8 coef[18];
114 u32 c0, c1;
115 u32 c00, c10, c20, c30, c01, c11, c21;
117 /* Read all sensor calibration coefficients from the COEF registers. */
118 rc = regmap_bulk_read(data->regmap, DPS310_COEF_BASE, coef,
119 sizeof(coef));
120 if (rc < 0)
121 return rc;
124 * Calculate temperature calibration coefficients c0 and c1. The
125 * numbers are 12-bit 2's complement numbers.
127 c0 = (coef[0] << 4) | (coef[1] >> 4);
128 data->c0 = sign_extend32(c0, 11);
130 c1 = ((coef[1] & GENMASK(3, 0)) << 8) | coef[2];
131 data->c1 = sign_extend32(c1, 11);
134 * Calculate pressure calibration coefficients. c00 and c10 are 20 bit
135 * 2's complement numbers, while the rest are 16 bit 2's complement
136 * numbers.
138 c00 = (coef[3] << 12) | (coef[4] << 4) | (coef[5] >> 4);
139 data->c00 = sign_extend32(c00, 19);
141 c10 = ((coef[5] & GENMASK(3, 0)) << 16) | (coef[6] << 8) | coef[7];
142 data->c10 = sign_extend32(c10, 19);
144 c01 = (coef[8] << 8) | coef[9];
145 data->c01 = sign_extend32(c01, 15);
147 c11 = (coef[10] << 8) | coef[11];
148 data->c11 = sign_extend32(c11, 15);
150 c20 = (coef[12] << 8) | coef[13];
151 data->c20 = sign_extend32(c20, 15);
153 c21 = (coef[14] << 8) | coef[15];
154 data->c21 = sign_extend32(c21, 15);
156 c30 = (coef[16] << 8) | coef[17];
157 data->c30 = sign_extend32(c30, 15);
159 return 0;
162 static int dps310_get_pres_precision(struct dps310_data *data)
164 int rc;
165 int val;
167 rc = regmap_read(data->regmap, DPS310_PRS_CFG, &val);
168 if (rc < 0)
169 return rc;
171 return BIT(val & GENMASK(2, 0));
174 static int dps310_get_temp_precision(struct dps310_data *data)
176 int rc;
177 int val;
179 rc = regmap_read(data->regmap, DPS310_TMP_CFG, &val);
180 if (rc < 0)
181 return rc;
184 * Scale factor is bottom 4 bits of the register, but 1111 is
185 * reserved so just grab bottom three
187 return BIT(val & GENMASK(2, 0));
190 /* Called with lock held */
191 static int dps310_set_pres_precision(struct dps310_data *data, int val)
193 int rc;
194 u8 shift_en;
196 if (val < 0 || val > 128)
197 return -EINVAL;
199 shift_en = val >= 16 ? DPS310_PRS_SHIFT_EN : 0;
200 rc = regmap_write_bits(data->regmap, DPS310_CFG_REG,
201 DPS310_PRS_SHIFT_EN, shift_en);
202 if (rc)
203 return rc;
205 return regmap_update_bits(data->regmap, DPS310_PRS_CFG,
206 DPS310_PRS_PRC_BITS, ilog2(val));
209 /* Called with lock held */
210 static int dps310_set_temp_precision(struct dps310_data *data, int val)
212 int rc;
213 u8 shift_en;
215 if (val < 0 || val > 128)
216 return -EINVAL;
218 shift_en = val >= 16 ? DPS310_TMP_SHIFT_EN : 0;
219 rc = regmap_write_bits(data->regmap, DPS310_CFG_REG,
220 DPS310_TMP_SHIFT_EN, shift_en);
221 if (rc)
222 return rc;
224 return regmap_update_bits(data->regmap, DPS310_TMP_CFG,
225 DPS310_TMP_PRC_BITS, ilog2(val));
228 /* Called with lock held */
229 static int dps310_set_pres_samp_freq(struct dps310_data *data, int freq)
231 u8 val;
233 if (freq < 0 || freq > 128)
234 return -EINVAL;
236 val = ilog2(freq) << 4;
238 return regmap_update_bits(data->regmap, DPS310_PRS_CFG,
239 DPS310_PRS_RATE_BITS, val);
242 /* Called with lock held */
243 static int dps310_set_temp_samp_freq(struct dps310_data *data, int freq)
245 u8 val;
247 if (freq < 0 || freq > 128)
248 return -EINVAL;
250 val = ilog2(freq) << 4;
252 return regmap_update_bits(data->regmap, DPS310_TMP_CFG,
253 DPS310_TMP_RATE_BITS, val);
256 static int dps310_get_pres_samp_freq(struct dps310_data *data)
258 int rc;
259 int val;
261 rc = regmap_read(data->regmap, DPS310_PRS_CFG, &val);
262 if (rc < 0)
263 return rc;
265 return BIT((val & DPS310_PRS_RATE_BITS) >> 4);
268 static int dps310_get_temp_samp_freq(struct dps310_data *data)
270 int rc;
271 int val;
273 rc = regmap_read(data->regmap, DPS310_TMP_CFG, &val);
274 if (rc < 0)
275 return rc;
277 return BIT((val & DPS310_TMP_RATE_BITS) >> 4);
280 static int dps310_get_pres_k(struct dps310_data *data)
282 int rc = dps310_get_pres_precision(data);
284 if (rc < 0)
285 return rc;
287 return scale_factors[ilog2(rc)];
290 static int dps310_get_temp_k(struct dps310_data *data)
292 int rc = dps310_get_temp_precision(data);
294 if (rc < 0)
295 return rc;
297 return scale_factors[ilog2(rc)];
300 static int dps310_read_pres_raw(struct dps310_data *data)
302 int rc;
303 int rate;
304 int ready;
305 int timeout;
306 s32 raw;
307 u8 val[3];
309 if (mutex_lock_interruptible(&data->lock))
310 return -EINTR;
312 rate = dps310_get_pres_samp_freq(data);
313 timeout = DPS310_POLL_TIMEOUT_US(rate);
315 /* Poll for sensor readiness; base the timeout upon the sample rate. */
316 rc = regmap_read_poll_timeout(data->regmap, DPS310_MEAS_CFG, ready,
317 ready & DPS310_PRS_RDY,
318 DPS310_POLL_SLEEP_US(timeout), timeout);
319 if (rc)
320 goto done;
322 rc = regmap_bulk_read(data->regmap, DPS310_PRS_BASE, val, sizeof(val));
323 if (rc < 0)
324 goto done;
326 raw = (val[0] << 16) | (val[1] << 8) | val[2];
327 data->pressure_raw = sign_extend32(raw, 23);
329 done:
330 mutex_unlock(&data->lock);
331 return rc;
334 /* Called with lock held */
335 static int dps310_read_temp_ready(struct dps310_data *data)
337 int rc;
338 u8 val[3];
339 s32 raw;
341 rc = regmap_bulk_read(data->regmap, DPS310_TMP_BASE, val, sizeof(val));
342 if (rc < 0)
343 return rc;
345 raw = (val[0] << 16) | (val[1] << 8) | val[2];
346 data->temp_raw = sign_extend32(raw, 23);
348 return 0;
351 static int dps310_read_temp_raw(struct dps310_data *data)
353 int rc;
354 int rate;
355 int ready;
356 int timeout;
358 if (mutex_lock_interruptible(&data->lock))
359 return -EINTR;
361 rate = dps310_get_temp_samp_freq(data);
362 timeout = DPS310_POLL_TIMEOUT_US(rate);
364 /* Poll for sensor readiness; base the timeout upon the sample rate. */
365 rc = regmap_read_poll_timeout(data->regmap, DPS310_MEAS_CFG, ready,
366 ready & DPS310_TMP_RDY,
367 DPS310_POLL_SLEEP_US(timeout), timeout);
368 if (rc < 0)
369 goto done;
371 rc = dps310_read_temp_ready(data);
373 done:
374 mutex_unlock(&data->lock);
375 return rc;
378 static bool dps310_is_writeable_reg(struct device *dev, unsigned int reg)
380 switch (reg) {
381 case DPS310_PRS_CFG:
382 case DPS310_TMP_CFG:
383 case DPS310_MEAS_CFG:
384 case DPS310_CFG_REG:
385 case DPS310_RESET:
386 /* No documentation available on the registers below */
387 case 0x0e:
388 case 0x0f:
389 case 0x62:
390 return true;
391 default:
392 return false;
396 static bool dps310_is_volatile_reg(struct device *dev, unsigned int reg)
398 switch (reg) {
399 case DPS310_PRS_B0:
400 case DPS310_PRS_B1:
401 case DPS310_PRS_B2:
402 case DPS310_TMP_B0:
403 case DPS310_TMP_B1:
404 case DPS310_TMP_B2:
405 case DPS310_MEAS_CFG:
406 case 0x32: /* No documentation available on this register */
407 return true;
408 default:
409 return false;
413 static int dps310_write_raw(struct iio_dev *iio,
414 struct iio_chan_spec const *chan, int val,
415 int val2, long mask)
417 int rc;
418 struct dps310_data *data = iio_priv(iio);
420 if (mutex_lock_interruptible(&data->lock))
421 return -EINTR;
423 switch (mask) {
424 case IIO_CHAN_INFO_SAMP_FREQ:
425 switch (chan->type) {
426 case IIO_PRESSURE:
427 rc = dps310_set_pres_samp_freq(data, val);
428 break;
430 case IIO_TEMP:
431 rc = dps310_set_temp_samp_freq(data, val);
432 break;
434 default:
435 rc = -EINVAL;
436 break;
438 break;
440 case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
441 switch (chan->type) {
442 case IIO_PRESSURE:
443 rc = dps310_set_pres_precision(data, val);
444 break;
446 case IIO_TEMP:
447 rc = dps310_set_temp_precision(data, val);
448 break;
450 default:
451 rc = -EINVAL;
452 break;
454 break;
456 default:
457 rc = -EINVAL;
458 break;
461 mutex_unlock(&data->lock);
462 return rc;
465 static int dps310_calculate_pressure(struct dps310_data *data)
467 int i;
468 int rc;
469 int t_ready;
470 int kpi = dps310_get_pres_k(data);
471 int kti = dps310_get_temp_k(data);
472 s64 rem = 0ULL;
473 s64 pressure = 0ULL;
474 s64 p;
475 s64 t;
476 s64 denoms[7];
477 s64 nums[7];
478 s64 rems[7];
479 s64 kp;
480 s64 kt;
482 if (kpi < 0)
483 return kpi;
485 if (kti < 0)
486 return kti;
488 kp = (s64)kpi;
489 kt = (s64)kti;
491 /* Refresh temp if it's ready, otherwise just use the latest value */
492 if (mutex_trylock(&data->lock)) {
493 rc = regmap_read(data->regmap, DPS310_MEAS_CFG, &t_ready);
494 if (rc >= 0 && t_ready & DPS310_TMP_RDY)
495 dps310_read_temp_ready(data);
497 mutex_unlock(&data->lock);
500 p = (s64)data->pressure_raw;
501 t = (s64)data->temp_raw;
503 /* Section 4.9.1 of the DPS310 spec; algebra'd to avoid underflow */
504 nums[0] = (s64)data->c00;
505 denoms[0] = 1LL;
506 nums[1] = p * (s64)data->c10;
507 denoms[1] = kp;
508 nums[2] = p * p * (s64)data->c20;
509 denoms[2] = kp * kp;
510 nums[3] = p * p * p * (s64)data->c30;
511 denoms[3] = kp * kp * kp;
512 nums[4] = t * (s64)data->c01;
513 denoms[4] = kt;
514 nums[5] = t * p * (s64)data->c11;
515 denoms[5] = kp * kt;
516 nums[6] = t * p * p * (s64)data->c21;
517 denoms[6] = kp * kp * kt;
519 /* Kernel lacks a div64_s64_rem function; denoms are all positive */
520 for (i = 0; i < 7; ++i) {
521 u64 irem;
523 if (nums[i] < 0LL) {
524 pressure -= div64_u64_rem(-nums[i], denoms[i], &irem);
525 rems[i] = -irem;
526 } else {
527 pressure += div64_u64_rem(nums[i], denoms[i], &irem);
528 rems[i] = (s64)irem;
532 /* Increase precision and calculate the remainder sum */
533 for (i = 0; i < 7; ++i)
534 rem += div64_s64((s64)rems[i] * 1000000000LL, denoms[i]);
536 pressure += div_s64(rem, 1000000000LL);
537 if (pressure < 0LL)
538 return -ERANGE;
540 return (int)min_t(s64, pressure, INT_MAX);
543 static int dps310_read_pressure(struct dps310_data *data, int *val, int *val2,
544 long mask)
546 int rc;
548 switch (mask) {
549 case IIO_CHAN_INFO_SAMP_FREQ:
550 rc = dps310_get_pres_samp_freq(data);
551 if (rc < 0)
552 return rc;
554 *val = rc;
555 return IIO_VAL_INT;
557 case IIO_CHAN_INFO_PROCESSED:
558 rc = dps310_read_pres_raw(data);
559 if (rc)
560 return rc;
562 rc = dps310_calculate_pressure(data);
563 if (rc < 0)
564 return rc;
566 *val = rc;
567 *val2 = 1000; /* Convert Pa to KPa per IIO ABI */
568 return IIO_VAL_FRACTIONAL;
570 case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
571 rc = dps310_get_pres_precision(data);
572 if (rc < 0)
573 return rc;
575 *val = rc;
576 return IIO_VAL_INT;
578 default:
579 return -EINVAL;
583 static int dps310_calculate_temp(struct dps310_data *data)
585 s64 c0;
586 s64 t;
587 int kt = dps310_get_temp_k(data);
589 if (kt < 0)
590 return kt;
592 /* Obtain inverse-scaled offset */
593 c0 = div_s64((s64)kt * (s64)data->c0, 2);
595 /* Add the offset to the unscaled temperature */
596 t = c0 + ((s64)data->temp_raw * (s64)data->c1);
598 /* Convert to milliCelsius and scale the temperature */
599 return (int)div_s64(t * 1000LL, kt);
602 static int dps310_read_temp(struct dps310_data *data, int *val, int *val2,
603 long mask)
605 int rc;
607 switch (mask) {
608 case IIO_CHAN_INFO_SAMP_FREQ:
609 rc = dps310_get_temp_samp_freq(data);
610 if (rc < 0)
611 return rc;
613 *val = rc;
614 return IIO_VAL_INT;
616 case IIO_CHAN_INFO_PROCESSED:
617 rc = dps310_read_temp_raw(data);
618 if (rc)
619 return rc;
621 rc = dps310_calculate_temp(data);
622 if (rc < 0)
623 return rc;
625 *val = rc;
626 return IIO_VAL_INT;
628 case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
629 rc = dps310_get_temp_precision(data);
630 if (rc < 0)
631 return rc;
633 *val = rc;
634 return IIO_VAL_INT;
636 default:
637 return -EINVAL;
641 static int dps310_read_raw(struct iio_dev *iio,
642 struct iio_chan_spec const *chan,
643 int *val, int *val2, long mask)
645 struct dps310_data *data = iio_priv(iio);
647 switch (chan->type) {
648 case IIO_PRESSURE:
649 return dps310_read_pressure(data, val, val2, mask);
651 case IIO_TEMP:
652 return dps310_read_temp(data, val, val2, mask);
654 default:
655 return -EINVAL;
659 static void dps310_reset(void *action_data)
661 struct dps310_data *data = action_data;
663 regmap_write(data->regmap, DPS310_RESET, DPS310_RESET_MAGIC);
666 static const struct regmap_config dps310_regmap_config = {
667 .reg_bits = 8,
668 .val_bits = 8,
669 .writeable_reg = dps310_is_writeable_reg,
670 .volatile_reg = dps310_is_volatile_reg,
671 .cache_type = REGCACHE_RBTREE,
672 .max_register = 0x62, /* No documentation available on this register */
675 static const struct iio_info dps310_info = {
676 .read_raw = dps310_read_raw,
677 .write_raw = dps310_write_raw,
681 * Some verions of chip will read temperatures in the ~60C range when
682 * its actually ~20C. This is the manufacturer recommended workaround
683 * to correct the issue. The registers used below are undocumented.
685 static int dps310_temp_workaround(struct dps310_data *data)
687 int rc;
688 int reg;
690 rc = regmap_read(data->regmap, 0x32, &reg);
691 if (rc < 0)
692 return rc;
695 * If bit 1 is set then the device is okay, and the workaround does not
696 * need to be applied
698 if (reg & BIT(1))
699 return 0;
701 rc = regmap_write(data->regmap, 0x0e, 0xA5);
702 if (rc < 0)
703 return rc;
705 rc = regmap_write(data->regmap, 0x0f, 0x96);
706 if (rc < 0)
707 return rc;
709 rc = regmap_write(data->regmap, 0x62, 0x02);
710 if (rc < 0)
711 return rc;
713 rc = regmap_write(data->regmap, 0x0e, 0x00);
714 if (rc < 0)
715 return rc;
717 return regmap_write(data->regmap, 0x0f, 0x00);
720 static int dps310_probe(struct i2c_client *client,
721 const struct i2c_device_id *id)
723 struct dps310_data *data;
724 struct iio_dev *iio;
725 int rc, ready;
727 iio = devm_iio_device_alloc(&client->dev, sizeof(*data));
728 if (!iio)
729 return -ENOMEM;
731 data = iio_priv(iio);
732 data->client = client;
733 mutex_init(&data->lock);
735 iio->name = id->name;
736 iio->channels = dps310_channels;
737 iio->num_channels = ARRAY_SIZE(dps310_channels);
738 iio->info = &dps310_info;
739 iio->modes = INDIO_DIRECT_MODE;
741 data->regmap = devm_regmap_init_i2c(client, &dps310_regmap_config);
742 if (IS_ERR(data->regmap))
743 return PTR_ERR(data->regmap);
745 /* Register to run the device reset when the device is removed */
746 rc = devm_add_action_or_reset(&client->dev, dps310_reset, data);
747 if (rc)
748 return rc;
751 * Set up pressure sensor in single sample, one measurement per second
752 * mode
754 rc = regmap_write(data->regmap, DPS310_PRS_CFG, 0);
757 * Set up external (MEMS) temperature sensor in single sample, one
758 * measurement per second mode
760 rc = regmap_write(data->regmap, DPS310_TMP_CFG, DPS310_TMP_EXT);
761 if (rc < 0)
762 return rc;
764 /* Temp and pressure shifts are disabled when PRC <= 8 */
765 rc = regmap_write_bits(data->regmap, DPS310_CFG_REG,
766 DPS310_PRS_SHIFT_EN | DPS310_TMP_SHIFT_EN, 0);
767 if (rc < 0)
768 return rc;
770 /* MEAS_CFG doesn't update correctly unless first written with 0 */
771 rc = regmap_write_bits(data->regmap, DPS310_MEAS_CFG,
772 DPS310_MEAS_CTRL_BITS, 0);
773 if (rc < 0)
774 return rc;
776 /* Turn on temperature and pressure measurement in the background */
777 rc = regmap_write_bits(data->regmap, DPS310_MEAS_CFG,
778 DPS310_MEAS_CTRL_BITS, DPS310_PRS_EN |
779 DPS310_TEMP_EN | DPS310_BACKGROUND);
780 if (rc < 0)
781 return rc;
784 * Calibration coefficients required for reporting temperature.
785 * They are available 40ms after the device has started
787 rc = regmap_read_poll_timeout(data->regmap, DPS310_MEAS_CFG, ready,
788 ready & DPS310_COEF_RDY, 10000, 40000);
789 if (rc < 0)
790 return rc;
792 rc = dps310_get_coefs(data);
793 if (rc < 0)
794 return rc;
796 rc = dps310_temp_workaround(data);
797 if (rc < 0)
798 return rc;
800 rc = devm_iio_device_register(&client->dev, iio);
801 if (rc)
802 return rc;
804 i2c_set_clientdata(client, iio);
806 return 0;
809 static const struct i2c_device_id dps310_id[] = {
810 { DPS310_DEV_NAME, 0 },
813 MODULE_DEVICE_TABLE(i2c, dps310_id);
815 static struct i2c_driver dps310_driver = {
816 .driver = {
817 .name = DPS310_DEV_NAME,
819 .probe = dps310_probe,
820 .id_table = dps310_id,
822 module_i2c_driver(dps310_driver);
824 MODULE_AUTHOR("Joel Stanley <joel@jms.id.au>");
825 MODULE_DESCRIPTION("Infineon DPS310 pressure and temperature sensor");
826 MODULE_LICENSE("GPL v2");