All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] mmc: tmio/SDHI fixup patches
@ 2013-11-20  8:30 ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:30 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc


Hi Chris

Now, our new board would like to use sh_mobile_sdhi driver,
then, it is expecting sh_mobile_sdhi use regulator.
But, this regulator is based on GPIO driver,
and GPIO driver probe timing is after sh_mobile_sdhi.
So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
and it doesn't work for us.
#1 patch returns -EPROBE_DEFER in such case.
it changes tmio_mmc_host_probe() behavior, but
in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
and, current user has no conflict by this patch.

sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
#2 - #4 cares such case.

These were part of "SDHI support for r8a7790" patch set,
but was separated

Kuninori Morimoto (4):
      mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
      mmc: tmio: bus_shift become tmio_mmc_data member
      mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
      mmc: SDHI: add SoC specific workaround via HW version

 drivers/mmc/host/sh_mobile_sdhi.c |   19 +++++++++++++++++++
 drivers/mmc/host/tmio_mmc.c       |    9 +++++++++
 drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 drivers/mmc/host/tmio_mmc_pio.c   |   36 +++++++++++++++++++-----------------
 include/linux/mfd/tmio.h          |    8 ++++++++
 include/linux/mmc/tmio.h          |    1 +
 7 files changed, 65 insertions(+), 27 deletions(-)


Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 0/4] mmc: tmio/SDHI fixup patches
@ 2013-11-20  8:30 ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:30 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc


Hi Chris

Now, our new board would like to use sh_mobile_sdhi driver,
then, it is expecting sh_mobile_sdhi use regulator.
But, this regulator is based on GPIO driver,
and GPIO driver probe timing is after sh_mobile_sdhi.
So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
and it doesn't work for us.
#1 patch returns -EPROBE_DEFER in such case.
it changes tmio_mmc_host_probe() behavior, but
in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
and, current user has no conflict by this patch.

sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
#2 - #4 cares such case.

These were part of "SDHI support for r8a7790" patch set,
but was separated

Kuninori Morimoto (4):
      mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
      mmc: tmio: bus_shift become tmio_mmc_data member
      mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
      mmc: SDHI: add SoC specific workaround via HW version

 drivers/mmc/host/sh_mobile_sdhi.c |   19 +++++++++++++++++++
 drivers/mmc/host/tmio_mmc.c       |    9 +++++++++
 drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 drivers/mmc/host/tmio_mmc_pio.c   |   36 +++++++++++++++++++-----------------
 include/linux/mfd/tmio.h          |    8 ++++++++
 include/linux/mmc/tmio.h          |    1 +
 7 files changed, 65 insertions(+), 27 deletions(-)


Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 1/4] mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
  2013-11-20  8:30 ` Kuninori Morimoto
@ 2013-11-20  8:30   ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:30 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

Current tmio driver tries to use default ocr_avail
if 1) it couldn't find regulator and 2) if platform data
doesn't have ocr_mask.
But, there is no guarantee that regulator driver probe
is faster than TMIO driver probe.
TMIO driver will not use regulator in such case.
By this patch, TMIO driver returns -EPROBE_DEFER if it
couldn't find regulator and if platform doesn't have ocr_mask.
Because, there is possibility that regulator
has not been probed, but the user is expecting it.

This patch changes tmio_mmc_host_probe() behavior,
but there is no user who has conflict.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b380225..7b25d0e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -944,17 +944,25 @@ static const struct mmc_host_ops tmio_mmc_ops = {
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
 };
 
-static void tmio_mmc_init_ocr(struct tmio_mmc_host *host)
+static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
 {
 	struct tmio_mmc_data *pdata = host->pdata;
 	struct mmc_host *mmc = host->mmc;
 
 	mmc_regulator_get_supply(mmc);
 
+	/* use ocr_mask if no regulator */
 	if (!mmc->ocr_avail)
-		mmc->ocr_avail = pdata->ocr_mask ? : MMC_VDD_32_33 | MMC_VDD_33_34;
-	else if (pdata->ocr_mask)
-		dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n");
+		mmc->ocr_avail =  pdata->ocr_mask;
+
+	/*
+	 * try again.
+	 * There is possibility that regulator has not been probed
+	 */
+	if (!mmc->ocr_avail)
+		return -EPROBE_DEFER;
+
+	return 0;
 }
 
 static void tmio_mmc_of_parse(struct platform_device *pdev,
@@ -1008,6 +1016,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
 	_host->bus_shift = resource_size(res_ctl) >> 10;
 
+	ret = tmio_mmc_init_ocr(_host);
+	if (ret < 0)
+		goto host_free;
+
 	_host->ctl = ioremap(res_ctl->start, resource_size(res_ctl));
 	if (!_host->ctl) {
 		ret = -ENOMEM;
@@ -1023,7 +1035,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 		mmc->max_segs;
 	mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
 	mmc->max_seg_size = mmc->max_req_size;
-	tmio_mmc_init_ocr(_host);
 
 	_host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
 				  mmc->caps & MMC_CAP_NEEDS_POLL ||
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 1/4] mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
@ 2013-11-20  8:30   ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:30 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

Current tmio driver tries to use default ocr_avail
if 1) it couldn't find regulator and 2) if platform data
doesn't have ocr_mask.
But, there is no guarantee that regulator driver probe
is faster than TMIO driver probe.
TMIO driver will not use regulator in such case.
By this patch, TMIO driver returns -EPROBE_DEFER if it
couldn't find regulator and if platform doesn't have ocr_mask.
Because, there is possibility that regulator
has not been probed, but the user is expecting it.

This patch changes tmio_mmc_host_probe() behavior,
but there is no user who has conflict.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b380225..7b25d0e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -944,17 +944,25 @@ static const struct mmc_host_ops tmio_mmc_ops = {
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
 };
 
-static void tmio_mmc_init_ocr(struct tmio_mmc_host *host)
+static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
 {
 	struct tmio_mmc_data *pdata = host->pdata;
 	struct mmc_host *mmc = host->mmc;
 
 	mmc_regulator_get_supply(mmc);
 
+	/* use ocr_mask if no regulator */
 	if (!mmc->ocr_avail)
-		mmc->ocr_avail = pdata->ocr_mask ? : MMC_VDD_32_33 | MMC_VDD_33_34;
-	else if (pdata->ocr_mask)
-		dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n");
+		mmc->ocr_avail =  pdata->ocr_mask;
+
+	/*
+	 * try again.
+	 * There is possibility that regulator has not been probed
+	 */
+	if (!mmc->ocr_avail)
+		return -EPROBE_DEFER;
+
+	return 0;
 }
 
 static void tmio_mmc_of_parse(struct platform_device *pdev,
@@ -1008,6 +1016,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
 	_host->bus_shift = resource_size(res_ctl) >> 10;
 
+	ret = tmio_mmc_init_ocr(_host);
+	if (ret < 0)
+		goto host_free;
+
 	_host->ctl = ioremap(res_ctl->start, resource_size(res_ctl));
 	if (!_host->ctl) {
 		ret = -ENOMEM;
@@ -1023,7 +1035,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 		mmc->max_segs;
 	mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
 	mmc->max_seg_size = mmc->max_req_size;
-	tmio_mmc_init_ocr(_host);
 
 	_host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
 				  mmc->caps & MMC_CAP_NEEDS_POLL ||
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 2/4] mmc: tmio: bus_shift become tmio_mmc_data member
  2013-11-20  8:30 ` Kuninori Morimoto
