devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Manjunathappa, Prakash" <prakash.pm@ti.com>
To: linux-mmc@vger.kernel.org
Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com,
	rob@landley.net, linux@arm.linux.org.uk, nsekhar@ti.com,
	hs@denx.de, devicetree-discuss@lists.ozlabs.org,
	linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	cjb@laptop.org, davinci-linux-open-source@linux.davincidsp.com,
	"Manjunathappa, Prakash" <prakash.pm@ti.com>
Subject: [PATCH v4 2/5] mmc: davinci_mmc: derive controller IP version from platform_device_id
Date: Fri, 15 Feb 2013 11:51:59 +0530	[thread overview]
Message-ID: <1360909322-1858-3-git-send-email-prakash.pm@ti.com> (raw)
In-Reply-To: <1360909322-1858-1-git-send-email-prakash.pm@ti.com>

Stop getting controller IP version via platform data, instead derive it
from platform_device_id table.

Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
Suppose to be v1 but got added later to this series.

 drivers/mmc/host/davinci_mmc.c            |   17 ++++++++++++++++-
 include/linux/platform_data/mmc-davinci.h |    3 ---
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 27123f8..874dc60 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1156,6 +1156,17 @@ static void __init init_mmcsd_host(struct mmc_davinci_host *host)
 
 	mmc_davinci_reset_ctrl(host, 0);
 }
+static struct platform_device_id davinci_mmc_devtype[] = {
+	{
+		.name	= "davinci-mmc-dm355",
+		.driver_data = MMC_CTLR_VERSION_1,
+	}, {
+		.name	= "davinci-mmc-da830",
+		.driver_data = MMC_CTLR_VERSION_2,
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(platform, davinci_mmc_devtype);
 
 static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 {
@@ -1165,6 +1176,7 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 	struct resource *r, *mem = NULL;
 	int ret = 0, irq = 0;
 	size_t mem_size;
+	const struct platform_device_id *id_entry;
 
 	/* REVISIT:  when we're fully converted, fail if pdata is NULL */
 
@@ -1239,7 +1251,9 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 	if (pdata && (pdata->wires == 8))
 		mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA);
 
-	host->version = pdata->version;
+	id_entry = platform_get_device_id(pdev);
+	if (id_entry)
+		host->version = id_entry->driver_data;
 
 	mmc->ops = &mmc_davinci_ops;
 	mmc->f_min = 312500;
@@ -1410,6 +1424,7 @@ static struct platform_driver davinci_mmcsd_driver = {
 		.pm	= davinci_mmcsd_pm_ops,
 	},
 	.remove		= __exit_p(davinci_mmcsd_remove),
+	.id_table	= davinci_mmc_devtype,
 };
 
 static int __init davinci_mmcsd_init(void)
diff --git a/include/linux/platform_data/mmc-davinci.h b/include/linux/platform_data/mmc-davinci.h
index 5ba6b22..9cea4ee 100644
--- a/include/linux/platform_data/mmc-davinci.h
+++ b/include/linux/platform_data/mmc-davinci.h
@@ -23,9 +23,6 @@ struct davinci_mmc_config {
 	/* any additional host capabilities: OR'd in to mmc->f_caps */
 	u32     caps;
 
-	/* Version of the MMC/SD controller */
-	u8	version;
-
 	/* Number of sg segments */
 	u8	nr_sg;
 };
-- 
1.7.4.1


  parent reply	other threads:[~2013-02-15  6:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15  6:21 [PATCH v4 0/5] Add DT support for davinci_mmc driver Manjunathappa, Prakash
2013-02-15  6:21 ` [PATCH v4 1/5] ARM: davinci: mmc: derive version information from device name Manjunathappa, Prakash
2013-02-27 11:45   ` Sekhar Nori
2013-03-05 11:24     ` Manjunathappa, Prakash
2013-02-15  6:21 ` Manjunathappa, Prakash [this message]
2013-02-15  6:22 ` [PATCH v4 3/5] mmc: davinci_mmc: add DT support Manjunathappa, Prakash
2013-02-27 11:43   ` Sekhar Nori
2013-03-05 11:24     ` Manjunathappa, Prakash
2013-03-05 11:46       ` Sekhar Nori
2013-02-15  6:22 ` [PATCH v4 4/5] ARM: davinci: da850: add mmc DT entries Manjunathappa, Prakash
     [not found] ` <1360909322-1858-1-git-send-email-prakash.pm-l0cyMroinI0@public.gmane.org>
2013-02-15  6:22   ` [PATCH v4 5/5] ARM: davinci: da850: override mmc DT node device name Manjunathappa, Prakash
2013-02-27 14:04     ` Rob Herring
2013-02-28 10:51       ` Sekhar Nori

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=1360909322-1858-3-git-send-email-prakash.pm@ti.com \
    --to=prakash.pm@ti.com \
    --cc=cjb@laptop.org \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=hs@denx.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nsekhar@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).