Re: [PATCH v2 6/6] iio: pressure: dps310: add Zilltek ZTS8032 support

From: Andy Shevchenko

Date: Tue Oct 13 2026 - 13:24:37 EST


On Tue, Oct 13, 2026 at 02:21:24PM +0300, Paulius Zaleckas wrote:
> The Zilltek ZTS8032 has the DPS310 register map, scale factors and
> compensation, with these differences:
>
> - two more pressure coefficients, c31 and c40 at 0x22-0x25, adding
> c40 * Praw_sc^4 + c31 * Traw_sc * Praw_sc^3 to the polynomial
> - TMP_EXT is MEAS_CFG bit 3, and the temperature coefficients are for
> the internal sensor (COEF_SRCE reads 0x06). TMP_CFG bit 7 is the top
> bit of a 4-bit TMP_RATE, so the DPS310 TMP_EXT write would select a
> 25/16 Hz background rate instead of the external sensor.
> - product ID 0x11 instead of 0x10, the driver does not check it
>
> Add its chip data, reading 22 coefficient bytes and leaving TMP_CFG at
> 0, and the I2C and OF IDs.
>
> Tested on a ZTS8032 at 0x76 over I2C: in_pressure_input is within 1 Pa
> of the datasheet formula evaluated from the raw and coefficient
> registers at every oversampling rate from 1 to 128, and TMP_CFG reads
> 0x00 after probe.

...

> help
> - Support for the Infineon DPS310 digital barometric pressure sensor.
> - It can be accessed over I2C bus.
> + Support for the Infineon DPS310 and Zilltek ZTS8032 digital
> + barometric pressure sensors. They can be accessed over I2C bus.

Please, format it to be scalable:

Support for the following digital barometric pressure sensors:
- Infineon DPS310
- Zilltek ZTS8032
They can be accessed over I2C bus.

> This driver can also be built as a module. If so, the module will be
> called dps310.

...

> * https://www.infineon.com/dgdl/?fileId=5546d462576f34750157750826c42242
> *
> + * The Zilltek ZTS8032 is register compatible, with two more pressure
> + * calibration coefficients (c31, c40) and temperature calibrated against
> + * the internal sensor.

Any datasheet link?

...

> - u8 coef[DPS310_COEF_LEN];
> + u8 coef[ZTS8032_COEF_LEN];

I would add

#define MAX_COEF_LEN 18

to the first patch along with the HW specific define and use here (in that patch)

u8 coef[MAX_COEF_LEN];

so, in this patch you will just add a new HW definition and bump

#define MAX_COEF_LEN 22

...

> + if (data->info->coef_len == ZTS8032_COEF_LEN) {

This is a bit fragile. What if it will be HW in the future that has 22+ size
but incompatible with ZTS case?

> + data->c31 = sign_extend32((coef[18] << 8) | coef[19], 15);
> + data->c40 = sign_extend32((coef[20] << 8) | coef[21], 15);
> + }

--
With Best Regards,
Andy Shevchenko