Add of_match tables for bmp280 and hdc20x0

b/135170504

Change-Id: I426d324df7f5ad80f7166ad0bddfbb0ba52b631a
diff --git a/coral-enviro-drivers/debian/changelog b/coral-enviro-drivers/debian/changelog
index b412fe6..3fee003 100644
--- a/coral-enviro-drivers/debian/changelog
+++ b/coral-enviro-drivers/debian/changelog
@@ -1,5 +1,6 @@
 coral-enviro-drivers-dkms (1.4) stable; urgency=medium
 
+  * Add of_match tables for bmp280 and hdc20x0
   * Wrap struct iio_info.driver_module in version check
   * Enforce linux-headers version (>=4.9)
 
diff --git a/coral-enviro-drivers/humidity/hdc20x0.c b/coral-enviro-drivers/humidity/hdc20x0.c
index c786ef2..53f97be 100644
--- a/coral-enviro-drivers/humidity/hdc20x0.c
+++ b/coral-enviro-drivers/humidity/hdc20x0.c
@@ -304,9 +304,17 @@
 	{} };
 MODULE_DEVICE_TABLE(i2c, hdc20x0_id);
 
+static const struct of_device_id hdc20x0_of_match[] = {
+	{ .compatible = "ti,hdc20x0" },
+	{ .compatible = "hdc20x0" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, hdc20x0_of_match);
+
 static struct i2c_driver hdc20x0_driver = {
 	.driver = {
 		.name	= HDC20X0_DRV_NAME,
+		.of_match_table = of_match_ptr(hdc20x0_of_match),
 	},
 	.probe = hdc20x0_probe,
 	.remove = hdc20x0_remove,
diff --git a/coral-enviro-drivers/pressure/bmp280.c b/coral-enviro-drivers/pressure/bmp280.c
index 2f52565..1a0a515 100644
--- a/coral-enviro-drivers/pressure/bmp280.c
+++ b/coral-enviro-drivers/pressure/bmp280.c
@@ -404,10 +404,18 @@
 };
 MODULE_DEVICE_TABLE(i2c, bmp280_id);
 
+static const struct of_device_id bmp280_of_match[] = {
+	{ .compatible = "bosch,bmp280" },
+	{ .compatible = "bmp280" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, bmp280_of_match);
+
 static struct i2c_driver bmp280_driver = {
 	.driver = {
 		.name	= "bmp280",
 		.acpi_match_table = ACPI_PTR(bmp280_acpi_match),
+		.of_match_table = of_match_ptr(bmp280_of_match),
 	},
 	.probe		= bmp280_probe,
 	.id_table	= bmp280_id,