@ 2013-11-20  8:30   ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:30 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

.bus_shift is used to 16/32bit register access
offset calculation om tmio driver.
tmio_mmc_xxx is used from Toshiba/Renesas now,
but this bus_shift value depends on HW IP.
This patch moves .bus_shift to tmio_mmc_data member
and set it on each driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    8 ++++++++
 drivers/mmc/host/tmio_mmc.c       |    8 ++++++++
 drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 drivers/mmc/host/tmio_mmc_pio.c   |    3 ---
 include/linux/mfd/tmio.h          |    1 +
 6 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index f344659..f1e35a7 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -133,10 +133,15 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	struct tmio_mmc_data *mmc_data;
 	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
 	struct tmio_mmc_host *host;
+	struct resource *res;
 	int irq, ret, i = 0;
 	bool multiplexed_isr = true;
 	struct tmio_mmc_dma *dma_priv;
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -EINVAL;
+
 	priv = devm_kzalloc(&pdev->dev, sizeof(struct sh_mobile_sdhi), GFP_KERNEL);
 	if (priv = NULL) {
 		dev_err(&pdev->dev, "kzalloc failed\n");
@@ -206,6 +211,9 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 	}
 
+	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
+	mmc_data->bus_shift = resource_size(res) >> 9;
+
 	ret = tmio_mmc_host_probe(&host, pdev, mmc_data);
 	if (ret < 0)
 		goto eprobe;
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 8860d4d..6cfb2d5 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -62,6 +62,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 	const struct mfd_cell *cell = mfd_get_cell(pdev);
 	struct tmio_mmc_data *pdata;
 	struct tmio_mmc_host *host;
+	struct resource *res;
 	int ret = -EINVAL, irq;
 
 	if (pdev->num_resources != 2)
@@ -84,6 +85,13 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 			goto out;
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -EINVAL;
+
+	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
+	pdata->bus_shift = resource_size(res_ctl) >> 10;
+
 	ret = tmio_mmc_host_probe(&host, pdev, pdata);
 	if (ret)
 		goto cell_disable;
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 86fd21e..aaa9c7e 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -58,7 +58,6 @@ enum tmio_mmc_power {
 
 struct tmio_mmc_host {
 	void __iomem *ctl;
-	unsigned long bus_shift;
 	struct mmc_command      *cmd;
 	struct mmc_request      *mrq;
 	struct mmc_data         *data;
@@ -176,19 +175,19 @@ int tmio_mmc_host_runtime_resume(struct device *dev);
 
 static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
 {
-	return readw(host->ctl + (addr << host->bus_shift));
+	return readw(host->ctl + (addr << host->pdata->bus_shift));
 }
 
 static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr,
 		u16 *buf, int count)
 {
-	readsw(host->ctl + (addr << host->bus_shift), buf, count);
+	readsw(host->ctl + (addr << host->pdata->bus_shift), buf, count);
 }
 
 static inline u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr)
 {
-	return readw(host->ctl + (addr << host->bus_shift)) |
-	       readw(host->ctl + ((addr + 2) << host->bus_shift)) << 16;
+	return readw(host->ctl + (addr << host->pdata->bus_shift)) |
+	       readw(host->ctl + ((addr + 2) << host->pdata->bus_shift)) << 16;
 }
 
 static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
@@ -198,19 +197,19 @@ static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val
 	 */
 	if (host->pdata->write16_hook && host->pdata->write16_hook(host, addr))
 		return;
-	writew(val, host->ctl + (addr << host->bus_shift));
+	writew(val, host->ctl + (addr << host->pdata->bus_shift));
 }
 
 static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr,
 		u16 *buf, int count)
 {
-	writesw(host->ctl + (addr << host->bus_shift), buf, count);
+	writesw(host->ctl + (addr << host->pdata->bus_shift), buf, count);
 }
 
 static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val)
 {
-	writew(val, host->ctl + (addr << host->bus_shift));
-	writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
+	writew(val, host->ctl + (addr << host->pdata->bus_shift));
+	writew(val >> 16, host->ctl + ((addr + 2) << host->pdata->bus_shift));
 }
 
 
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 65edb4a..03e7b28 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -293,7 +293,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_tx)
 			cfg.slave_id = pdata->dma->slave_id_tx;
 		cfg.direction = DMA_MEM_TO_DEV;
-		cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
+		cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->pdata->bus_shift);
 		cfg.src_addr = 0;
 		ret = dmaengine_slave_config(host->chan_tx, &cfg);
 		if (ret < 0)
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 7b25d0e..bb22314 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -1013,9 +1013,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	_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 */
-	_host->bus_shift = resource_size(res_ctl) >> 10;
-
 	ret = tmio_mmc_init_ocr(_host);
 	if (ret < 0)
 		goto host_free;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index b22883d..92f72cf 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -102,6 +102,7 @@ struct tmio_mmc_data {
 	unsigned long			capabilities;
 	unsigned long			capabilities2;
 	unsigned long			flags;
+	unsigned long			bus_shift;
 	u32				ocr_mask;	/* available voltages */
 	struct tmio_mmc_dma		*dma;
 	struct device			*dev;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 2/4] mmc: tmio: bus_shift become tmio_mmc_data member
