Skip to contentSkip to conversation

SD/MMC driver for MX25/35/51

PATCH New Wolfram Sang 2 participants 11 messages Oct 15, 2010 – Oct 19, 2010

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

v5 cover SD/MMC driver for MX25/35/51

Another try. The driver seems to be known by now and used already :) Minor fixes only:

3/6: Rename a variable (found while working on write-protect-pin support) 5/6: Tested the checkpatch fixes
6/6: Added Kconfig dependencies

The series is based on mmc-next as of today and also available at

	git://git.pengutronix.de/git/wsa/linux-2.6.git pcm043-mmc

Thanks,

Wolfram

Wolfram Sang (6):
mmc: sdhci-pltfm: Add structure for host-specific data
mmc: sdhci-pltfm: move .h-file into apropriate subdir
mmc: sdhci: introduce private get_ro
mmc: sdhci_pltfm: pass more data on custom init-call
mmc: sdhci-of-esdhc: factor out common stuff
mmc: sdhci-pltfm: add pltfm-driver for imx35/51

 drivers/mmc/host/Kconfig           |   10 +++
 drivers/mmc/host/Makefile          |    1 +
 drivers/mmc/host/sdhci-cns3xxx.c   |    2 +-
 drivers/mmc/host/sdhci-esdhc-imx.c |  143 ++++++++++++++++++++++++++++++++++++
 drivers/mmc/host/sdhci-esdhc.h     |   83 +++++++++++++++++++++
 drivers/mmc/host/sdhci-of-esdhc.c  |   70 ++----------------
 drivers/mmc/host/sdhci-pltfm.c     |   23 ++++--
 drivers/mmc/host/sdhci-pltfm.h     |   10 ++-
 drivers/mmc/host/sdhci.c           |   15 ++--
 drivers/mmc/host/sdhci.h           |    1 +
 include/linux/mmc/sdhci-pltfm.h    |   35 +++++++++
 include/linux/sdhci-pltfm.h        |   35 ---------
 12 files changed, 316 insertions(+), 112 deletions(-)
 create mode 100644 drivers/mmc/host/sdhci-esdhc-imx.c
 create mode 100644 drivers/mmc/host/sdhci-esdhc.h
 create mode 100644 include/linux/mmc/sdhci-pltfm.h
 delete mode 100644 include/linux/sdhci-pltfm.h
#1 lore raw

PATCH v5 1/6 mmc: sdhci-pltfm: Add structure for host-specific data

We need to carry some information per host, e.g. the clock. Add a structure for it and initialize it in the generic part. Also improve the check for a parent.

Cc Richard R?jfors <[email protected]>
---
 drivers/mmc/host/sdhci-pltfm.c |   10 +++++++---
 drivers/mmc/host/sdhci-pltfm.h |    7 +++++++
 2 files changed, 14 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-pltfm.c +7 -3
index 4f126de..730fdf5 100644
@@ -55,6 +55,7 @@ static int __devinit sdhci_pltfm_probe(struct platform_device *pdev)
 	struct sdhci_pltfm_data *pdata = pdev->dev.platform_data;
 	const struct platform_device_id *platid = platform_get_device_id(pdev);
 	struct sdhci_host *host;
+	struct sdhci_pltfm_host *pltfm_host;
 	struct resource *iomem;
 	int ret;
 
@@ -71,16 +72,19 @@ static int __devinit sdhci_pltfm_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "Invalid iomem size. You may "
 			"experience problems.\n");
 
-	if (pdev->dev.parent)
-		host = sdhci_alloc_host(pdev->dev.parent, 0);
+	/* Some PCI-based MFD need the parent here */
+	if (pdev->dev.parent != &platform_bus)
+		host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host));
 	else
-		host = sdhci_alloc_host(&pdev->dev, 0);
+		host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));
 
 	if (IS_ERR(host)) {
 		ret = PTR_ERR(host);
 		goto err;
 	}
 
+	pltfm_host = sdhci_priv(host);
+
 	host->hw_name = "platform";
 	if (pdata && pdata->ops)
 		host->ops = pdata->ops;
