[PATCH v4 4/5] iio: pressure: dps310: add an OF match table
From: Paulius Zaleckas
Date: Fri Oct 16 2026 - 11:38:40 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 f2a8698e1e30..d0a2f6c6ec48 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -1043,6 +1043,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 },
{ }
@@ -1052,6 +1058,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