@ 2013-11-20  8:30   ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:30 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

.bus_shift is used to 16/32bit register access
offset calculation om tmio driver.
tmio_mmc_xxx is used from Toshiba/Renesas now,
but this bus_shift value depends on HW IP.
This patch moves .bus_shift to tmio_mmc_data member
and set it on each driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    8 ++++++++
 drivers/mmc/host/tmio_mmc.c       |    8 ++++++++
 drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 drivers/mmc/host/tmio_mmc_pio.c   |    3 ---
 include/linux/mfd/tmio.h          |    1 +
 6 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index f344659..f1e35a7 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -133,10 +133,15 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	struct tmio_mmc_data *mmc_data;
 	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
 	struct tmio_mmc_host *host;
+	struct resource *res;
 	int irq, ret, i = 0;
 	bool multiplexed_isr = true;
 	struct tmio_mmc_dma *dma_priv;
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -EINVAL;
+
 	priv = devm_kzalloc(&pdev->dev, sizeof(struct sh_mobile_sdhi), GFP_KERNEL);
 	if (priv == NULL) {
 		dev_err(&pdev->dev, "kzalloc failed\n");
@@ -206,6 +211,9 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 	}
 
+	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
+	mmc_data->bus_shift = resource_size(res) >> 9;
+
 	ret = tmio_mmc_host_probe(&host, pdev, mmc_data);
 	if (ret < 0)
 		goto eprobe;
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 8860d4d..6cfb2d5 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -62,6 +62,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 	const struct mfd_cell *cell = mfd_get_cell(pdev);
 	struct tmio_mmc_data *pdata;
 	struct tmio_mmc_host *host;
+	struct resource *res;
 	int ret = -EINVAL, irq;
 
 	if (pdev->num_resources != 2)
@@ -84,6 +85,13 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 			goto out;
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -EINVAL;
+
+	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
+	pdata->bus_shift = resource_size(res_ctl) >> 10;
+
 	ret = tmio_mmc_host_probe(&host, pdev, pdata);
 	if (ret)
 		goto cell_disable;
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 86fd21e..aaa9c7e 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -58,7 +58,6 @@ enum tmio_mmc_power {
 
 struct tmio_mmc_host {
 	void __iomem *ctl;
-	unsigned long bus_shift;
 	struct mmc_command      *cmd;
 	struct mmc_request      *mrq;
 	struct mmc_data         *data;
@@ -176,19 +175,19 @@ int tmio_mmc_host_runtime_resume(struct device *dev);
 
 static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
 {
-	return readw(host->ctl + (addr << host->bus_shift));
+	return readw(host->ctl + (addr << host->pdata->bus_shift));
 }
 
 static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr,
 		u16 *buf, int count)
 {
-	readsw(host->ctl + (addr << host->bus_shift), buf, count);
+	readsw(host->ctl + (addr << host->pdata->bus_shift), buf, count);
 }
 
 static inline u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr)
 {
-	return readw(host->ctl + (addr << host->bus_shift)) |
-	       readw(host->ctl + ((addr + 2) << host->bus_shift)) << 16;
+	return readw(host->ctl + (addr << host->pdata->bus_shift)) |
+	       readw(host->ctl + ((addr + 2) << host->pdata->bus_shift)) << 16;
 }
 
 static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
@@ -198,19 +197,19 @@ static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val
 	 */
 	if (host->pdata->write16_hook && host->pdata->write16_hook(host, addr))
 		return;
-	writew(val, host->ctl + (addr << host->bus_shift));
+	writew(val, host->ctl + (addr << host->pdata->bus_shift));
 }
 
 static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr,
 		u16 *buf, int count)
 {
-	writesw(host->ctl + (addr << host->bus_shift), buf, count);
+	writesw(host->ctl + (addr << host->pdata->bus_shift), buf, count);
 }
 
 static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val)
 {
-	writew(val, host->ctl + (addr << host->bus_shift));
-	writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
+	writew(val, host->ctl + (addr << host->pdata->bus_shift));
+	writew(val >> 16, host->ctl + ((addr + 2) << host->pdata->bus_shift));
 }
 
 
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 65edb4a..03e7b28 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -293,7 +293,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_tx)
 			cfg.slave_id = pdata->dma->slave_id_tx;
 		cfg.direction = DMA_MEM_TO_DEV;
