Skip to contentSkip to conversation

Remove platform callbacks from mmc_spi, sh_mmcif and sh_mobile_sdhi drivers

PATCH New Laurent Pinchart 3 participants 18 messages Aug 8, 2013 – Aug 25, 2013

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

v3 cover Remove platform callbacks from mmc_spi, sh_mmcif and sh_mobile_sdhi drivers

Hello,

This patch set replaces callbacks to board code with regulators and GPIOs in the mmc_spi, sh_mmcif and sh_mobile_sdhi MMC drivers.

Most of the required infrastructure is in place already on the drivers side, except for CD debouncing support in the MMC core and CD/RO GPIOs support in the mmc_spi driver. The series thus starts with patches 01/14 and 02/14 that add those features to the MMC core and mmc_spi driver.

Patches 03/14 to 07/14 remove the board callbacks from the ecovec24 and vision_ep9307 boards. The code has been compile-tested only as I don't have access to those boards.

Patches 08/14 to 14/14 then proceed to remove the callbacks from the drivers themselves and from the platform data structures.

Compared to v2, the patches have been rebased on the mmc-next branch from
git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git. I've also added patch 07/14 that removes the .set_pwr() callback from the ag5evm board to avoid compilation breakage during bisection.

The series interleaves patches for drivers and board files. The ep93xx and ecovec24 patches have been acked, and the respective ARM subtree maintainers have indicated that they are fine with the patches going through the MMC tree. The ag5evm patch is new, but as the ag5evm board is going to be removed in v3.12, it shouldn't cause any issue.

Chris, could you take the patches in your tree ? I've pushed them to

git://linuxtv.org/pinchartl/fbdev.git mmc/devel

Laurent Pinchart (14):
mmc: slot-gpio: Add debouncing capability to mmc_gpio_request_cd()
mmc: mmc_spi: Support CD/RO GPIOs
ARM: ep93xx: vision_ep9307: Use MMC CD and RO GPIO
sh: ecovec24: Use MMC/SDHI CD and RO GPIO
sh: ecovec24: Remove mmcif .down_pwr() callback
sh: ecovec24: Remove MMCIF and SDHI .set_pwr() callbacks
ARM: shmobile: ag5evm: Remove SDHI .set_pwr() callback
mmc: mmc_spi: Remove platform data .get_cd() and .get_ro() callbacks
mmc: sh_mmcif: Remove .down_pwr() callback from platform data
mmc: sh_mmcif: Remove .set_pwr() callback from platform data
mmc: sh_mobile_sdhi: Remove .get_cd() callback from platform data
mmc: sh_mobile_sdhi: Remove .set_pwr() callback from platform data
mmc: tmio-mmc: Remove .get_cd() callback from platform data
mmc: tmio-mmc: Remove .set_pwr() callback from platform data

 arch/arm/mach-ep93xx/vision_ep9307.c  | 57 ++--------------------
 arch/arm/mach-shmobile/board-ag5evm.c | 23 ---------
 arch/sh/boards/mach-ecovec24/setup.c  | 89 ++++-------------------------------
 drivers/mmc/core/host.c               |  2 +-
 drivers/mmc/core/slot-gpio.c          | 14 +++++-
 drivers/mmc/host/jz4740_mmc.c         |  2 +-
 drivers/mmc/host/mmc_spi.c            | 49 +++++++++----------
 drivers/mmc/host/mvsdio.c             |  3 +-
 drivers/mmc/host/of_mmc_spi.c         | 46 +++++-------------
 drivers/mmc/host/sdhci-esdhc-imx.c    |  2 +-
 drivers/mmc/host/sdhci-pxav3.c        |  3 +-
 drivers/mmc/host/sdhci-sirf.c         |  2 +-
 drivers/mmc/host/sh_mmcif.c           |  5 +-
 drivers/mmc/host/sh_mobile_sdhi.c     | 18 -------
 drivers/mmc/host/tmio_mmc.h           |  1 -
 drivers/mmc/host/tmio_mmc_pio.c       | 25 +---------
 include/linux/mfd/tmio.h              |  2 -
 include/linux/mmc/sh_mmcif.h          |  2 -
 include/linux/mmc/sh_mobile_sdhi.h    |  2 -
 include/linux/mmc/slot-gpio.h         |  3 +-
 include/linux/spi/mmc_spi.h           | 19 +++++---
 21 files changed, 86 insertions(+), 283 deletions(-)
Signature · 3 lines
Regards,

Laurent Pinchart
#1 lore raw

PATCH v3 1/14 mmc: slot-gpio: Add debouncing capability to mmc_gpio_request_cd()

Add a debounce parameter to the mmc_gpio_request_cd() function that enables GPIO debouncing when set to a non-zero value. This can be used by MMC host drivers to enable debouncing on the card detect signal.

---
 drivers/mmc/core/host.c            |  2 +-
 drivers/mmc/core/slot-gpio.c       | 14 +++++++++++++-
 drivers/mmc/host/jz4740_mmc.c      |  2 +-
 drivers/mmc/host/mvsdio.c          |  3 ++-
 drivers/mmc/host/sdhci-esdhc-imx.c |  2 +-
 drivers/mmc/host/sdhci-pxav3.c     |  3 ++-
 drivers/mmc/host/sdhci-sirf.c      |  2 +-
 drivers/mmc/host/sh_mmcif.c        |  2 +-
 drivers/mmc/host/tmio_mmc_pio.c    |  2 +-
 include/linux/mmc/slot-gpio.h      |  3 ++-
 10 files changed, 25 insertions(+), 10 deletions(-)
drivers/mmc/core/host.c +1 -1
index 6fb6f77..49bc403 100644
@@ -374,7 +374,7 @@ int mmc_of_parse(struct mmc_host *host)
 			if (!(flags & OF_GPIO_ACTIVE_LOW))
 				gpio_inv_cd = true;
 
-			ret = mmc_gpio_request_cd(host, gpio);
+			ret = mmc_gpio_request_cd(host, gpio, 0);
 			if (ret < 0) {
 				dev_err(host->parent,
 					"Failed to request CD GPIO #%d: %d!\n",
drivers/mmc/core/slot-gpio.c +13 -1
index 3242351..46596b71 100644
@@ -135,6 +135,7 @@ EXPORT_SYMBOL(mmc_gpio_request_ro);
  * mmc_gpio_request_cd - request a gpio for card-detection
  * @host: mmc host
  * @gpio: gpio number requested
+ * @debounce: debounce time in microseconds
  *
  * As devm_* managed functions are used in mmc_gpio_request_cd(), client
  * drivers do not need to explicitly call mmc_gpio_free_cd() for freeing up,
@@ -143,9 +144,14 @@ EXPORT_SYMBOL(mmc_gpio_request_ro);
  * switching for card-detection, they are responsible for calling
  * mmc_gpio_request_cd() and mmc_gpio_free_cd() as a pair on their own.
  *
+ * If GPIO debouncing is desired, set the debounce parameter to a non-zero
+ * value. The caller is responsible for ensuring that the GPIO driver associated
+ * with the GPIO supports debouncing, otherwise an error will be returned.
+ *
  * Returns zero on success, else an error.
  */
-int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio)
+int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio,
+			unsigned int debounce)
 {
 	struct mmc_gpio *ctx;
 	int irq = gpio_to_irq(gpio);
@@ -167,6 +173,12 @@ int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio)
 		 */
 		return ret;
 
