[PATCH v5 4/5] iio: pressure: dps310: add an OF match table

From: Paulius Zaleckas

Date: Mon Oct 19 2026 - 04:37:05 EST


Devicetree nodes match the driver only through the I2C ID table fallback.
Add an OF match table, so the chip data comes from the compatible and the
module autoloads from the of: modalias the I2C core reports for
devicetree devices.

Assisted-by: LLM
Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@xxxxxxxxx>
---
drivers/iio/pressure/dps310.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
index bfd76f2deed9..999ae4ce73f7 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -1422,6 +1422,12 @@ static const struct i2c_device_id dps310_id[] = {
};
MODULE_DEVICE_TABLE(i2c, dps310_id);

+static const struct of_device_id dps310_of_match[] = {
+ { .compatible = "infineon,dps310", .data = &dps310_chip_info },
+ { }
+};
+MODULE_DEVICE_TABLE(of, dps310_of_match);
+
static const struct acpi_device_id dps310_acpi_match[] = {
{ .id = "IFX3100", .driver_data = (kernel_ulong_t)&dps310_chip_info },
{ }
@@ -1431,6 +1437,7 @@ MODULE_DEVICE_TABLE(acpi, dps310_acpi_match);
static struct i2c_driver dps310_driver = {
.driver = {
.name = DPS310_DEV_NAME,
+ .of_match_table = dps310_of_match,
.acpi_match_table = dps310_acpi_match,
},
.probe = dps310_probe,
--
2.55.0