-		cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
+		cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->pdata->bus_shift);
 		cfg.src_addr = 0;
 		ret = dmaengine_slave_config(host->chan_tx, &cfg);
 		if (ret < 0)
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 7b25d0e..bb22314 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -1013,9 +1013,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	_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 */
-	_host->bus_shift = resource_size(res_ctl) >> 10;
-
 	ret = tmio_mmc_init_ocr(_host);
 	if (ret < 0)
 		goto host_free;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index b22883d..92f72cf 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -102,6 +102,7 @@ struct tmio_mmc_data {
 	unsigned long			capabilities;
 	unsigned long			capabilities2;
 	unsigned long			flags;
+	unsigned long			bus_shift;
 	u32				ocr_mask;	/* available voltages */
 	struct tmio_mmc_dma		*dma;
 	struct device			*dev;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 3/4] mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
  2013-11-20  8:30 ` Kuninori Morimoto
@ 2013-11-20  8:31   ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:31 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

The accessibility checking method to the
higher register was added by
69d1fe18e92afb4687605a1ab2ec73fbc3bae344
(mmc: tmio: only access registers above 0xff, if available)
But, it doesn't care 32bit register.
it is impossible to calculate it from  resource size, since,
there is 16/32 bit register IP
(ex VERSION is located on 0xe2 if 16bit register,
but it is located on  0x1c4 if 32bit register).
This patch adds new TMIO_MMC_HAVE_HIGH_REG flags,
tmio_mmc driver has it, and sh_mobile_sdhi doesn't has it today.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc.c     |    1 +
 drivers/mmc/host/tmio_mmc_pio.c |   14 ++++----------
 include/linux/mfd/tmio.h        |    7 +++++++
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 6cfb2d5..8a781e2 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -91,6 +91,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 
 	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
 	pdata->bus_shift = resource_size(res_ctl) >> 10;
+	pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
 
 	ret = tmio_mmc_host_probe(&host, pdev, pdata);
 	if (ret)
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index bb22314..8e5d54f0 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -161,10 +161,8 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 
 static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 {
-	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
 	/* implicit BUG_ON(!res) */
-	if (resource_size(res) > 0x100) {
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
 		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
 		msleep(10);
 	}
@@ -176,14 +174,12 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 
 static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 {
-	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
 	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
 		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
 	msleep(10);
 
 	/* implicit BUG_ON(!res) */
-	if (resource_size(res) > 0x100) {
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
 		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
 		msleep(10);
 	}
@@ -191,16 +187,14 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 
 static void tmio_mmc_reset(struct tmio_mmc_host *host)
 {
-	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
 	/* FIXME - should we set stop clock reg here */
 	sd_ctrl_write16(host, CTL_RESET_SD, 0x0000);
 	/* implicit BUG_ON(!res) */
-	if (resource_size(res) > 0x100)
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
 		sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
 	msleep(10);
 	sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
-	if (resource_size(res) > 0x100)
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
 		sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
 	msleep(10);
 }
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 92f72cf..8f6f2e9 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -76,6 +76,13 @@
  */
 #define TMIO_MMC_USE_GPIO_CD		(1 << 5)
 
+/*
+ * Some controllers doesn't have over 0x100 register.
+ * it is used to checking accessibility of
+ * CTL_SD_CARD_CLK_CTL / CTL_CLK_AND_WAIT_CTL
+ */
+#define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 3/4] mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
@ 2013-11-20  8:31   ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:31 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

The accessibility checking method to the
higher register was added by
69d1fe18e92afb4687605a1ab2ec73fbc3bae344
(mmc: tmio: only access registers above 0xff, if available)
But, it doesn't care 32bit register.
it is impossible to calculate it from  resource size, since,
there is 16/32 bit register IP
(ex VERSION is located on 0xe2 if 16bit register,
but it is located on  0x1c4 if 32bit register).
This patch adds new TMIO_MMC_HAVE_HIGH_REG flags,
tmio_mmc driver has it, and sh_mobile_sdhi doesn't has it today.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc.c     |    1 +
 drivers/mmc/host/tmio_mmc_pio.c |   14 ++++----------
 include/linux/mfd/tmio.h        |    7 +++++++
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 6cfb2d5..8a781e2 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -91,6 +91,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 
 	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
 	pdata->bus_shift = resource_size(res_ctl) >> 10;
+	pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
 
 	ret = tmio_mmc_host_probe(&host, pdev, pdata);
 	if (ret)
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index bb22314..8e5d54f0 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -161,10 +161,8 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 
 static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 {
-	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
 	/* implicit BUG_ON(!res) */
-	if (resource_size(res) > 0x100) {
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
 		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
 		msleep(10);
 	}
@@ -176,14 +174,12 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 
 static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 {
-	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
 	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
 		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
 	msleep(10);
 
 	/* implicit BUG_ON(!res) */
-	if (resource_size(res) > 0x100) {
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
 		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
 		msleep(10);
 	}
@@ -191,16 +187,14 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 
 static void tmio_mmc_reset(struct tmio_mmc_host *host)
 {
-	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
-
 	/* FIXME - should we set stop clock reg here */
 	sd_ctrl_write16(host, CTL_RESET_SD, 0x0000);
 	/* implicit BUG_ON(!res) */
-	if (resource_size(res) > 0x100)
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
 		sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
 	msleep(10);
 	sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
-	if (resource_size(res) > 0x100)
+	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
 		sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
 	msleep(10);
 }
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 92f72cf..8f6f2e9 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -76,6 +76,13 @@
  */
 #define TMIO_MMC_USE_GPIO_CD		(1 << 5)
 
+/*
+ * Some controllers doesn't have over 0x100 register.
+ * it is used to checking accessibility of
+ * CTL_SD_CARD_CLK_CTL / CTL_CLK_AND_WAIT_CTL
+ */
+#define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 4/4] mmc: SDHI: add SoC specific workaround via HW version
  2013-11-20  8:30 ` Kuninori Morimoto
@ 2013-11-20  8:31   ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:31 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

One of Renesas SDHI chip needs workaround to use it,
and, we can judge it based on chip version.
This patch adds very quick-hack workaround method,
since we still don't know how many chips
need workaround in the future.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |   11 +++++++++++
 include/linux/mmc/tmio.h          |    1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index f1e35a7..d241d86 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -33,6 +33,8 @@
 
 #include "tmio_mmc.h"
 
+#define EXT_ACC           0xe4
+
 struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 };
@@ -137,6 +139,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	int irq, ret, i = 0;
 	bool multiplexed_isr = true;
 	struct tmio_mmc_dma *dma_priv;
+	u16 ver;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -219,6 +222,14 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		goto eprobe;
 
 	/*
+	 * FIXME:
+	 * this Workaround can be more clever method
+	 */
+	ver = sd_ctrl_read16(host, CTL_VERSION);
+	if (ver = 0xCB0D)
+		sd_ctrl_write16(host, EXT_ACC, 1);
+
+	/*
 	 * Allow one or more specific (named) ISRs or
 	 * one or more multiplexed (un-named) ISRs.
 	 */
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
index a1c1f32..84d9053 100644
--- a/include/linux/mmc/tmio.h
+++ b/include/linux/mmc/tmio.h
@@ -33,6 +33,7 @@
 #define CTL_SDIO_IRQ_MASK 0x38
 #define CTL_DMA_ENABLE 0xd8
 #define CTL_RESET_SD 0xe0
+#define CTL_VERSION 0xe2
 #define CTL_SDIO_REGS 0x100
 #define CTL_CLK_AND_WAIT_CTL 0x138
 #define CTL_RESET_SDIO 0x1e0
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 4/4] mmc: SDHI: add SoC specific workaround via HW version
@ 2013-11-20  8:31   ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-20  8:31 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

One of Renesas SDHI chip needs workaround to use it,
and, we can judge it based on chip version.
This patch adds very quick-hack workaround method,
since we still don't know how many chips
need workaround in the future.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |   11 +++++++++++
 include/linux/mmc/tmio.h          |    1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index f1e35a7..d241d86 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -33,6 +33,8 @@
 
 #include "tmio_mmc.h"
 
+#define EXT_ACC           0xe4
+
 struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 };
