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

From: Paulius Zaleckas

Date: Thu Oct 15 2026 - 07:01:28 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
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 aa80d106ac44..ad3860d11592 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -1042,6 +1042,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 },
{ }
@@ -1051,6 +1057,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