+	if (debounce) {
+		ret = gpio_set_debounce(gpio, debounce);
+		if (ret < 0)
+			return ret;
+	}
+
 	/*
 	 * Even if gpio_to_irq() returns a valid IRQ number, the platform might
 	 * still prefer to poll, e.g., because that IRQ number is already used
drivers/mmc/host/jz4740_mmc.c +1 -1
index 0308c9f..d868946 100644
@@ -713,7 +713,7 @@ static int jz4740_mmc_request_gpios(struct mmc_host *mmc,
 		mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 
 	if (gpio_is_valid(pdata->gpio_card_detect)) {
-		ret = mmc_gpio_request_cd(mmc, pdata->gpio_card_detect);
+		ret = mmc_gpio_request_cd(mmc, pdata->gpio_card_detect, 0);
 		if (ret)
 			return ret;
 	}
drivers/mmc/host/mvsdio.c +2 -1
index 4ddd83f..06c5b0b 100644
@@ -757,7 +757,8 @@ static int __init mvsd_probe(struct platform_device *pdev)
 		if (mvsd_data->gpio_card_detect &&
 		    gpio_is_valid(mvsd_data->gpio_card_detect)) {
 			ret = mmc_gpio_request_cd(mmc,
-						  mvsd_data->gpio_card_detect);
+						  mvsd_data->gpio_card_detect,
+						  0);
 			if (ret)
 				goto out;
 		} else {
drivers/mmc/host/sdhci-esdhc-imx.c +1 -1
index 1dd5ba8..abc8cf0 100644
@@ -616,7 +616,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 	/* card_detect */
 	switch (boarddata->cd_type) {
 	case ESDHC_CD_GPIO:
-		err = mmc_gpio_request_cd(host->mmc, boarddata->cd_gpio);
+		err = mmc_gpio_request_cd(host->mmc, boarddata->cd_gpio, 0);
 		if (err) {
 			dev_err(mmc_dev(host->mmc),
 				"failed to request card-detect gpio!\n");
drivers/mmc/host/sdhci-pxav3.c +2 -1
index bf99359..793dacd 100644
@@ -278,7 +278,8 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 			host->mmc->pm_caps |= pdata->pm_caps;
 
 		if (gpio_is_valid(pdata->ext_cd_gpio)) {
-			ret = mmc_gpio_request_cd(host->mmc, pdata->ext_cd_gpio);
+			ret = mmc_gpio_request_cd(host->mmc, pdata->ext_cd_gpio,
+						  0);
 			if (ret) {
 				dev_err(mmc_dev(host->mmc),
 					"failed to allocate card detect gpio\n");
drivers/mmc/host/sdhci-sirf.c +1 -1
index 62a4a83..696122c 100644
@@ -84,7 +84,7 @@ static int sdhci_sirf_probe(struct platform_device *pdev)
 	 * gets setup in sdhci_add_host() and we oops.
 	 */
 	if (gpio_is_valid(priv->gpio_cd)) {
-		ret = mmc_gpio_request_cd(host->mmc, priv->gpio_cd);
+		ret = mmc_gpio_request_cd(host->mmc, priv->gpio_cd, 0);
 		if (ret) {
 			dev_err(&pdev->dev, "card detect irq request failed: %d\n",
 				ret);
drivers/mmc/host/sh_mmcif.c +1 -1
index 6706b5e..35f61cc 100644
@@ -1436,7 +1436,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 	}
 
 	if (pd && pd->use_cd_gpio) {
-		ret = mmc_gpio_request_cd(mmc, pd->cd_gpio);
+		ret = mmc_gpio_request_cd(mmc, pd->cd_gpio, 0);
 		if (ret < 0)
 			goto erqcd;
 	}
drivers/mmc/host/tmio_mmc_pio.c +1 -1
index 718843c..17f7fa9 100644
@@ -1110,7 +1110,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
 
 	if (pdata->flags & TMIO_MMC_USE_GPIO_CD) {
-		ret = mmc_gpio_request_cd(mmc, pdata->cd_gpio);
+		ret = mmc_gpio_request_cd(mmc, pdata->cd_gpio, 0);
 		if (ret < 0) {
 			tmio_mmc_host_remove(_host);
 			return ret;
include/linux/mmc/slot-gpio.h +2 -1
index 7d88d27..b0c73e4 100644
@@ -18,7 +18,8 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio);
 void mmc_gpio_free_ro(struct mmc_host *host);
 
 int mmc_gpio_get_cd(struct mmc_host *host);
-int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio);
+int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio,
+			unsigned int debounce);
 void mmc_gpio_free_cd(struct mmc_host *host);
 
 #endif
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH v3 2/14 mmc: mmc_spi: Support CD/RO GPIOs

In reply to Laurent Pinchart

Add support for passing CD/RO GPIO numbers directly to the mmc_spi driver instead of relying solely on board code callbacks to retrieve the CD/RO signals values. The driver will enable debouncing on the card detect GPIO if the cd_debounce field is set to a non-zero value.

---
 drivers/mmc/host/mmc_spi.c    | 33 ++++++++++++++++++++++---------
 drivers/mmc/host/of_mmc_spi.c | 46 +++++++++++--------------------------------
 include/linux/spi/mmc_spi.h   | 16 +++++++++++++++
 3 files changed, 52 insertions(+), 43 deletions(-)
drivers/mmc/host/mmc_spi.c +24 -9
index 74145d1..62fb82d 100644
@@ -36,6 +36,7 @@
 
 #include <linux/mmc/host.h>
 #include <linux/mmc/mmc.h>		/* for R1_SPI_* bit values */
+#include <linux/mmc/slot-gpio.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/mmc_spi.h>
@@ -1278,11 +1279,8 @@ static int mmc_spi_get_ro(struct mmc_host *mmc)
 
 	if (host->pdata && host->pdata->get_ro)
 		return !!host->pdata->get_ro(mmc->parent);
-	/*
-	 * Board doesn't support read only detection; let the mmc core
-	 * decide what to do.
-	 */
-	return -ENOSYS;
+	else
+		return mmc_gpio_get_ro(mmc);
 }
 
 static int mmc_spi_get_cd(struct mmc_host *mmc)
@@ -1291,7 +1289,8 @@ static int mmc_spi_get_cd(struct mmc_host *mmc)
 
 	if (host->pdata && host->pdata->get_cd)
 		return !!host->pdata->get_cd(mmc->parent);
-	return -ENOSYS;
+	else
+		return mmc_gpio_get_cd(mmc);
 }
 
 static const struct mmc_host_ops mmc_spi_ops = {
@@ -1324,6 +1323,7 @@ static int mmc_spi_probe(struct spi_device *spi)
 	struct mmc_host		*mmc;
 	struct mmc_spi_host	*host;
 	int			status;
+	bool			has_ro = false;
 
 	/* We rely on full duplex transfers, mostly to reduce
 	 * per-transfer overheads (by making fewer transfers).
@@ -1448,18 +1448,33 @@ static int mmc_spi_probe(struct spi_device *spi)
 	}
 
 	/* pass platform capabilities, if any */
-	if (host->pdata)
+	if (host->pdata) {
 		mmc->caps |= host->pdata->caps;
+		mmc->caps2 |= host->pdata->caps2;
+	}
 
 	status = mmc_add_host(mmc);
 	if (status != 0)
 		goto fail_add_host;
 
+	if (host->pdata && host->pdata->flags & MMC_SPI_USE_CD_GPIO) {
+		status = mmc_gpio_request_cd(mmc, host->pdata->cd_gpio,
+					     host->pdata->cd_debounce);
+		if (status != 0)
+			goto fail_add_host;
+	}
+
+	if (host->pdata && host->pdata->flags & MMC_SPI_USE_RO_GPIO) {
+		has_ro = true;
+		status = mmc_gpio_request_ro(mmc, host->pdata->ro_gpio);
+		if (status != 0)
+			goto fail_add_host;
+	}
+
 	dev_info(&spi->dev, "SD/MMC host %s%s%s%s%s\n",
 			dev_name(&mmc->class_dev),
 			host->dma_dev ? "" : ", no DMA",
-			(host->pdata && host->pdata->get_ro)
-				? "" : ", no WP",
+			has_ro ? "" : ", no WP",
 			(host->pdata && host->pdata->setpower)
 				? "" : ", no poweroff",
 			(mmc->caps & MMC_CAP_NEEDS_POLL)
drivers/mmc/host/of_mmc_spi.c +12 -34

72 lines not on this page · raw message

include/linux/spi/mmc_spi.h +16 -0
index 32be8db..87cdb35 100644
@@ -7,6 +7,11 @@
 struct device;
 struct mmc_host;
 
+#define MMC_SPI_USE_CD_GPIO			(1 << 0)
+#define MMC_SPI_USE_RO_GPIO			(1 << 1)
+#define MMC_SPI_CD_GPIO_ACTIVE_LOW		(1 << 2)
+#define MMC_SPI_RO_GPIO_ACTIVE_LOW		(1 << 3)
+
 /* Put this in platform_data of a device being used to manage an MMC/SD
  * card slot.  (Modeled after PXA mmc glue; see that for usage examples.)
  *
@@ -30,8 +35,19 @@ struct mmc_spi_platform_data {
 	 */
 	int (*get_cd)(struct device *);
 
+	/*
+	 * Card Detect and Read Only GPIOs. To enable debouncing on the card
+	 * detect GPIO, set the cd_debounce to the debounce time in
+	 * microseconds.
+	 */
+	unsigned int flags;
+	unsigned int cd_gpio;
+	unsigned int cd_debounce;
+	unsigned int ro_gpio;
+
 	/* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */
 	unsigned long caps;
+	unsigned long caps2;
 
 	/* how long to debounce card detect, in msecs */
 	u16 detect_delay;
Signature · 1 line
1.8.1.5
#3 lore raw

PATCH v3 3/14 ARM: ep93xx: vision_ep9307: Use MMC CD and RO GPIO

In reply to Laurent Pinchart

Pass the CD and RO GPIO numbers to the MMC SPI driver and remove the custom .get_cd() and .get_ro() callback functions.

---
 arch/arm/mach-ep93xx/vision_ep9307.c | 57 ++++--------------------------------
 1 file changed, 5 insertions(+), 52 deletions(-)
arch/arm/mach-ep93xx/vision_ep9307.c +5 -52
index 605956f..5a4c06d 100644
@@ -224,62 +224,15 @@ static struct ep93xx_spi_chip_ops vision_spi_flash_hw = {
 #define VISION_SPI_MMC_WP	EP93XX_GPIO_LINE_F(0)
 #define VISION_SPI_MMC_CD	EP93XX_GPIO_LINE_EGPIO15
 
-static struct gpio vision_spi_mmc_gpios[] = {
-	{ VISION_SPI_MMC_WP, GPIOF_DIR_IN, "mmc_spi:wp" },
-	{ VISION_SPI_MMC_CD, GPIOF_DIR_IN, "mmc_spi:cd" },
-};
-
-static int vision_spi_mmc_init(struct device *pdev,
-			irqreturn_t (*func)(int, void *), void *pdata)
-{
-	int err;
-
-	err = gpio_request_array(vision_spi_mmc_gpios,
-				 ARRAY_SIZE(vision_spi_mmc_gpios));
-	if (err)
-		return err;
-
-	err = gpio_set_debounce(VISION_SPI_MMC_CD, 1);
-	if (err)
-		goto exit_err;
-
-	err = request_irq(gpio_to_irq(VISION_SPI_MMC_CD), func,
-			IRQ_TYPE_EDGE_BOTH, "mmc_spi:cd", pdata);
-	if (err)
-		goto exit_err;
-
-	return 0;
-
-exit_err:
-	gpio_free_array(vision_spi_mmc_gpios, ARRAY_SIZE(vision_spi_mmc_gpios));
-	return err;
-
-}
-
-static void vision_spi_mmc_exit(struct device *pdev, void *pdata)
-{
-	free_irq(gpio_to_irq(VISION_SPI_MMC_CD), pdata);
-	gpio_free_array(vision_spi_mmc_gpios, ARRAY_SIZE(vision_spi_mmc_gpios));
-}
-
-static int vision_spi_mmc_get_ro(struct device *pdev)
-{
-	return !!gpio_get_value(VISION_SPI_MMC_WP);
-}
-
-static int vision_spi_mmc_get_cd(struct device *pdev)
-{
-	return !gpio_get_value(VISION_SPI_MMC_CD);
-}
-
 static struct mmc_spi_platform_data vision_spi_mmc_data = {
-	.init		= vision_spi_mmc_init,
-	.exit		= vision_spi_mmc_exit,
-	.get_ro		= vision_spi_mmc_get_ro,
-	.get_cd		= vision_spi_mmc_get_cd,
 	.detect_delay	= 100,
 	.powerup_msecs	= 100,
 	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.flags		= MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO,
+	.cd_gpio	= VISION_SPI_MMC_CD,
+	.cd_debounce	= 1,
+	.ro_gpio	= VISION_SPI_MMC_WP,
+	.caps2		= MMC_CAP2_RO_ACTIVE_HIGH,
 };
 
 static int vision_spi_mmc_hw_setup(struct spi_device *spi)
Signature · 1 line
1.8.1.5
#4 lore raw

PATCH v3 4/14 sh: ecovec24: Use MMC/SDHI CD and RO GPIO

In reply to Laurent Pinchart

Pass the CD and RO GPIO numbers to the MMC SPI and SDHI drivers and remove the custom .get_cd() and .get_ro() callback functions.

---
 arch/sh/boards/mach-ecovec24/setup.c | 42 +++++++-----------------------------
 1 file changed, 8 insertions(+), 34 deletions(-)
arch/sh/boards/mach-ecovec24/setup.c +8 -34
index 61fade0..a1557ec 100644
@@ -617,18 +617,14 @@ static void sdhi0_set_pwr(struct platform_device *pdev, int state)
 	gpio_set_value(GPIO_PTB6, state);
 }
 
-static int sdhi0_get_cd(struct platform_device *pdev)
-{
-	return !gpio_get_value(GPIO_PTY7);
-}
-
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.set_pwr	= sdhi0_set_pwr,
 	.tmio_caps      = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD |
 			  MMC_CAP_NEEDS_POLL,
-	.get_cd		= sdhi0_get_cd,
+	.tmio_flags	= TMIO_MMC_USE_GPIO_CD,
+	.cd_gpio	= GPIO_PTY7,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -675,18 +671,14 @@ static void cn12_set_pwr(struct platform_device *pdev, int state)
 
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 /* SDHI1 */
-static int sdhi1_get_cd(struct platform_device *pdev)
-{
-	return !gpio_get_value(GPIO_PTW7);
-}
-
 static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_caps      = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD |
 			  MMC_CAP_NEEDS_POLL,
+	.tmio_flags	= TMIO_MMC_USE_GPIO_CD,
+	.cd_gpio	= GPIO_PTW7,
 	.set_pwr	= cn12_set_pwr,
-	.get_cd		= sdhi1_get_cd,
 };
 
 static struct resource sdhi1_resources[] = {
@@ -716,27 +708,19 @@ static struct platform_device sdhi1_device = {
 #else
 
 /* MMC SPI */
-static int mmc_spi_get_ro(struct device *dev)
-{
-	return gpio_get_value(GPIO_PTY6);
-}
-
-static int mmc_spi_get_cd(struct device *dev)
-{
-	return !gpio_get_value(GPIO_PTY7);
-}
-
 static void mmc_spi_setpower(struct device *dev, unsigned int maskval)
 {
 	gpio_set_value(GPIO_PTB6, maskval ? 1 : 0);
 }
 
 static struct mmc_spi_platform_data mmc_spi_info = {
-	.get_ro = mmc_spi_get_ro,
-	.get_cd = mmc_spi_get_cd,
 	.caps = MMC_CAP_NEEDS_POLL,
+	.caps2 = MMC_CAP2_RO_ACTIVE_HIGH,
 	.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3.3V only */
 	.setpower = mmc_spi_setpower,
+	.flags = MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO,
+	.cd_gpio = GPIO_PTY7,
+	.ro_gpio = GPIO_PTY6,
 };
 
 static struct spi_board_info spi_bus[] = {
@@ -1339,10 +1323,6 @@ static int __init arch_setup(void)
 	gpio_direction_input(GPIO_PTR6);
 
 	/* SD-card slot CN11 */
-	/* Card-detect, used on CN11, either with SDHI0 or with SPI */
-	gpio_request(GPIO_PTY7, NULL);
-	gpio_direction_input(GPIO_PTY7);
-
 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
 	/* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
 	gpio_request(GPIO_FN_SDHI0WP,  NULL);
@@ -1361,8 +1341,6 @@ static int __init arch_setup(void)
 	gpio_direction_output(GPIO_PTM4, 1); /* active low CS */
 	gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */
 	gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */
-	gpio_request(GPIO_PTY6, NULL); /* write protect */
-	gpio_direction_input(GPIO_PTY6);
 
 	spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
 #endif
@@ -1392,10 +1370,6 @@ static int __init arch_setup(void)
 	gpio_request(GPIO_FN_SDHI1D1,  NULL);
 	gpio_request(GPIO_FN_SDHI1D0,  NULL);
 
-	/* Card-detect, used on CN12 with SDHI1 */
-	gpio_request(GPIO_PTW7, NULL);
-	gpio_direction_input(GPIO_PTW7);
-
 	cn12_enabled = true;
 #endif
 
Signature · 1 line
1.8.1.5
#5 lore raw

PATCH v3 5/14 sh: ecovec24: Remove mmcif .down_pwr() callback

In reply to Laurent Pinchart

The callback isn't used by the mmcif driver, don't initialize it in board code.

---
 arch/sh/boards/mach-ecovec24/setup.c | 6 ------
 1 file changed, 6 deletions(-)
arch/sh/boards/mach-ecovec24/setup.c +0 -6
index a1557ec..5af40f5 100644
@@ -980,11 +980,6 @@ static struct platform_device vou_device = {
 
 #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
 /* SH_MMCIF */
-static void mmcif_down_pwr(struct platform_device *pdev)
-{
-	cn12_set_pwr(pdev, 0);
-}
-
 static struct resource sh_mmcif_resources[] = {
 	[0] = {
 		.name	= "SH_MMCIF",
@@ -1006,7 +1001,6 @@ static struct resource sh_mmcif_resources[] = {
 
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.set_pwr	= cn12_set_pwr,
-	.down_pwr	= mmcif_down_pwr,
 	.sup_pclk	= 0, /* SH7724: Max Pclk/2 */
 	.caps		= MMC_CAP_4_BIT_DATA |
 			  MMC_CAP_8_BIT_DATA |
Signature · 1 line
1.8.1.5
#6 lore raw

PATCH v3 6/14 sh: ecovec24: Remove MMCIF and SDHI .set_pwr() callbacks

In reply to Laurent Pinchart

The MMCIF and SHDI platform data .set_pwr() callbacks are used to control the vmmc/vqmmc power supplies. As the power supplies already register control GPIOs there's no need to perform the operation manually. Remove the callback functions.

---
 arch/sh/boards/mach-ecovec24/setup.c | 41 ------------------------------------
 1 file changed, 41 deletions(-)
arch/sh/boards/mach-ecovec24/setup.c +0 -41
index 5af40f5..0332d25 100644
@@ -598,29 +598,9 @@ static struct platform_device sdhi0_power = {
 	},
 };
 
-static void sdhi0_set_pwr(struct platform_device *pdev, int state)
-{
-	static int power_gpio = -EINVAL;
-
-	if (power_gpio < 0) {
-		int ret = gpio_request(GPIO_PTB6, NULL);
-		if (!ret) {
-			power_gpio = GPIO_PTB6;
-			gpio_direction_output(power_gpio, 0);
-		}
-	}
-
-	/*
-	 * Toggle the GPIO regardless, whether we managed to grab it above or
-	 * the fixed regulator driver did.
-	 */
-	gpio_set_value(GPIO_PTB6, state);
-}
-
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
-	.set_pwr	= sdhi0_set_pwr,
 	.tmio_caps      = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD |
 			  MMC_CAP_NEEDS_POLL,
 	.tmio_flags	= TMIO_MMC_USE_GPIO_CD,
@@ -650,25 +630,6 @@ static struct platform_device sdhi0_device = {
 	},
 };
 
-static void cn12_set_pwr(struct platform_device *pdev, int state)
-{
-	static int power_gpio = -EINVAL;
-
-	if (power_gpio < 0) {
-		int ret = gpio_request(GPIO_PTB7, NULL);
-		if (!ret) {
-			power_gpio = GPIO_PTB7;
-			gpio_direction_output(power_gpio, 0);
-		}
-	}
-
-	/*
-	 * Toggle the GPIO regardless, whether we managed to grab it above or
-	 * the fixed regulator driver did.
-	 */
-	gpio_set_value(GPIO_PTB7, state);
-}
-
 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
 /* SDHI1 */
 static struct sh_mobile_sdhi_info sdhi1_info = {
@@ -678,7 +639,6 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 			  MMC_CAP_NEEDS_POLL,
 	.tmio_flags	= TMIO_MMC_USE_GPIO_CD,
 	.cd_gpio	= GPIO_PTW7,
-	.set_pwr	= cn12_set_pwr,
 };
 
 static struct resource sdhi1_resources[] = {
@@ -1000,7 +960,6 @@ static struct resource sh_mmcif_resources[] = {
 };
 
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
-	.set_pwr	= cn12_set_pwr,
 	.sup_pclk	= 0, /* SH7724: Max Pclk/2 */
 	.caps		= MMC_CAP_4_BIT_DATA |
 			  MMC_CAP_8_BIT_DATA |
Signature · 1 line
1.8.1.5
#7 lore raw

PATCH v3 7/14 ARM: shmobile: ag5evm: Remove SDHI .set_pwr() callback

In reply to Laurent Pinchart

The SHDI platform data .set_pwr() callback is used to control the vmmc/vqmmc power supplies. As the power supplies already register control GPIOs there's no need to perform the operation manually. Remove the callback functions.

---
 arch/arm/mach-shmobile/board-ag5evm.c | 23 -----------------------
 1 file changed, 23 deletions(-)
arch/arm/mach-shmobile/board-ag5evm.c +0 -23
index c754071..a8e200f 100644
@@ -476,33 +476,10 @@ static struct platform_device cn4_power = {
 	},
 };
 
-static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
-{
-	static int power_gpio = -EINVAL;
-
-	if (power_gpio < 0) {
-		int ret = gpio_request_one(114, GPIOF_OUT_INIT_LOW,
-					   "sdhi1_power");
-		if (!ret)
-			power_gpio = 114;
-	}
-
-	/*
-	 * If requesting the GPIO above failed, it means, that the regulator got
-	 * probed and grabbed the GPIO, but we don't know, whether the sdhi
-	 * driver already uses the regulator. If it doesn't, we have to toggle
-	 * the GPIO ourselves, even though it is now owned by the fixed
-	 * regulator driver. We have to live with the race in case the driver
-	 * gets unloaded and the GPIO freed between these two steps.
-	 */
-	gpio_set_value(114, state);
-}
-
 static struct sh_mobile_sdhi_info sh_sdhi1_info = {
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
 	.tmio_caps	= MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
 	.tmio_ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
-	.set_pwr	= ag5evm_sdhi1_set_pwr,
 };
 
 static struct resource sdhi1_resources[] = {
Signature · 1 line
1.8.1.5
#8 lore raw

PATCH v3 8/14 mmc: mmc_spi: Remove platform data .get_cd() and .get_ro() callbacks

In reply to Laurent Pinchart

All platforms now pass the CD and RO GPIOs to the MMC SPI driver, those callbacks are not used anymore. Remove them.

---
 drivers/mmc/host/mmc_spi.c  | 24 ++----------------------
 include/linux/spi/mmc_spi.h |  9 ---------
 2 files changed, 2 insertions(+), 31 deletions(-)
drivers/mmc/host/mmc_spi.c +2 -22
index 62fb82d..0a87e56 100644
@@ -1273,31 +1273,11 @@ static void mmc_spi_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	}
 }
 
-static int mmc_spi_get_ro(struct mmc_host *mmc)
-{
-	struct mmc_spi_host *host = mmc_priv(mmc);
-
-	if (host->pdata && host->pdata->get_ro)
-		return !!host->pdata->get_ro(mmc->parent);
-	else
-		return mmc_gpio_get_ro(mmc);
-}
-
-static int mmc_spi_get_cd(struct mmc_host *mmc)
-{
-	struct mmc_spi_host *host = mmc_priv(mmc);
-
-	if (host->pdata && host->pdata->get_cd)
-		return !!host->pdata->get_cd(mmc->parent);
-	else
-		return mmc_gpio_get_cd(mmc);
-}
-
 static const struct mmc_host_ops mmc_spi_ops = {
 	.request	= mmc_spi_request,
 	.set_ios	= mmc_spi_set_ios,
-	.get_ro		= mmc_spi_get_ro,
-	.get_cd		= mmc_spi_get_cd,
+	.get_ro		= mmc_gpio_get_ro,
+	.get_cd		= mmc_gpio_get_cd,
 };
 
 
include/linux/spi/mmc_spi.h +0 -9
index 87cdb35..274bc0f 100644
@@ -26,15 +26,6 @@ struct mmc_spi_platform_data {
 		void *);
 	void (*exit)(struct device *, void *);
 
-	/* sense switch on sd cards */
-	int (*get_ro)(struct device *);
-
-	/*
-	 * If board does not use CD interrupts, driver can optimize polling
-	 * using this function.
-	 */
-	int (*get_cd)(struct device *);
-
 	/*
 	 * Card Detect and Read Only GPIOs. To enable debouncing on the card
 	 * detect GPIO, set the cd_debounce to the debounce time in
Signature · 1 line
1.8.1.5
#9 lore raw

PATCH v3 9/14 mmc: sh_mmcif: Remove .down_pwr() callback from platform data

In reply to Laurent Pinchart

The callback isn't used by the driver and isn't initialized by board code. Remove it.

---
 include/linux/mmc/sh_mmcif.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/mmc/sh_mmcif.h +0 -1
index e7d5dd6..39011eb 100644
@@ -34,7 +34,6 @@
 
 struct sh_mmcif_plat_data {
 	void (*set_pwr)(struct platform_device *pdev, int state);
-	void (*down_pwr)(struct platform_device *pdev);
 	int (*get_cd)(struct platform_device *pdef);
 	unsigned int		slave_id_tx;	/* embedded slave_id_[tr]x */
 	unsigned int		slave_id_rx;
Signature · 1 line
1.8.1.5
#10 lore raw

PATCH v3 10/14 mmc: sh_mmcif: Remove .set_pwr() callback from platform data

In reply to Laurent Pinchart

The .set_pwr() callback isn't used anymore as all platforms register GPIO-controlled regulators. Remove it.

---
 drivers/mmc/host/sh_mmcif.c  | 3 ---
 include/linux/mmc/sh_mmcif.h | 1 -
 2 files changed, 4 deletions(-)
drivers/mmc/host/sh_mmcif.c +0 -3
index 35f61cc..ac8e109 100644
@@ -956,11 +956,8 @@ static int sh_mmcif_clk_update(struct sh_mmcif_host *host)
 
 static void sh_mmcif_set_power(struct sh_mmcif_host *host, struct mmc_ios *ios)
 {
-	struct sh_mmcif_plat_data *pd = host->pd->dev.platform_data;
 	struct mmc_host *mmc = host->mmc;
 
-	if (pd && pd->set_pwr)
-		pd->set_pwr(host->pd, ios->power_mode != MMC_POWER_OFF);
 	if (!IS_ERR(mmc->supply.vmmc))
 		/* Errors ignored... */
 		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc,
include/linux/mmc/sh_mmcif.h +0 -1
index 39011eb..767fac5 100644
@@ -33,7 +33,6 @@
  */
 
 struct sh_mmcif_plat_data {
-	void (*set_pwr)(struct platform_device *pdev, int state);
 	int (*get_cd)(struct platform_device *pdef);
 	unsigned int		slave_id_tx;	/* embedded slave_id_[tr]x */
 	unsigned int		slave_id_rx;
Signature · 1 line
1.8.1.5
#11 lore raw

PATCH v3 11/14 mmc: sh_mobile_sdhi: Remove .get_cd() callback from platform data

In reply to Laurent Pinchart

All platforms pass the CD GPIO number to the driver in the .cd_gpio field. The .get_cd() callback isn't used anymore, remove it.

---
 drivers/mmc/host/sh_mobile_sdhi.c  | 9 ---------
 include/linux/mmc/sh_mobile_sdhi.h | 1 -
 2 files changed, 10 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +0 -9
index ebea749..663a672 100644
@@ -77,13 +77,6 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *pdev, int state)
 	p->set_pwr(pdev, state);
 }
 
-static int sh_mobile_sdhi_get_cd(struct platform_device *pdev)
-{
-	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
-
-	return p->get_cd(pdev);
-}
-
 static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host)
 {
 	int timeout = 1000;
@@ -182,8 +175,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->cd_gpio = p->cd_gpio;
 		if (p->set_pwr)
 			mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
-		if (p->get_cd)
-			mmc_data->get_cd = sh_mobile_sdhi_get_cd;
 
 		if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) {
 			/*
include/linux/mmc/sh_mobile_sdhi.h +0 -1
index b76bcf0..f31c692 100644
@@ -26,7 +26,6 @@ struct sh_mobile_sdhi_info {
 	u32 tmio_ocr_mask;	/* available MMC voltages */
 	unsigned int cd_gpio;
 	void (*set_pwr)(struct platform_device *pdev, int state);
-	int (*get_cd)(struct platform_device *pdev);
 
 	/* callbacks for board specific setup code */
 	int (*init)(struct platform_device *pdev,
Signature · 1 line
1.8.1.5
#12 lore raw

PATCH v3 12/14 mmc: sh_mobile_sdhi: Remove .set_pwr() callback from platform data

In reply to Laurent Pinchart

The .set_pwr() callback isn't used anymore as all platforms register GPIO-controlled regulators. Remove it.

---
 drivers/mmc/host/sh_mobile_sdhi.c  | 9 ---------
 include/linux/mmc/sh_mobile_sdhi.h | 1 -
 2 files changed, 10 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +0 -9
index 663a672..b3fd2c3 100644
@@ -70,13 +70,6 @@ static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev)
 	clk_disable(priv->clk);
 }
 
-static void sh_mobile_sdhi_set_pwr(struct platform_device *pdev, int state)
-{
-	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
-
-	p->set_pwr(pdev, state);
-}
-
 static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host)
 {
 	int timeout = 1000;
@@ -173,8 +166,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->capabilities |= p->tmio_caps;
 		mmc_data->capabilities2 |= p->tmio_caps2;
 		mmc_data->cd_gpio = p->cd_gpio;
-		if (p->set_pwr)
-			mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
 
 		if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) {
 			/*
include/linux/mmc/sh_mobile_sdhi.h +0 -1
index f31c692..68927ae 100644
@@ -25,7 +25,6 @@ struct sh_mobile_sdhi_info {
 	unsigned long tmio_caps2;
 	u32 tmio_ocr_mask;	/* available MMC voltages */
 	unsigned int cd_gpio;
-	void (*set_pwr)(struct platform_device *pdev, int state);
 
 	/* callbacks for board specific setup code */
 	int (*init)(struct platform_device *pdev,
Signature · 1 line
1.8.1.5
#13 lore raw

PATCH v3 13/14 mmc: tmio-mmc: Remove .get_cd() callback from platform data

In reply to Laurent Pinchart

All platforms pass the CD GPIO number to the driver in the .cd_gpio field. The .get_cd() callback isn't used anymore, remove it

---
 drivers/mmc/host/tmio_mmc_pio.c | 16 +---------------
 include/linux/mfd/tmio.h        |  1 -
 2 files changed, 1 insertion(+), 16 deletions(-)
drivers/mmc/host/tmio_mmc_pio.c +1 -15
index 17f7fa9..b380225 100644
@@ -936,25 +936,11 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 		 (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT));
 }
 
-static int tmio_mmc_get_cd(struct mmc_host *mmc)
-{
-	struct tmio_mmc_host *host = mmc_priv(mmc);
-	struct tmio_mmc_data *pdata = host->pdata;
-	int ret = mmc_gpio_get_cd(mmc);
-	if (ret >= 0)
-		return ret;
-
-	if (!pdata->get_cd)
-		return -ENOSYS;
-	else
-		return pdata->get_cd(host->pdev);
-}
-
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
-	.get_cd		= tmio_mmc_get_cd,
+	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
 };
 
include/linux/mfd/tmio.h +0 -1
index ce35113..b22883d 100644
@@ -108,7 +108,6 @@ struct tmio_mmc_data {
 	unsigned int			cd_gpio;
 	void (*set_pwr)(struct platform_device *host, int state);
 	void (*set_clk_div)(struct platform_device *host, int state);
-	int (*get_cd)(struct platform_device *host);
 	int (*write16_hook)(struct tmio_mmc_host *host, int addr);
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
Signature · 1 line
1.8.1.5
#14 lore raw

PATCH v3 14/14 mmc: tmio-mmc: Remove .set_pwr() callback from platform data

In reply to Laurent Pinchart

The .set_pwr() callback isn't used anymore as all platforms register GPIO-controlled regulators. Remove it.

---
 drivers/mmc/host/tmio_mmc.h     | 1 -
 drivers/mmc/host/tmio_mmc_pio.c | 7 -------
 include/linux/mfd/tmio.h        | 1 -
 3 files changed, 9 deletions(-)
drivers/mmc/host/tmio_mmc.h +0 -1
index 86fd21e..39c2f45 100644
@@ -68,7 +68,6 @@ struct tmio_mmc_host {
 	enum tmio_mmc_power	power;
 
 	/* Callbacks for clock / power control */
-	void (*set_pwr)(struct platform_device *host, int state);
 	void (*set_clk_div)(struct platform_device *host, int state);
 
 	/* pio related stuff */
drivers/mmc/host/tmio_mmc_pio.c +0 -7
index b380225..67a3bf1 100644
@@ -777,9 +777,6 @@ static void tmio_mmc_power_on(struct tmio_mmc_host *host, unsigned short vdd)
 
 	/* .set_ios() is returning void, so, no chance to report an error */
 
-	if (host->set_pwr)
-		host->set_pwr(host->pdev, 1);
-
 	if (!IS_ERR(mmc->supply.vmmc)) {
 		ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
 		/*
@@ -813,9 +810,6 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host)
 
 	if (!IS_ERR(mmc->supply.vmmc))
 		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
-
-	if (host->set_pwr)
-		host->set_pwr(host->pdev, 0);
 }
 
 /* Set MMC clock / power.
@@ -1002,7 +996,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	_host->pdev = pdev;
 	platform_set_drvdata(pdev, mmc);
 
-	_host->set_pwr = pdata->set_pwr;
 	_host->set_clk_div = pdata->set_clk_div;
 
 	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
include/linux/mfd/tmio.h +0 -1
index b22883d..baa2346 100644
@@ -106,7 +106,6 @@ struct tmio_mmc_data {
 	struct tmio_mmc_dma		*dma;
 	struct device			*dev;
 	unsigned int			cd_gpio;
-	void (*set_pwr)(struct platform_device *host, int state);
 	void (*set_clk_div)(struct platform_device *host, int state);
 	int (*write16_hook)(struct tmio_mmc_host *host, int addr);
 	/* clock management callbacks */
Signature · 1 line
1.8.1.5
#15 lore raw

v3 cover Remove platform callbacks from mmc_spi, sh_mmcif and sh_mobile_sdhi drivers

In reply to Laurent Pinchart

Hi Chris,

Quoted 28 lines · On Thursday 08 August 2013 12:38:30 Laurent Pinchart wrote:

Hello,

This patch set replaces callbacks to board code with regulators and GPIOs in the mmc_spi, sh_mmcif and sh_mobile_sdhi MMC drivers.

Most of the required infrastructure is in place already on the drivers side, except for CD debouncing support in the MMC core and CD/RO GPIOs support in the mmc_spi driver. The series thus starts with patches 01/14 and 02/14 that add those features to the MMC core and mmc_spi driver.

Patches 03/14 to 07/14 remove the board callbacks from the ecovec24 and vision_ep9307 boards. The code has been compile-tested only as I don't have access to those boards.

Patches 08/14 to 14/14 then proceed to remove the callbacks from the drivers themselves and from the platform data structures.

Compared to v2, the patches have been rebased on the mmc-next branch from
git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git. I've also added patch 07/14 that removes the .set_pwr() callback from the ag5evm board to avoid compilation breakage during bisection.

The series interleaves patches for drivers and board files. The ep93xx and ecovec24 patches have been acked, and the respective ARM subtree maintainers have indicated that they are fine with the patches going through the MMC tree. The ag5evm patch is new, but as the ag5evm board is going to be removed in v3.12, it shouldn't cause any issue.

Quoted 3 lines

Chris, could you take the patches in your tree ? I've pushed them to

git://linuxtv.org/pinchartl/fbdev.git mmc/devel

Ping ?

The following changes since commit 6d1d6b4759112acf4c079eb3a0dd296bdbf61cf5:

mmc: tmio: fix compiler warning (2013-07-23 15:06:47 -0400)

are available in the git repository at:

git://linuxtv.org/pinchartl/fbdev.git mmc/devel

for you to fetch changes up to a3424b35fdfd2d0fe507ef204d4ddebadd1e1157:

mmc: tmio-mmc: Remove .set_pwr() callback from platform data (2013-08-08
12:34:33 +0200)

----------------------------------------------------------------
Laurent Pinchart (14):
mmc: slot-gpio: Add debouncing capability to mmc_gpio_request_cd()
mmc: mmc_spi: Support CD/RO GPIOs
ARM: ep93xx: vision_ep9307: Use MMC CD and RO GPIO
sh: ecovec24: Use MMC/SDHI CD and RO GPIO
sh: ecovec24: Remove mmcif .down_pwr() callback
sh: ecovec24: Remove MMCIF and SDHI .set_pwr() callbacks
ARM: shmobile: ag5evm: Remove SDHI .set_pwr() callback
mmc: mmc_spi: Remove platform data .get_cd() and .get_ro() callbacks
mmc: sh_mmcif: Remove .down_pwr() callback from platform data
mmc: sh_mmcif: Remove .set_pwr() callback from platform data
mmc: sh_mobile_sdhi: Remove .get_cd() callback from platform data
mmc: sh_mobile_sdhi: Remove .set_pwr() callback from platform data
mmc: tmio-mmc: Remove .get_cd() callback from platform data
mmc: tmio-mmc: Remove .set_pwr() callback from platform data

 arch/arm/mach-ep93xx/vision_ep9307.c  | 57 +++------------------------
 arch/arm/mach-shmobile/board-ag5evm.c | 23 -----------
 arch/sh/boards/mach-ecovec24/setup.c  | 89 +++-------------------------------
 drivers/mmc/core/host.c               |  2 +-
 drivers/mmc/core/slot-gpio.c          | 14 ++++++-
 drivers/mmc/host/jz4740_mmc.c         |  2 +-
 drivers/mmc/host/mmc_spi.c            | 49 +++++++++++-------------
 drivers/mmc/host/mvsdio.c             |  3 +-
 drivers/mmc/host/of_mmc_spi.c         | 46 ++++++----------------
 drivers/mmc/host/sdhci-esdhc-imx.c    |  2 +-
 drivers/mmc/host/sdhci-pxav3.c        |  3 +-
 drivers/mmc/host/sdhci-sirf.c         |  2 +-
 drivers/mmc/host/sh_mmcif.c           |  5 +--
 drivers/mmc/host/sh_mobile_sdhi.c     | 18 ---------
 drivers/mmc/host/tmio_mmc.h           |  1 -
 drivers/mmc/host/tmio_mmc_pio.c       | 25 +-----------
 include/linux/mfd/tmio.h              |  2 -
 include/linux/mmc/sh_mmcif.h          |  2 -
 include/linux/mmc/sh_mobile_sdhi.h    |  2 -
 include/linux/mmc/slot-gpio.h         |  3 +-
 include/linux/spi/mmc_spi.h           | 19 ++++++---
 21 files changed, 86 insertions(+), 283 deletions(-)
Quoted 38 lines

Laurent Pinchart (14):
mmc: slot-gpio: Add debouncing capability to mmc_gpio_request_cd()
mmc: mmc_spi: Support CD/RO GPIOs
ARM: ep93xx: vision_ep9307: Use MMC CD and RO GPIO
sh: ecovec24: Use MMC/SDHI CD and RO GPIO
sh: ecovec24: Remove mmcif .down_pwr() callback
sh: ecovec24: Remove MMCIF and SDHI .set_pwr() callbacks
ARM: shmobile: ag5evm: Remove SDHI .set_pwr() callback
mmc: mmc_spi: Remove platform data .get_cd() and .get_ro() callbacks
mmc: sh_mmcif: Remove .down_pwr() callback from platform data
mmc: sh_mmcif: Remove .set_pwr() callback from platform data
mmc: sh_mobile_sdhi: Remove .get_cd() callback from platform data
mmc: sh_mobile_sdhi: Remove .set_pwr() callback from platform data
mmc: tmio-mmc: Remove .get_cd() callback from platform data
mmc: tmio-mmc: Remove .set_pwr() callback from platform data

 arch/arm/mach-ep93xx/vision_ep9307.c  | 57 ++--------------------
 arch/arm/mach-shmobile/board-ag5evm.c | 23 ---------
 arch/sh/boards/mach-ecovec24/setup.c  | 89 ++++----------------------------
 drivers/mmc/core/host.c               |  2 +-
 drivers/mmc/core/slot-gpio.c          | 14 +++++-
 drivers/mmc/host/jz4740_mmc.c         |  2 +-
 drivers/mmc/host/mmc_spi.c            | 49 +++++++++----------
 drivers/mmc/host/mvsdio.c             |  3 +-
 drivers/mmc/host/of_mmc_spi.c         | 46 +++++-------------
 drivers/mmc/host/sdhci-esdhc-imx.c    |  2 +-
 drivers/mmc/host/sdhci-pxav3.c        |  3 +-
 drivers/mmc/host/sdhci-sirf.c         |  2 +-
 drivers/mmc/host/sh_mmcif.c           |  5 +-
 drivers/mmc/host/sh_mobile_sdhi.c     | 18 -------
 drivers/mmc/host/tmio_mmc.h           |  1 -
 drivers/mmc/host/tmio_mmc_pio.c       | 25 +---------
 include/linux/mfd/tmio.h              |  2 -
 include/linux/mmc/sh_mmcif.h          |  2 -
 include/linux/mmc/sh_mobile_sdhi.h    |  2 -
 include/linux/mmc/slot-gpio.h         |  3 +-
 include/linux/spi/mmc_spi.h           | 19 +++++---
 21 files changed, 86 insertions(+), 283 deletions(-)
Signature · 3 lines
Regards,

Laurent Pinchart
#16 lore raw

v3 cover Remove platform callbacks from mmc_spi, sh_mmcif and sh_mobile_sdhi drivers

In reply to Laurent Pinchart

Hi Laurent,

Quoted 8 lines · Laurent Pinchart

This patch set replaces callbacks to board code with regulators and GPIOs in the mmc_spi, sh_mmcif and sh_mobile_sdhi MMC drivers.

Most of the required infrastructure is in place already on the drivers side, except for CD debouncing support in the MMC core and CD/RO GPIOs support in the mmc_spi driver. The series thus starts with patches 01/14 and 02/14 that add those features to the MMC core and mmc_spi driver.

Quoted 6 lines

Patches 03/14 to 07/14 remove the board callbacks from the ecovec24 and vision_ep9307 boards. The code has been compile-tested only as I don't have access to those boards.

Patches 08/14 to 14/14 then proceed to remove the callbacks from the drivers themselves and from the platform data structures.

arch/arm/mach-shmobile/board-ag5evm.c has been removed from linux-next, so I've dropped patch 7 ("ARM: shmobile: ag5evm: Remove SDHI .set_pwr() callback") but taken all of the other patches into mmc-next for 3.12.

Thanks!

- Chris.

Signature · 1 line
Chris Ball   <[email protected]>   <http://printf.net/>
#17 lore raw

v3 cover Remove platform callbacks from mmc_spi, sh_mmcif and sh_mobile_sdhi drivers

Hi Chris,

Quoted 14 lines · On Saturday 24 August 2013 23:58:14 Chris Ball wrote:
Quoted 13 lines · Laurent Pinchart

This patch set replaces callbacks to board code with regulators and GPIOs in the mmc_spi, sh_mmcif and sh_mobile_sdhi MMC drivers.

Most of the required infrastructure is in place already on the drivers side, except for CD debouncing support in the MMC core and CD/RO GPIOs support in the mmc_spi driver. The series thus starts with patches 01/14 and 02/14 that add those features to the MMC core and mmc_spi driver.

Patches 03/14 to 07/14 remove the board callbacks from the ecovec24 and vision_ep9307 boards. The code has been compile-tested only as I don't have
access to those boards.

Quoted 7 lines
Quoted 2 lines

Patches 08/14 to 14/14 then proceed to remove the callbacks from the drivers themselves and from the platform data structures.

arch/arm/mach-shmobile/board-ag5evm.c has been removed from linux-next, so I've dropped patch 7 ("ARM: shmobile: ag5evm: Remove SDHI .set_pwr() callback") but taken all of the other patches into mmc-next for 3.12.

Patch 7 was only meant to avoid bisection breakages if your tree gets merged before the ARM tree. If it gets merged before you can indeed drop it.

Signature · 3 lines
Regards,

Laurent Pinchart