@@ -137,6 +139,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	int irq, ret, i = 0;
 	bool multiplexed_isr = true;
 	struct tmio_mmc_dma *dma_priv;
+	u16 ver;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -219,6 +222,14 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		goto eprobe;
 
 	/*
+	 * FIXME:
+	 * this Workaround can be more clever method
+	 */
+	ver = sd_ctrl_read16(host, CTL_VERSION);
+	if (ver == 0xCB0D)
+		sd_ctrl_write16(host, EXT_ACC, 1);
+
+	/*
 	 * Allow one or more specific (named) ISRs or
 	 * one or more multiplexed (un-named) ISRs.
 	 */
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
index a1c1f32..84d9053 100644
--- a/include/linux/mmc/tmio.h
+++ b/include/linux/mmc/tmio.h
@@ -33,6 +33,7 @@
 #define CTL_SDIO_IRQ_MASK 0x38
 #define CTL_DMA_ENABLE 0xd8
 #define CTL_RESET_SD 0xe0
+#define CTL_VERSION 0xe2
 #define CTL_SDIO_REGS 0x100
 #define CTL_CLK_AND_WAIT_CTL 0x138
 #define CTL_RESET_SDIO 0x1e0
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
  2013-11-20  8:30 ` Kuninori Morimoto
@ 2013-11-29  2:29   ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-29  2:29 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

Hi Chris

I would like to know current status of these patches

> Now, our new board would like to use sh_mobile_sdhi driver,
> then, it is expecting sh_mobile_sdhi use regulator.
> But, this regulator is based on GPIO driver,
> and GPIO driver probe timing is after sh_mobile_sdhi.
> So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> and it doesn't work for us.
> #1 patch returns -EPROBE_DEFER in such case.
> it changes tmio_mmc_host_probe() behavior, but
> in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> and, current user has no conflict by this patch.
> 
> sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> #2 - #4 cares such case.
> 
> These were part of "SDHI support for r8a7790" patch set,
> but was separated
> 
> Kuninori Morimoto (4):
>       mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
>       mmc: tmio: bus_shift become tmio_mmc_data member
>       mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
>       mmc: SDHI: add SoC specific workaround via HW version
> 
>  drivers/mmc/host/sh_mobile_sdhi.c |   19 +++++++++++++++++++
>  drivers/mmc/host/tmio_mmc.c       |    9 +++++++++
>  drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
>  drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
>  drivers/mmc/host/tmio_mmc_pio.c   |   36 +++++++++++++++++++-----------------
>  include/linux/mfd/tmio.h          |    8 ++++++++
>  include/linux/mmc/tmio.h          |    1 +
>  7 files changed, 65 insertions(+), 27 deletions(-)
> 
> 
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
@ 2013-11-29  2:29   ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-11-29  2:29 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

Hi Chris

I would like to know current status of these patches

> Now, our new board would like to use sh_mobile_sdhi driver,
> then, it is expecting sh_mobile_sdhi use regulator.
> But, this regulator is based on GPIO driver,
> and GPIO driver probe timing is after sh_mobile_sdhi.
> So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> and it doesn't work for us.
> #1 patch returns -EPROBE_DEFER in such case.
> it changes tmio_mmc_host_probe() behavior, but
> in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> and, current user has no conflict by this patch.
> 
> sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> #2 - #4 cares such case.
> 
> These were part of "SDHI support for r8a7790" patch set,
> but was separated
> 
> Kuninori Morimoto (4):
>       mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
>       mmc: tmio: bus_shift become tmio_mmc_data member
>       mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
>       mmc: SDHI: add SoC specific workaround via HW version
> 
>  drivers/mmc/host/sh_mobile_sdhi.c |   19 +++++++++++++++++++
>  drivers/mmc/host/tmio_mmc.c       |    9 +++++++++
>  drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
>  drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
>  drivers/mmc/host/tmio_mmc_pio.c   |   36 +++++++++++++++++++-----------------
>  include/linux/mfd/tmio.h          |    8 ++++++++
>  include/linux/mmc/tmio.h          |    1 +
>  7 files changed, 65 insertions(+), 27 deletions(-)
> 
> 
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
  2013-11-20  8:30 ` Kuninori Morimoto
@ 2013-12-10  2:56   ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-12-10  2:56 UTC (permalink / raw)
  To: Chris Ball; +Cc: Simon, Magnus, Linux-SH, linux-mmc

> Hi Chris

ping ?

> Now, our new board would like to use sh_mobile_sdhi driver,
> then, it is expecting sh_mobile_sdhi use regulator.
> But, this regulator is based on GPIO driver,
> and GPIO driver probe timing is after sh_mobile_sdhi.
> So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> and it doesn't work for us.
> #1 patch returns -EPROBE_DEFER in such case.
> it changes tmio_mmc_host_probe() behavior, but
> in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> and, current user has no conflict by this patch.
> 
> sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> #2 - #4 cares such case.
> 
> These were part of "SDHI support for r8a7790" patch set,
> but was separated
> 
> Kuninori Morimoto (4):
>       mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
>       mmc: tmio: bus_shift become tmio_mmc_data member
>       mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
>       mmc: SDHI: add SoC specific workaround via HW version
> 
>  drivers/mmc/host/sh_mobile_sdhi.c |   19 +++++++++++++++++++
>  drivers/mmc/host/tmio_mmc.c       |    9 +++++++++
>  drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
>  drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
>  drivers/mmc/host/tmio_mmc_pio.c   |   36 +++++++++++++++++++-----------------
>  include/linux/mfd/tmio.h          |    8 ++++++++
>  include/linux/mmc/tmio.h          |    1 +
>  7 files changed, 65 insertions(+), 27 deletions(-)
> 
> 
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
@ 2013-12-10  2:56   ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-12-10  2:56 UTC (permalink / raw)
  To: Chris Ball; +Cc: Simon, Magnus, Linux-SH, linux-mmc

> Hi Chris

ping ?

