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

From: Andy Shevchenko

Date: Mon Oct 12 2026 - 16:49:17 EST


On Mon, Oct 12, 2026 at 02:45:50PM +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 a per-chip table holding the coefficient count and the TMP_CFG
> startup value, and an OF match table to select it.
>
> 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.

...

> #include <linux/math64.h>

> +#include <linux/mod_devicetable.h>

No. This should be guaranteed by the respective bus header.

> #include <linux/module.h>
> #include <linux/regmap.h>
> #include <linux/unaligned.h>

...

> + data->info = i2c_get_match_data(client);
> + if (!data->info)
> + return -ENODEV;

-ENODATA

...

> static const struct i2c_device_id dps310_id[] = {
> - { .name = DPS310_DEV_NAME },
> + { .name = "dps310", .driver_data = (kernel_ulong_t)&dps310_chip_info },
> + { .name = "zts8032", .driver_data = (kernel_ulong_t)&zts8032_chip_info },

Using driver_data should be in a separate change.

> { }
> };
> MODULE_DEVICE_TABLE(i2c, dps310_id);
>
> +static const struct of_device_id dps310_of_match[] = {
> + { .compatible = "infineon,dps310", .data = &dps310_chip_info },
> + { .compatible = "zilltek,zts8032", .data = &zts8032_chip_info },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, dps310_of_match);

Adding OF table should be in a separate change.

...

Hence this patch should be split to three (or more if there are more logical
changes).

--
With Best Regards,
Andy Shevchenko