[PATCH 04/17] spi: omap: Add devicetree probe support

Sascha Hauer s.hauer at pengutronix.de
Fri Nov 22 09:48:48 EST 2013


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/spi/omap3_spi.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 136fc18..073a98f 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -404,6 +404,18 @@ static struct omap_spi_drvdata omap4_data = {
 	.register_offset = 0x100,
 };
 
+static __maybe_unused struct of_device_id omap_spi_dt_ids[] = {
+	{
+		.compatible = "ti,omap2-mcspi",
+		.data = (unsigned long)&omap3_data,
+	}, {
+		.compatible = "ti,omap4-mcspi",
+		.data = (unsigned long)&omap4_data,
+	}, {
+		/* sentinel */
+	}
+};
+
 static struct platform_device_id omap_spi_ids[] = {
 	{
 		.name = "omap3-spi",
@@ -419,6 +431,7 @@ static struct platform_device_id omap_spi_ids[] = {
 static struct driver_d omap3_spi_driver = {
 	.name = "omap-spi",
 	.probe = omap3_spi_probe,
+	.of_compatible = DRV_OF_COMPAT(omap_spi_dt_ids),
 	.id_table = omap_spi_ids,
 };
 device_platform_driver(omap3_spi_driver);
-- 
1.8.4.2




More information about the barebox mailing list