> Now, our new board would like to use sh_mobile_sdhi driver,
> then, it is expecting sh_mobile_sdhi use regulator.
> But, this regulator is based on GPIO driver,
> and GPIO driver probe timing is after sh_mobile_sdhi.
> So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> and it doesn't work for us.
> #1 patch returns -EPROBE_DEFER in such case.
> it changes tmio_mmc_host_probe() behavior, but
> in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> and, current user has no conflict by this patch.
> 
> sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> #2 - #4 cares such case.
> 
> These were part of "SDHI support for r8a7790" patch set,
> but was separated
> 
> Kuninori Morimoto (4):
>       mmc: tmio: use -EPROBE_DEFER if driver can't find regulator
>       mmc: tmio: bus_shift become tmio_mmc_data member
>       mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
>       mmc: SDHI: add SoC specific workaround via HW version
> 
>  drivers/mmc/host/sh_mobile_sdhi.c |   19 +++++++++++++++++++
>  drivers/mmc/host/tmio_mmc.c       |    9 +++++++++
>  drivers/mmc/host/tmio_mmc.h       |   17 ++++++++---------
>  drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
>  drivers/mmc/host/tmio_mmc_pio.c   |   36 +++++++++++++++++++-----------------
>  include/linux/mfd/tmio.h          |    8 ++++++++
>  include/linux/mmc/tmio.h          |    1 +
>  7 files changed, 65 insertions(+), 27 deletions(-)
> 
> 
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
  2013-11-20  8:30 ` Kuninori Morimoto
@ 2013-12-12  1:45   ` Chris Ball
  -1 siblings, 0 replies; 27+ messages in thread
From: Chris Ball @ 2013-12-12  1:45 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Simon, Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

Hi Kuninori,

On Wed, Nov 20 2013, Kuninori Morimoto wrote:
> Hi Chris
>
> Now, our new board would like to use sh_mobile_sdhi driver,
> then, it is expecting sh_mobile_sdhi use regulator.
> But, this regulator is based on GPIO driver,
> and GPIO driver probe timing is after sh_mobile_sdhi.
> So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> and it doesn't work for us.
> #1 patch returns -EPROBE_DEFER in such case.
> it changes tmio_mmc_host_probe() behavior, but
> in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> and, current user has no conflict by this patch.
>
> sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> #2 - #4 cares such case.
>
> These were part of "SDHI support for r8a7790" patch set,
> but was separated

Sorry for the delay, I've pushed all four patches to mmc-next for
3.14.  Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
@ 2013-12-12  1:45   ` Chris Ball
  0 siblings, 0 replies; 27+ messages in thread
From: Chris Ball @ 2013-12-12  1:45 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Simon, Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

Hi Kuninori,

On Wed, Nov 20 2013, Kuninori Morimoto wrote:
> Hi Chris
>
> Now, our new board would like to use sh_mobile_sdhi driver,
> then, it is expecting sh_mobile_sdhi use regulator.
> But, this regulator is based on GPIO driver,
> and GPIO driver probe timing is after sh_mobile_sdhi.
> So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> and it doesn't work for us.
> #1 patch returns -EPROBE_DEFER in such case.
> it changes tmio_mmc_host_probe() behavior, but
> in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> and, current user has no conflict by this patch.
>
> sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> #2 - #4 cares such case.
>
> These were part of "SDHI support for r8a7790" patch set,
> but was separated

Sorry for the delay, I've pushed all four patches to mmc-next for
3.14.  Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
  2013-12-12  1:45   ` Chris Ball
@ 2013-12-12  8:26     ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-12-12  8:26 UTC (permalink / raw)
  To: Chris Ball, Simon; +Cc: Kuninori Morimoto, Magnus, Linux-SH, linux-mmc


Hi Chris, Simon

> > Now, our new board would like to use sh_mobile_sdhi driver,
> > then, it is expecting sh_mobile_sdhi use regulator.
> > But, this regulator is based on GPIO driver,
> > and GPIO driver probe timing is after sh_mobile_sdhi.
> > So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> > and it doesn't work for us.
> > #1 patch returns -EPROBE_DEFER in such case.
> > it changes tmio_mmc_host_probe() behavior, but
> > in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> > and, current user has no conflict by this patch.
> >
> > sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> > #2 - #4 cares such case.
> >
> > These were part of "SDHI support for r8a7790" patch set,
> > but was separated
> 
> Sorry for the delay, I've pushed all four patches to mmc-next for
> 3.14.  Thanks,

Chris
Thank you for your hard work about this.

Simon
Lager SDHI needs these patches.
Can you use this branch ?
If yes, I can re-send patches.

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
@ 2013-12-12  8:26     ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2013-12-12  8:26 UTC (permalink / raw)
  To: Chris Ball, Simon; +Cc: Kuninori Morimoto, Magnus, Linux-SH, linux-mmc


Hi Chris, Simon

> > Now, our new board would like to use sh_mobile_sdhi driver,
> > then, it is expecting sh_mobile_sdhi use regulator.
> > But, this regulator is based on GPIO driver,
> > and GPIO driver probe timing is after sh_mobile_sdhi.
> > So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> > and it doesn't work for us.
> > #1 patch returns -EPROBE_DEFER in such case.
> > it changes tmio_mmc_host_probe() behavior, but
> > in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> > and, current user has no conflict by this patch.
> >
> > sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> > #2 - #4 cares such case.
> >
> > These were part of "SDHI support for r8a7790" patch set,
> > but was separated
> 
> Sorry for the delay, I've pushed all four patches to mmc-next for
> 3.14.  Thanks,

Chris
Thank you for your hard work about this.

Simon
Lager SDHI needs these patches.
Can you use this branch ?
If yes, I can re-send patches.

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
  2013-12-12  8:26     ` Kuninori Morimoto
@ 2013-12-13  0:11       ` Simon Horman
  -1 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2013-12-13  0:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Kuninori Morimoto, Magnus, Linux-SH, linux-mmc

On Thu, Dec 12, 2013 at 12:26:42AM -0800, Kuninori Morimoto wrote:
> 
> Hi Chris, Simon
> 
> > > Now, our new board would like to use sh_mobile_sdhi driver,
> > > then, it is expecting sh_mobile_sdhi use regulator.
> > > But, this regulator is based on GPIO driver,
> > > and GPIO driver probe timing is after sh_mobile_sdhi.
> > > So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> > > and it doesn't work for us.
> > > #1 patch returns -EPROBE_DEFER in such case.
> > > it changes tmio_mmc_host_probe() behavior, but
> > > in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> > > and, current user has no conflict by this patch.
> > >
> > > sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> > > #2 - #4 cares such case.
> > >
> > > These were part of "SDHI support for r8a7790" patch set,
> > > but was separated
> > 
> > Sorry for the delay, I've pushed all four patches to mmc-next for
> > 3.14.  Thanks,
> 
> Chris
> Thank you for your hard work about this.
> 
> Simon
> Lager SDHI needs these patches.
> Can you use this branch ?
> If yes, I can re-send patches.

