All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Bonesio <bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org
Cc: glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
	olofj-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org
Subject: [RFC 1/2] ARM: Tegra: Device Tree Support: Update how sdhci devices are initialized
Date: Tue, 10 May 2011 13:14:21 -0700	[thread overview]
Message-ID: <20110510201414.22693.7427.stgit@riker> (raw)
In-Reply-To: <20110510201108.22693.50319.stgit@riker>

This patch changes how sdhci devices are initialized so that a later patch can
easily add support for i2c devies.

Signed-off-by: John Bonesio <bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---

 arch/arm/mach-tegra/Makefile   |    1 
 arch/arm/mach-tegra/board-dt.c |  106 ++++++++++------------------------------
 2 files changed, 27 insertions(+), 80 deletions(-)

diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 842ec1a..54d2215 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -31,6 +31,7 @@ obj-${CONFIG_MACH_SEABOARD}             += board-seaboard.o
 obj-${CONFIG_MACH_SEABOARD}             += board-seaboard-pinmux.o
 
 obj-${CONFIG_MACH_TEGRA_DT}             += board-dt.o
+obj-${CONFIG_MACH_TEGRA_DT}             += board-harmony-pinmux.o
 
 obj-${CONFIG_MACH_TRIMSLICE}            += board-trimslice.o
 obj-${CONFIG_MACH_TRIMSLICE}            += board-trimslice-pinmux.o
diff --git a/arch/arm/mach-tegra/board-dt.c b/arch/arm/mach-tegra/board-dt.c
index 9a35741..e61d563 100644
--- a/arch/arm/mach-tegra/board-dt.c
+++ b/arch/arm/mach-tegra/board-dt.c
@@ -36,90 +36,13 @@
 
 #include <mach/iomap.h>
 #include <mach/irqs.h>
+#include <mach/sdhci.h>
 
 #include "board.h"
 #include "board-harmony.h"
 #include "clock.h"
