<div class="gmail_quote">On Tue, May 10, 2011 at 3:03 PM, Stephen Warren <span dir="ltr"><<a href="mailto:swarren@nvidia.com">swarren@nvidia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
John Bonesio wrote at Tuesday, May 10, 2011 2:14 PM:<br>
<div class="im">> This patch changes how sdhci devices are initialized so that a later patch can<br>
> easily add support for i2c devies.<br>
><br>
> Signed-off-by: John Bonesio <<a href="mailto:bones@secretlab.ca">bones@secretlab.ca</a>><br>
<br>
</div><div class="im">> @@ -134,6 +57,25 @@ static __initdata struct tegra_clk_init_table<br>
> tegra_dt_clk_init_table[] = {<br>
> { NULL, NULL, 0, 0},<br>
> };<br>
><br>
> +static struct tegra_sdhci_platform_data sdhci_pdata1 = {<br>
> + .cd_gpio = -1,<br>
> + .wp_gpio = -1,<br>
> + .power_gpio = -1,<br>
> +};<br>
> +<br>
> +static struct tegra_sdhci_platform_data sdhci_pdata2 = {<br>
> + .cd_gpio = TEGRA_GPIO_SD2_CD,<br>
> + .wp_gpio = TEGRA_GPIO_SD2_WP,<br>
> + .power_gpio = TEGRA_GPIO_SD2_POWER,<br>
> +};<br>
> +<br>
> +static struct tegra_sdhci_platform_data sdhci_pdata4 = {<br>
> + .cd_gpio = TEGRA_GPIO_SD4_CD,<br>
> + .wp_gpio = TEGRA_GPIO_SD4_WP,<br>
> + .power_gpio = TEGRA_GPIO_SD4_POWER,<br>
> + .is_8bit = 1,<br>
> +};<br>
> +<br>
<br>
</div>So I understand why board-dt is itself registering the SDHCI platform<br>
devices itself; so that the pdev initialization path is identical<br>
between fully hard-coded boards and board-dt.c.<br>
<br>
However, I'm surprised that we would include the platform data for<br>
those devices within that argument; if we do that, we'll end up needing<br>
different platform data for every board, and devicetree won't have<br>
bought us anything.<br>
<br>
In other words, I understood that board-dt would register all the<br>
platform devices within Tegra, but not set up any of the plataform<br>
data, and the device drivers for those devices would be updated to<br>
get their platform data from devicetree if available, then fall back<br>
to old-style platform data. In other words, the way the SDHCI drivers<br>
work today in the devicetree/test branch.<br>
<br>
If my understanding is correct, shouldn't the chunk above and the<br>
one below be removed?<br></blockquote><div><br></div><div>That's if we cut everything over, I think. until then, this code should fill in the platform_device and register it. But the values should come from the device tree, and it should only register the controllers that are in the tree (and not marked as disabled).</div>
<div><br></div><div><br></div><div>-Olof</div><div><br></div></div>