drivers/mmc/host/sdhci-pltfm.h +7 -0
index 900f329..93a0319 100644
@@ -11,8 +11,15 @@
 #ifndef _DRIVERS_MMC_SDHCI_PLTFM_H
 #define _DRIVERS_MMC_SDHCI_PLTFM_H
 
+#include <linux/clk.h>
+#include <linux/types.h>
 #include <linux/sdhci-pltfm.h>
 
+struct sdhci_pltfm_host {
+	struct clk *clk;
+	u32 scratchpad; /* to handle quirks across io-accessor calls */
+};
+
 extern struct sdhci_pltfm_data sdhci_cns3xxx_pdata;
 
 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */
Signature · 1 line
1.7.1
#2 lore raw

PATCH v5 2/6 mmc: sdhci-pltfm: move .h-file into apropriate subdir

In reply to Wolfram Sang

Make use of the mmc-directory.

---
 drivers/mmc/host/sdhci-cns3xxx.c |    2 +-
 drivers/mmc/host/sdhci-pltfm.c   |    2 +-
 drivers/mmc/host/sdhci-pltfm.h   |    2 +-
 include/linux/mmc/sdhci-pltfm.h  |   35 +++++++++++++++++++++++++++++++++++
 include/linux/sdhci-pltfm.h      |   35 -----------------------------------
 5 files changed, 38 insertions(+), 38 deletions(-)
 create mode 100644 include/linux/mmc/sdhci-pltfm.h
 delete mode 100644 include/linux/sdhci-pltfm.h
drivers/mmc/host/sdhci-cns3xxx.c +1 -1
index b7050b3..9ebd1d7 100644
@@ -15,7 +15,7 @@
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/mmc/host.h>
-#include <linux/sdhci-pltfm.h>
+#include <linux/mmc/sdhci-pltfm.h>
 #include <mach/cns3xxx.h>
 #include "sdhci.h"
 #include "sdhci-pltfm.h"
drivers/mmc/host/sdhci-pltfm.c +1 -1
index 730fdf5..685202b 100644
@@ -30,7 +30,7 @@
 #include <linux/mmc/host.h>
 
 #include <linux/io.h>
-#include <linux/sdhci-pltfm.h>
+#include <linux/mmc/sdhci-pltfm.h>
 
 #include "sdhci.h"
 #include "sdhci-pltfm.h"
drivers/mmc/host/sdhci-pltfm.h +1 -1
index 93a0319..562b929 100644
@@ -13,7 +13,7 @@
 
 #include <linux/clk.h>
 #include <linux/types.h>