Hi Chris,

is it possible for you to provide a branch with stable git commit ids
that I can use as a base? I'm happy to use mmc-next if you think
it is appropriate.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/4] mmc: tmio/SDHI fixup patches
@ 2013-12-13  0:11       ` Simon Horman
  0 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2013-12-13  0:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Kuninori Morimoto, Magnus, Linux-SH, linux-mmc

On Thu, Dec 12, 2013 at 12:26:42AM -0800, Kuninori Morimoto wrote:
> 
> Hi Chris, Simon
> 
> > > Now, our new board would like to use sh_mobile_sdhi driver,
> > > then, it is expecting sh_mobile_sdhi use regulator.
> > > But, this regulator is based on GPIO driver,
> > > and GPIO driver probe timing is after sh_mobile_sdhi.
> > > So, sh_mobile_sdhi (= tmio_mmc_pio) use default ocr_avail,
> > > and it doesn't work for us.
> > > #1 patch returns -EPROBE_DEFER in such case.
> > > it changes tmio_mmc_host_probe() behavior, but
> > > in my check, tmio_mmc_pio driver user is sh_mobile_sdhi/tmio-mmc only,
> > > and, current user has no conflict by this patch.
> > >
> > > sh_mobile_sdhi/tmio-mmc is very similar, but, have some difference.
> > > #2 - #4 cares such case.
> > >
> > > These were part of "SDHI support for r8a7790" patch set,
> > > but was separated
> > 
> > Sorry for the delay, I've pushed all four patches to mmc-next for
> > 3.14.  Thanks,
> 
> Chris
> Thank you for your hard work about this.
> 
> Simon
> Lager SDHI needs these patches.
> Can you use this branch ?
> If yes, I can re-send patches.

Hi Chris,

is it possible for you to provide a branch with stable git commit ids
that I can use as a base? I'm happy to use mmc-next if you think
it is appropriate.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/4] mmc: tmio: bus_shift become tmio_mmc_data member
  2013-11-20  8:30   ` Kuninori Morimoto
@ 2014-01-07 13:40     ` Arnd Bergmann
  -1 siblings, 0 replies; 27+ messages in thread
From: Arnd Bergmann @ 2014-01-07 13:40 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

On Wednesday 20 November 2013, Kuninori Morimoto wrote:
>         const struct mfd_cell *cell = mfd_get_cell(pdev);
>         struct tmio_mmc_data *pdata;
>         struct tmio_mmc_host *host;
> +       struct resource *res;
>         int ret = -EINVAL, irq;
>  
>         if (pdev->num_resources != 2)
> @@ -84,6 +85,13 @@ static int tmio_mmc_probe(struct platform_device *pdev)
>                         goto out;
>         }
>  
> +       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +       if (!res)
> +               return -EINVAL;
> +
> +       /* SD control register space size is 0x200, 0x400 for bus_shift=1 */
> +       pdata->bus_shift = resource_size(res_ctl) >> 10;
> +
>         ret = tmio_mmc_host_probe(&host, pdev, pdata);
>         if (ret)
>                 goto cell_disable;

Unfortunately, this has introduced a build error, since you use
an incorrect variable name (res_ctl vs. res) in the last line that
was added.

Please add a fix on top.

	Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/4] mmc: tmio: bus_shift become tmio_mmc_data member
@ 2014-01-07 13:40     ` Arnd Bergmann
  0 siblings, 0 replies; 27+ messages in thread
From: Arnd Bergmann @ 2014-01-07 13:40 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Magnus, Linux-SH, Kuninori Morimoto, linux-mmc

On Wednesday 20 November 2013, Kuninori Morimoto wrote:
>         const struct mfd_cell *cell = mfd_get_cell(pdev);
>         struct tmio_mmc_data *pdata;
>         struct tmio_mmc_host *host;
> +       struct resource *res;
>         int ret = -EINVAL, irq;
>  
>         if (pdev->num_resources != 2)
> @@ -84,6 +85,13 @@ static int tmio_mmc_probe(struct platform_device *pdev)
>                         goto out;
>         }
>  
> +       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +       if (!res)
> +               return -EINVAL;
> +
> +       /* SD control register space size is 0x200, 0x400 for bus_shift=1 */
> +       pdata->bus_shift = resource_size(res_ctl) >> 10;
> +
>         ret = tmio_mmc_host_probe(&host, pdev, pdata);
>         if (ret)
>                 goto cell_disable;

Unfortunately, this has introduced a build error, since you use
an incorrect variable name (res_ctl vs. res) in the last line that
was added.

Please add a fix on top.

	Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH] mmc: tmio: fixup compile error
  2014-01-07 13:40     ` Arnd Bergmann
@ 2014-01-08  1:33       ` Kuninori Morimoto
  -1 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2014-01-08  1:33 UTC (permalink / raw)
  To: Arnd Bergmann, Chris Ball
  Cc: Kuninori Morimoto, Simon, Magnus, Linux-SH, linux-mmc

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch fixup below compile error

