<br><br><div class="gmail_quote">On 23 June 2011 19:45, Manjunatha GK <span dir="ltr"><<a href="mailto:manjugk@linaro.org">manjugk@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Grant,<br>I am trying to convert i2c-omap driver to use device tree. Since omap i2c driver uses it's own mechanism to register as platform device, I have commented out i2c device registration part from board file and trying to use DT data in probe function of i2c driver.<br>

<br>I have i2c node declared under omap4-panda.dts as:<br><br>+       i2c@48072000 {<br>+               compatible = "ti,omap_i2c";<br>+               reg = <0x48072000 0x80>;<br>+               #address-cells = <1>;<br>

+               #size-cells = <0>;<br>+<br>+               twl@48 {<br>+                       compatible = "twl6030,4030-6030";<br>+                       reg = < 0x48 >;<br>+               };<br>+       };<br>

<br>and board file is changed as:<br><br>@@ -685,6 +686,10 @@ static void __init omap4_panda_init(void)<br> {<br>        int package = OMAP_PACKAGE_CBS;<br> <br>+#ifdef CONFIG_OF<br>+       of_platform_prepare(NULL, NULL);<br>

+#endif /* CONFIG_OF */<br>+<br>        if (omap_rev() == OMAP4430_REV_ES1_0)<br>                package = OMAP_PACKAGE_CBL;<br>        omap4_mux_init(board_mux, NULL, package);<br>@@ -700,6 +705,7 @@ static void __init omap4_panda_init(void)<br>

        omap4_ehci_init();<br>        usb_musb_init(&musb_board_data);<br>        omap4_panda_display_init();<br>+       of_platform_populate(NULL, NULL, NULL, NULL);<br> }<br><br>I have commented out device registration for I2C1 in board file:<br>

<br>diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c<br>index c9d1e13..0c31f35 100644<br>--- a/arch/arm/mach-omap2/board-omap4panda.c<br>+++ b/arch/arm/mach-omap2/board-omap4panda.c<br>

@@ -409,7 +410,7 @@ static struct i2c_board_info __initdata panda_i2c_eeprom[] = {<br> <br> static int __init omap4_panda_i2c_init(void)<br> {<br>-       omap4_pmic_init("twl6030", &omap4_panda_twldata);<br>

+       //omap4_pmic_init("twl6030", &omap4_panda_twldata);<br>@@ -685,6 +686,10 @@ static void __init omap4_panda_init(void)<br> {<br>        int package = OMAP_PACKAGE_CBS;<br> <br>+#ifdef CONFIG_OF<br>+       of_platform_prepare(NULL, NULL);<br>

+#endif /* CONFIG_OF */<br>+<br>        if (omap_rev() == OMAP4430_REV_ES1_0)<br>                package = OMAP_PACKAGE_CBL;<br>        omap4_mux_init(board_mux, NULL, package);<br>@@ -700,6 +705,7 @@ static void __init omap4_panda_init(void)<br>

        omap4_ehci_init();<br>        usb_musb_init(&musb_board_data);<br>        omap4_panda_display_init();<br>+       of_platform_populate(NULL, NULL, NULL, NULL);<br> }<br><br>and i2c-omap is modified as:<br><br>
+static const struct of_device_id omap_i2c_of_match[];<br>
 static int __devinit<br> omap_i2c_probe(struct platform_device *pdev)<br> {<br>@@ -1162,6 +1169,12 @@ static int omap_i2c_resume(struct device *dev)<br>        return 0;<br> }<br> <br>+static const struct of_device_id omap_i2c_of_match[] = {<br>

+       {.compatible = "omap_i2c", },<br></blockquote><div> </div><div>I tried also with:<br> +       {.compatible = "ti,omap_i2c", },<br>still probe will not get called.<br><br>-Manjunath<br>
</div></div><br>