-#include <linux/sdhci-pltfm.h>
+#include <linux/mmc/sdhci-pltfm.h>
 
 struct sdhci_pltfm_host {
 	struct clk *clk;
include/linux/mmc/sdhci-pltfm.h new file +35 -0
new file mode 100644
index 0000000..0239bd7
@@ -0,0 +1,35 @@
+/*
+ * Platform data declarations for the sdhci-pltfm driver.
+ *
+ * Copyright (c) 2010 MontaVista Software, LLC.
+ *
+ * Author: Anton Vorontsov <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+
+#ifndef _SDHCI_PLTFM_H
+#define _SDHCI_PLTFM_H
+
+struct sdhci_ops;
+struct sdhci_host;
+
+/**
+ * struct sdhci_pltfm_data - SDHCI platform-specific information & hooks
+ * @ops: optional pointer to the platform-provided SDHCI ops
+ * @quirks: optional SDHCI quirks
+ * @init: optional hook that is called during device probe, before the
+ *        driver tries to access any SDHCI registers
+ * @exit: optional hook that is called during device removal
+ */
+struct sdhci_pltfm_data {
+	struct sdhci_ops *ops;
+	unsigned int quirks;
+	int (*init)(struct sdhci_host *host);
+	void (*exit)(struct sdhci_host *host);
+};
+
+#endif /* _SDHCI_PLTFM_H */
include/linux/sdhci-pltfm.h deleted +0 -35
deleted file mode 100644
index 0239bd7..0000000
@@ -1,35 +0,0 @@
-/*
- * Platform data declarations for the sdhci-pltfm driver.
- *
- * Copyright (c) 2010 MontaVista Software, LLC.
- *
- * Author: Anton Vorontsov <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- */
-
-#ifndef _SDHCI_PLTFM_H
-#define _SDHCI_PLTFM_H
-
-struct sdhci_ops;
-struct sdhci_host;
-
-/**
- * struct sdhci_pltfm_data - SDHCI platform-specific information & hooks
- * @ops: optional pointer to the platform-provided SDHCI ops
- * @quirks: optional SDHCI quirks
- * @init: optional hook that is called during device probe, before the
- *        driver tries to access any SDHCI registers
- * @exit: optional hook that is called during device removal
- */
-struct sdhci_pltfm_data {
-	struct sdhci_ops *ops;
-	unsigned int quirks;
-	int (*init)(struct sdhci_host *host);
-	void (*exit)(struct sdhci_host *host);
-};
-
-#endif /* _SDHCI_PLTFM_H */
Signature · 1 line
1.7.1
#3 lore raw

PATCH v5 3/6 mmc: sdhci: introduce private get_ro

In reply to Wolfram Sang

Some controllers handle their write-protection differently. Introduce a callback to be able to handle it, ensuring the same locking takes place for it. Rename the status variable to make it more obvious why the read from the registers needs to be inverted.

---

Changes since last version:

rename the variable to make usage of '!' more obvious

 drivers/mmc/host/sdhci.c |   15 +++++++++------
 drivers/mmc/host/sdhci.h |    1 +
 2 files changed, 10 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci.c +9 -6
index 9cb60ba..782c0ee 100644
@@ -1223,22 +1223,25 @@ static int sdhci_get_ro(struct mmc_host *mmc)
 {
 	struct sdhci_host *host;
 	unsigned long flags;
-	int present;
+	int is_readonly;
 
 	host = mmc_priv(mmc);
 
 	spin_lock_irqsave(&host->lock, flags);
 
 	if (host->flags & SDHCI_DEVICE_DEAD)
-		present = 0;
+		is_readonly = 0;
+	else if (host->ops->get_ro)
+		is_readonly = host->ops->get_ro(host);
 	else
-		present = sdhci_readl(host, SDHCI_PRESENT_STATE);
+		is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE)
+				& SDHCI_WRITE_PROTECT);
 
 	spin_unlock_irqrestore(&host->lock, flags);
 
-	if (host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT)
-		return !!(present & SDHCI_WRITE_PROTECT);
-	return !(present & SDHCI_WRITE_PROTECT);
+	/* This quirk needs to be replaced by a callback-function later */
+	return host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT ?
+		!is_readonly : is_readonly;
 }
 
 static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
