Skip to contentSkip to conversation

i2c: Tegra: Add of_match_table

PATCH In review Stephen Warren 2 participants 2 messages Jul 14, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: Tegra: Add of_match_table

From: John Bonesio <bones-s3s/[email protected]>

This patch was intended to be part of 7ca2d1a105a239e300b937e9c41a10a4bd08f569 "i2c: Tegra: Add DeviceTree support". However, an early version of that patch, which was missing a chunk, was applied to next-i2c. This change is that missing chunk.

---
 drivers/i2c/busses/i2c-tegra.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-tegra.c +12 -0
index 5a18d6d..f2156de 100644
@@ -722,6 +722,17 @@ static int tegra_i2c_resume(struct platform_device *pdev)
 }
 #endif
 
+#if defined(CONFIG_OF)
+/* Match table for of_platform binding */
+static const struct of_device_id tegra_i2c_of_match[] __devinitconst = {
+	{ .compatible = "nvidia,tegra20-i2c", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, tegra_i2c_of_match);
+#else
+#define tegra_i2c_of_match NULL
+#endif
+
 static struct platform_driver tegra_i2c_driver = {
 	.probe   = tegra_i2c_probe,
 	.remove  = tegra_i2c_remove,
@@ -732,6 +743,7 @@ static struct platform_driver tegra_i2c_driver = {
 	.driver  = {
 		.name  = "tegra-i2c",
 		.owner = THIS_MODULE,
+		.of_match_table = tegra_i2c_of_match,
 	},
 };
 
Signature · 1 line
1.7.0.4

A message that is not in the archive (sent off-list or not yet received): 1310668465-2535-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

Acked-by
#2 lore raw
Quoted 9 lines · Stephen Warren

From: John Bonesio <bones-s3s/[email protected]>

This patch was intended to be part of 7ca2d1a105a239e300b937e9c41a10a4bd08f569 "i2c: Tegra: Add DeviceTree support". However, an early version of that patch, which was missing a chunk, was applied to next-i2c. This change is that missing chunk.

Quoted 38 lines

---
 drivers/i2c/busses/i2c-tegra.c |   12 ++++++++++++

 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-tegra.c +12 -1
index 5a18d6d..f2156de 100644
@@ -722,6 +722,17 @@ static int tegra_i2c_resume(struct platform_device *pdev)
  }
  #endif
 
+#if defined(CONFIG_OF)
+/* Match table for of_platform binding */
+static const struct of_device_id tegra_i2c_of_match[] __devinitconst = {
+       { .compatible = "nvidia,tegra20-i2c", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, tegra_i2c_of_match);
+#else
+#define tegra_i2c_of_match NULL
+#endif
+
  static struct platform_driver tegra_i2c_driver = {
        .probe   = tegra_i2c_probe,
        .remove  = tegra_i2c_remove,
@@ -732,6 +743,7 @@ static struct platform_driver tegra_i2c_driver = {
        .driver  = {
                .name  = "tegra-i2c",
                .owner = THIS_MODULE,
+               .of_match_table = tegra_i2c_of_match,
        },
  };
 
--

1.7.0.4

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.