-
-static struct resource sdhci_resource1[] = {
-	[0] = {
-		.start  = INT_SDMMC1,
-		.end    = INT_SDMMC1,
-		.flags  = IORESOURCE_IRQ,
-	},
-	[1] = {
-		.start	= TEGRA_SDMMC1_BASE,
-		.end	= TEGRA_SDMMC1_BASE + TEGRA_SDMMC1_SIZE-1,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device tegra_sdhci_device1 = {
-	.name		= "sdhci-tegra",
-	.id		= 0,
-	.resource	= sdhci_resource1,
-	.num_resources	= ARRAY_SIZE(sdhci_resource1),
-};
-
-static struct resource sdhci_resource2[] = {
-	[0] = {
-		.start  = INT_SDMMC2,
-		.end    = INT_SDMMC2,
-		.flags  = IORESOURCE_IRQ,
-	},
-	[1] = {
-		.start	= TEGRA_SDMMC2_BASE,
-		.end	= TEGRA_SDMMC2_BASE + TEGRA_SDMMC2_SIZE-1,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device tegra_sdhci_device2 = {
-	.name		= "sdhci-tegra",
-	.id		= 1,
-	.resource	= sdhci_resource2,
-	.num_resources	= ARRAY_SIZE(sdhci_resource2),
-};
-
-static struct resource sdhci_resource3[] = {
-	[0] = {
-		.start  = INT_SDMMC3,
-		.end    = INT_SDMMC3,
-		.flags  = IORESOURCE_IRQ,
-	},
-	[1] = {
-		.start	= TEGRA_SDMMC3_BASE,
-		.end	= TEGRA_SDMMC3_BASE + TEGRA_SDMMC3_SIZE-1,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device tegra_sdhci_device3 = {
-	.name		= "sdhci-tegra",
-	.id		= 2,
-	.resource	= sdhci_resource3,
-	.num_resources	= ARRAY_SIZE(sdhci_resource3),
-};
-
-static struct resource sdhci_resource4[] = {
-	[0] = {
-		.start  = INT_SDMMC4,
-		.end    = INT_SDMMC4,
-		.flags  = IORESOURCE_IRQ,
-	},
-	[1] = {
-		.start	= TEGRA_SDMMC4_BASE,
-		.end	= TEGRA_SDMMC4_BASE + TEGRA_SDMMC4_SIZE-1,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device tegra_sdhci_device4 = {
-	.name		= "sdhci-tegra",
-	.id		= 3,
-	.resource	= sdhci_resource4,
-	.num_resources	= ARRAY_SIZE(sdhci_resource4),
-};
+#include "devices.h"
+#include "gpio-names.h"
 
 static struct platform_device *harmony_devices[] __initdata = {
 	&tegra_sdhci_device1,
@@ -134,6 +57,25 @@ static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
 	{ NULL,		NULL,		0,		0},
 };
 
+static struct tegra_sdhci_platform_data sdhci_pdata1 = {
+	.cd_gpio        = -1,
+	.wp_gpio        = -1,
+	.power_gpio     = -1,
+};
+
+static struct tegra_sdhci_platform_data sdhci_pdata2 = {
+	.cd_gpio        = TEGRA_GPIO_SD2_CD,
+	.wp_gpio        = TEGRA_GPIO_SD2_WP,
+	.power_gpio     = TEGRA_GPIO_SD2_POWER,
+};
+
+static struct tegra_sdhci_platform_data sdhci_pdata4 = {
+	.cd_gpio        = TEGRA_GPIO_SD4_CD,
+	.wp_gpio        = TEGRA_GPIO_SD4_WP,
+	.power_gpio     = TEGRA_GPIO_SD4_POWER,
+	.is_8bit        = 1,
+};
+
 static struct of_device_id tegra_dt_match_table[] __initdata = {
 	{ .compatible = "simple-bus", },
 	{}
@@ -164,6 +106,10 @@ static void __init tegra_dt_init(void)
 
 	harmony_pinmux_init();
 
+	tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
+	tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
+	tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
+
 	platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
 
 	/*

  reply	other threads:[~2011-05-10 20:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 20:14 [RFC 0/2] Tegra Harmony: Device Tree Initial Steps John Bonesio
2011-05-10 20:14 ` John Bonesio [this message]
2011-05-10 22:03   ` [RFC 1/2] ARM: Tegra: Device Tree Support: Update how sdhci devices are initialized Stephen Warren
     [not found]     ` <74CDBE0F657A3D45AFBB94109FB122FF04986AA06A-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-10 22:06       ` Olof Johansson
     [not found]         ` <BANLkTingm7PCJPC-xCremYg_Ab7qFvPSag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-10 22:16           ` Stephen Warren
2011-05-10 22:16             ` Stephen Warren
     [not found]             ` <74CDBE0F657A3D45AFBB94109FB122FF04986AA077-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-10 22:33               ` John Bonesio
2011-05-10 22:33                 ` John Bonesio
     [not found]                 ` <4DC9BD39.30108-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-05-10 22:42                   ` Mark Brown
2011-05-10 22:42                     ` Mark Brown
2011-05-10 23:22                   ` Stephen Warren
2011-05-10 23:22                     ` Stephen Warren
     [not found]                     ` <74CDBE0F657A3D45AFBB94109FB122FF04986AA0A6-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-10 23:33                       ` John Bonesio
2011-05-10 23:33                         ` John Bonesio
2011-05-10 23:33                         ` John Bonesio
     [not found]                         ` <4DC9CB47.9000900-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-05-11  5:01                           ` Stephen Warren
2011-05-11  5:01                             ` Stephen Warren
     [not found]                             ` <74CDBE0F657A3D45AFBB94109FB122FF04986AA0E4-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-11 17:40                               ` John Bonesio
2011-05-11 17:40                                 ` John Bonesio
2011-05-11 18:21                               ` Grant Likely
2011-05-11 18:21                                 ` Grant Likely
2011-05-10 20:14 ` [RFC 2/2] ARM: Tegra: Device Tree Support: Add i2c devices John Bonesio
2011-05-10 22:10   ` Stephen Warren
     [not found]     ` <74CDBE0F657A3D45AFBB94109FB122FF04986AA070-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-10 22:41       ` John Bonesio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110510201414.22693.7427.stgit@riker \
    --to=bones-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=olofj-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.