drivers/mmc/host/sdhci.h +1 -0
index bfcd611..b7b8a3b 100644
@@ -214,6 +214,7 @@ struct sdhci_ops {
 	unsigned int	(*get_timeout_clock)(struct sdhci_host *host);
 	void (*platform_send_init_74_clocks)(struct sdhci_host *host,
 					     u8 power_mode);
+	unsigned int    (*get_ro)(struct sdhci_host *host);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
Signature · 1 line
1.7.1
#4 lore raw

PATCH v5 4/6 mmc: sdhci_pltfm: pass more data on custom init-call

In reply to Wolfram Sang

The custom init call may need more data to perform its job, so we pass it a pointer to pdata, too. Also, always use the platform_id specific data even if platform_data is present. Doing that, platform_data can additionally be parsed by init() for board-specific information (via sdhci->mmc->parent).

(Note: the old behaviour was that you could override the platform_id specific data with your own. However, one can still do this by using the "sdhci" id instead of "sdhci-<something>".)

---
 drivers/mmc/host/sdhci-pltfm.c  |    8 +++++---
 include/linux/mmc/sdhci-pltfm.h |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-pltfm.c +5 -3
index 685202b..00e8a8a 100644
@@ -52,15 +52,17 @@ static struct sdhci_ops sdhci_pltfm_ops = {
 
 static int __devinit sdhci_pltfm_probe(struct platform_device *pdev)
 {
-	struct sdhci_pltfm_data *pdata = pdev->dev.platform_data;
 	const struct platform_device_id *platid = platform_get_device_id(pdev);
+	struct sdhci_pltfm_data *pdata;
 	struct sdhci_host *host;
 	struct sdhci_pltfm_host *pltfm_host;
 	struct resource *iomem;
 	int ret;
 
-	if (!pdata && platid && platid->driver_data)
+	if (platid && platid->driver_data)
 		pdata = (void *)platid->driver_data;
+	else
+		pdata = pdev->dev.platform_data;
 
 	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!iomem) {
@@ -109,7 +111,7 @@ static int __devinit sdhci_pltfm_probe(struct platform_device *pdev)
 	}
 
 	if (pdata && pdata->init) {
-		ret = pdata->init(host);
+		ret = pdata->init(host, pdata);
 		if (ret)
 			goto err_plat_init;
 	}
include/linux/mmc/sdhci-pltfm.h +1 -1
index 0239bd7..548d59d 100644
@@ -28,7 +28,7 @@ struct sdhci_host;
 struct sdhci_pltfm_data {
 	struct sdhci_ops *ops;
 	unsigned int quirks;
-	int (*init)(struct sdhci_host *host);
+	int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata);
 	void (*exit)(struct sdhci_host *host);
 };
 
Signature · 1 line
1.7.1
#5 lore raw

PATCH v5 5/6 mmc: sdhci-of-esdhc: factor out common stuff

In reply to Wolfram Sang

Put everything which can be shared between the OF and platform version of this driver into a local .h-file.

---

No change since last version. 80-char/line changes confirmed.

 drivers/mmc/host/sdhci-esdhc.h    |   83 +++++++++++++++++++++++++++++++++++++
 drivers/mmc/host/sdhci-of-esdhc.c |   70 ++++---------------------------
 2 files changed, 91 insertions(+), 62 deletions(-)
 create mode 100644 drivers/mmc/host/sdhci-esdhc.h
drivers/mmc/host/sdhci-esdhc.h new file +83 -0
new file mode 100644
index 0000000..afaf1bc
@@ -0,0 +1,83 @@
+/*
+ * Freescale eSDHC controller driver generics for OF and pltfm.
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ * Copyright (c) 2009 MontaVista Software, Inc.
+ * Copyright (c) 2010 Pengutronix e.K.
+ *   Author: Wolfram Sang <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License.
+ */
+
+#ifndef _DRIVERS_MMC_SDHCI_ESDHC_H
+#define _DRIVERS_MMC_SDHCI_ESDHC_H
+
+/*
+ * Ops and quirks for the Freescale eSDHC controller.
+ */
+
+#define ESDHC_DEFAULT_QUIRKS	(SDHCI_QUIRK_FORCE_BLK_SZ_2048 | \
+				SDHCI_QUIRK_BROKEN_CARD_DETECTION | \
+				SDHCI_QUIRK_NO_BUSY_IRQ | \
+				SDHCI_QUIRK_NONSTANDARD_CLOCK | \
+				SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | \
+				SDHCI_QUIRK_PIO_NEEDS_DELAY | \
+				SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET | \
+				SDHCI_QUIRK_NO_CARD_NO_RESET)
+
+#define ESDHC_SYSTEM_CONTROL	0x2c
+#define ESDHC_CLOCK_MASK	0x0000fff0
+#define ESDHC_PREDIV_SHIFT	8
+#define ESDHC_DIVIDER_SHIFT	4
+#define ESDHC_CLOCK_PEREN	0x00000004
+#define ESDHC_CLOCK_HCKEN	0x00000002
+#define ESDHC_CLOCK_IPGEN	0x00000001
+
+/* pltfm-specific */
+#define ESDHC_HOST_CONTROL_LE	0x20
+
+/* OF-specific */
+#define ESDHC_DMA_SYSCTL	0x40c
+#define ESDHC_DMA_SNOOP		0x00000040
+
+#define ESDHC_HOST_CONTROL_RES	0x05
+
+static inline void esdhc_set_clock(struct sdhci_host *host, unsigned int clock)
+{
+	int pre_div = 2;
+	int div = 1;
+	u32 temp;
+
+	temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL);
+	temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN
+		| ESDHC_CLOCK_MASK);
+	sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL);
+
+	if (clock == 0)
+		goto out;
+
+	while (host->max_clk / pre_div / 16 > clock && pre_div < 256)
+		pre_div *= 2;
+
+	while (host->max_clk / pre_div / div > clock && div < 16)
+		div++;
+
+	dev_dbg(mmc_dev(host->mmc), "desired SD clock: %d, actual: %d\n",
+		clock, host->max_clk / pre_div / div);
+
+	pre_div >>= 1;
+	div--;
+
+	temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL);
+	temp |= (ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN
+		| (div << ESDHC_DIVIDER_SHIFT)
+		| (pre_div << ESDHC_PREDIV_SHIFT));
+	sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL);
+	mdelay(100);
+out:
+	host->clock = clock;
+}
+
+#endif /* _DRIVERS_MMC_SDHCI_ESDHC_H */
drivers/mmc/host/sdhci-of-esdhc.c +8 -62