${LINUX}/drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_probe':
${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
	error: 'res_ctl' undeclared (first use in this function)
${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
	note: each undeclared identifier is reported only \
	once for each function it appears in

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
>> Chris
This is needed on mmc-next branch.

 drivers/mmc/host/tmio_mmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 8a781e2..1900abb 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -90,7 +90,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
-	pdata->bus_shift = resource_size(res_ctl) >> 10;
+	pdata->bus_shift = resource_size(res) >> 10;
 	pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
 
 	ret = tmio_mmc_host_probe(&host, pdev, pdata);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH] mmc: tmio: fixup compile error
@ 2014-01-08  1:33       ` Kuninori Morimoto
  0 siblings, 0 replies; 27+ messages in thread
From: Kuninori Morimoto @ 2014-01-08  1:33 UTC (permalink / raw)
  To: Arnd Bergmann, Chris Ball
  Cc: Kuninori Morimoto, Simon, Magnus, Linux-SH, linux-mmc

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch fixup below compile error

${LINUX}/drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_probe':
${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
	error: 'res_ctl' undeclared (first use in this function)
${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
	note: each undeclared identifier is reported only \
	once for each function it appears in

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
>> Chris
This is needed on mmc-next branch.

 drivers/mmc/host/tmio_mmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 8a781e2..1900abb 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -90,7 +90,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
-	pdata->bus_shift = resource_size(res_ctl) >> 10;
+	pdata->bus_shift = resource_size(res) >> 10;
 	pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
 
 	ret = tmio_mmc_host_probe(&host, pdev, pdata);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH] mmc: tmio: fixup compile error
  2014-01-08  1:33       ` Kuninori Morimoto
@ 2014-01-08  4:47         ` Simon Horman
  -1 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-01-08  4:47 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Arnd Bergmann, Chris Ball, Kuninori Morimoto, Magnus, Linux-SH,
	linux-mmc

On Tue, Jan 07, 2014 at 05:33:51PM -0800, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> This patch fixup below compile error
> 
> ${LINUX}/drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_probe':
> ${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
> 	error: 'res_ctl' undeclared (first use in this function)
> ${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
> 	note: each undeclared identifier is reported only \
> 	once for each function it appears in
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> >> Chris
> This is needed on mmc-next branch.
> 
>  drivers/mmc/host/tmio_mmc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
> index 8a781e2..1900abb 100644
> --- a/drivers/mmc/host/tmio_mmc.c
> +++ b/drivers/mmc/host/tmio_mmc.c
> @@ -90,7 +90,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  
>  	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
> -	pdata->bus_shift = resource_size(res_ctl) >> 10;
> +	pdata->bus_shift = resource_size(res) >> 10;
>  	pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
>  
>  	ret = tmio_mmc_host_probe(&host, pdev, pdata);
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH] mmc: tmio: fixup compile error
@ 2014-01-08  4:47         ` Simon Horman
  0 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-01-08  4:47 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Arnd Bergmann, Chris Ball, Kuninori Morimoto, Magnus, Linux-SH,
	linux-mmc

On Tue, Jan 07, 2014 at 05:33:51PM -0800, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> This patch fixup below compile error
> 
> ${LINUX}/drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_probe':
> ${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
> 	error: 'res_ctl' undeclared (first use in this function)
> ${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
> 	note: each undeclared identifier is reported only \
> 	once for each function it appears in
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> >> Chris
> This is needed on mmc-next branch.
> 
>  drivers/mmc/host/tmio_mmc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
> index 8a781e2..1900abb 100644
> --- a/drivers/mmc/host/tmio_mmc.c
> +++ b/drivers/mmc/host/tmio_mmc.c
> @@ -90,7 +90,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  
>  	/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
> -	pdata->bus_shift = resource_size(res_ctl) >> 10;
> +	pdata->bus_shift = resource_size(res) >> 10;
>  	pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
>  
>  	ret = tmio_mmc_host_probe(&host, pdev, pdata);
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH] mmc: tmio: fixup compile error
  2014-01-08  4:47         ` Simon Horman
  (?)
@ 2014-01-12 16:22         ` Chris Ball
  -1 siblings, 0 replies; 27+ messages in thread
From: Chris Ball @ 2014-01-12 16:22 UTC (permalink / raw)
  To: Simon Horman
  Cc: Kuninori Morimoto, Arnd Bergmann, Kuninori Morimoto, Magnus,
	Linux-SH, linux-mmc

Hi,

On Wed, Jan 08 2014, Simon Horman wrote:
> On Tue, Jan 07, 2014 at 05:33:51PM -0800, Kuninori Morimoto wrote:
>> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> 
>> This patch fixup below compile error
>> 
>> ${LINUX}/drivers/mmc/host/tmio_mmc.c: In function 'tmio_mmc_probe':
>> ${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
>> 	error: 'res_ctl' undeclared (first use in this function)
>> ${LINUX}/drivers/mmc/host/tmio_mmc.c:93:35: \
>> 	note: each undeclared identifier is reported only \
>> 	once for each function it appears in
>> 
>> Reported-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Acked-by: Simon Horman <horms+renesas@verge.net.au>

Thanks, pushed to mmc-next for 3.14.

- Chris.
-- 
Chris Ball   <chris@printf.net>   <http://printf.net/>

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2014-01-12 16:22 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-20  8:30 [PATCH 0/4] mmc: tmio/SDHI fixup patches Kuninori Morimoto
2013-11-20  8:30 ` Kuninori Morimoto
2013-11-20  8:30 ` [PATCH 1/4] mmc: tmio: use -EPROBE_DEFER if driver can't find regulator Kuninori Morimoto
2013-11-20  8:30   ` Kuninori Morimoto
2013-11-20  8:30 ` [PATCH 2/4] mmc: tmio: bus_shift become tmio_mmc_data member Kuninori Morimoto
2013-11-20  8:30   ` Kuninori Morimoto
2014-01-07 13:40   ` Arnd Bergmann
2014-01-07 13:40     ` Arnd Bergmann
2014-01-08  1:33     ` [PATCH] mmc: tmio: fixup compile error Kuninori Morimoto
2014-01-08  1:33       ` Kuninori Morimoto
2014-01-08  4:47       ` Simon Horman
2014-01-08  4:47         ` Simon Horman
2014-01-12 16:22         ` Chris Ball
2013-11-20  8:31 ` [PATCH 3/4] mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags Kuninori Morimoto
2013-11-20  8:31   ` Kuninori Morimoto
2013-11-20  8:31 ` [PATCH 4/4] mmc: SDHI: add SoC specific workaround via HW version Kuninori Morimoto
2013-11-20  8:31   ` Kuninori Morimoto
2013-11-29  2:29 ` [PATCH 0/4] mmc: tmio/SDHI fixup patches Kuninori Morimoto
2013-11-29  2:29   ` Kuninori Morimoto
2013-12-10  2:56 ` Kuninori Morimoto
2013-12-10  2:56   ` Kuninori Morimoto
2013-12-12  1:45 ` Chris Ball
2013-12-12  1:45   ` Chris Ball
2013-12-12  8:26   ` Kuninori Morimoto
2013-12-12  8:26     ` Kuninori Morimoto
2013-12-13  0:11     ` Simon Horman
2013-12-13  0:11       ` Simon Horman

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.