104 lines not on this page · raw message

Signature · 1 line
1.7.1
#6 lore raw

PATCH v5 5/6 mmc: sdhci-of-esdhc: factor out common stuff

Hi Wolfram,

Quoted 16 lines · Wolfram Sang
drivers/mmc/host/sdhci-of-esdhc.c +0 -8
index c8623de..277fcb9 100644
@@ -18,23 +18,7 @@
 #include <linux/mmc/host.h>
 #include "sdhci-of.h"
 #include "sdhci.h"
-
-/*
- * Ops and quirks for the Freescale eSDHC controller.
- */
-
-#define ESDHC_DMA_SYSCTL	0x40c
-#define ESDHC_DMA_SNOOP		0x00000040
-

drivers/mmc/host/sdhci-of-esdhc.c line 21

Quoted 10 lines
drivers/mmc/host/sdhci-of-esdhc.c +1 -9
-#define ESDHC_SYSTEM_CONTROL	0x2c
-#define ESDHC_CLOCK_MASK	0x0000fff0
-#define ESDHC_PREDIV_SHIFT	8
-#define ESDHC_DIVIDER_SHIFT	4
-#define ESDHC_CLOCK_PEREN	0x00000004
-#define ESDHC_CLOCK_HCKEN	0x00000002
-#define ESDHC_CLOCK_IPGEN	0x00000001
-
-#define ESDHC_HOST_CONTROL_RES	0x05
+#include "sdhci-esdhc.c"

Stephen reports a -next build failure after this patch. Presumably this should be sdhci-esdhc.h? It's confusing that no-one else hit this.

Thanks,

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#7 lore raw

PATCH v5 5/6 mmc: sdhci-of-esdhc: factor out common stuff

Hi Chris,

Quoted 5 lines

drivers/mmc/host/sdhci-of-esdhc.c line 21

Quoted 2 lines
drivers/mmc/host/sdhci-of-esdhc.c +1 -1
-#define ESDHC_HOST_CONTROL_RES	0x05
+#include "sdhci-esdhc.c"

Stephen reports a -next build failure after this patch. Presumably this should be sdhci-esdhc.h? It's confusing that no-one else hit this.

Uh, ouch, one brown paper bag, please! Yeah, confusing, that is.

Regarding your patch:

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101019/ea6e72c6/attachment.sig>
#8 lore raw

PATCH v5 5/6 mmc: sdhci-of-esdhc: factor out common stuff

Quoted 4 lines · Wolfram Sang
Quoted 2 lines

Stephen reports a -next build failure after this patch. Presumably this should be sdhci-esdhc.h? It's confusing that no-one else hit this.

Uh, ouch, one brown paper bag, please! Yeah, confusing, that is.

Ah, not that confusing -- sdhci-of-esdhc.c essentially depends on PPC, and MMC_SDHCI_ESDHC_IMX depends on ARM, and I imagine we've only had testing on the latter.

Quoted 3 lines

Regarding your patch:

Thanks. When it comes time to send to Linus, I'll just roll this into your original [5/6].

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#9 lore raw

PATCH v5 6/6 mmc: sdhci-pltfm: add pltfm-driver for imx35/51

In reply to Wolfram Sang

This driver adds basic support for the esdhc-core found on e.g. imx35/51. It adds up to the pltfm-core.

---

Change since last version:

* Add Kconfig dependency for imx-archs

 drivers/mmc/host/Kconfig           |   10 +++
 drivers/mmc/host/Makefile          |    1 +
 drivers/mmc/host/sdhci-esdhc-imx.c |  143 ++++++++++++++++++++++++++++++++++++
 drivers/mmc/host/sdhci-pltfm.c     |    3 +
 drivers/mmc/host/sdhci-pltfm.h     |    1 +
 5 files changed, 158 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/Kconfig +10 -0
index 0b7024a..c9c2520 100644
@@ -130,6 +130,16 @@ config MMC_SDHCI_CNS3XXX
 
 	  If unsure, say N.
 
+config MMC_SDHCI_ESDHC_IMX
+	bool "SDHCI platform support for the Freescale eSDHC i.MX controller"
+	depends on MMC_SDHCI_PLTFM && (ARCH_MX25 || ARCH_MX35 || ARCH_MX5)
+	select MMC_SDHCI_IO_ACCESSORS
+	help
+	  This selects the Freescale eSDHC controller support on the platform
+	  bus, found on platforms like mx35/51.
+
+	  If unsure, say N.
+
 config MMC_SDHCI_S3C
 	tristate "SDHCI support on Samsung S3C SoC"
 	depends on MMC_SDHCI && PLAT_SAMSUNG
drivers/mmc/host/Makefile +1 -0
index eae5d62..6c4ac67 100644
@@ -37,6 +37,7 @@ obj-$(CONFIG_MMC_USHC)		+= ushc.o
 obj-$(CONFIG_MMC_SDHCI_PLTFM)			+= sdhci-platform.o
 sdhci-platform-y				:= sdhci-pltfm.o
 sdhci-platform-$(CONFIG_MMC_SDHCI_CNS3XXX)	+= sdhci-cns3xxx.o
+sdhci-platform-$(CONFIG_MMC_SDHCI_ESDHC_IMX)	+= sdhci-esdhc-imx.o
 
 obj-$(CONFIG_MMC_SDHCI_OF)	+= sdhci-of.o
 sdhci-of-y				:= sdhci-of-core.o
drivers/mmc/host/sdhci-esdhc-imx.c new file +143 -0

143 lines not on this page · raw message

drivers/mmc/host/sdhci-pltfm.c +3 -0
index 00e8a8a..0502f89 100644
@@ -167,6 +167,9 @@ static const struct platform_device_id sdhci_pltfm_ids[] = {
 #ifdef CONFIG_MMC_SDHCI_CNS3XXX
 	{ "sdhci-cns3xxx", (kernel_ulong_t)&sdhci_cns3xxx_pdata },
 #endif
+#ifdef CONFIG_MMC_SDHCI_ESDHC_IMX
+	{ "sdhci-esdhc-imx", (kernel_ulong_t)&sdhci_esdhc_imx_pdata },
+#endif
 	{ },
 };
 MODULE_DEVICE_TABLE(platform, sdhci_pltfm_ids);
drivers/mmc/host/sdhci-pltfm.h +1 -0
index 562b929..c1bfe48 100644
@@ -21,5 +21,6 @@ struct sdhci_pltfm_host {
 };
 
 extern struct sdhci_pltfm_data sdhci_cns3xxx_pdata;
+extern struct sdhci_pltfm_data sdhci_esdhc_imx_pdata;
 
 #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */
Signature · 1 line
1.7.1
#10 lore raw

v5 cover SD/MMC driver for MX25/35/51

In reply to Wolfram Sang

Hi Wolfram,

Quoted 15 lines · Wolfram Sang

Another try. The driver seems to be known by now and used already :) Minor fixes only:

3/6: Rename a variable (found while working on write-protect-pin support) 5/6: Tested the checkpatch fixes
6/6: Added Kconfig dependencies

The series is based on mmc-next as of today and also available at

	git://git.pengutronix.de/git/wsa/linux-2.6.git pcm043-mmc

Thanks,

Wolfram

Quoted 7 lines

Wolfram Sang (6):
mmc: sdhci-pltfm: Add structure for host-specific data
mmc: sdhci-pltfm: move .h-file into apropriate subdir
mmc: sdhci: introduce private get_ro
mmc: sdhci_pltfm: pass more data on custom init-call
mmc: sdhci-of-esdhc: factor out common stuff
mmc: sdhci-pltfm: add pltfm-driver for imx35/51

Thanks! All pushed to mmc-next.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child