linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration
@ 2011-08-30 16:26 Guennadi Liakhovetski
  2011-08-30 16:26 ` [PATCH 1/2] mmc: sh_mmcif: simplify platform data Guennadi Liakhovetski
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Guennadi Liakhovetski @ 2011-08-30 16:26 UTC (permalink / raw)
  To: linux-sh

A simple cosmetic clean-up, no functional changes. Patch 2/2 depends on 
patch 1/2 and can wait until 3.3. Paul, would you be able to put it under 
the carpet somewhere until then or shall I resend it after 3.2-rc1 is out? 
After both these patches have been applied, we can remove struct 
sh_mmcif_plat_data::dma around 3.4 or 4.0 or whatever;-)

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

* [PATCH 1/2] mmc: sh_mmcif: simplify platform data
  2011-08-30 16:26 [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration Guennadi Liakhovetski
@ 2011-08-30 16:26 ` Guennadi Liakhovetski
  2011-09-21 18:43   ` Chris Ball
  2011-08-30 16:26 ` [PATCH 2/2] ARM: mach-shmobile: simplify MMCIF DMA configuration Guennadi Liakhovetski
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Guennadi Liakhovetski @ 2011-08-30 16:26 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, Paul Mundt, Chris Ball

Provide platforms with a simplified way to specify MMCIF DMA slave IDs in
a way, similar to SDHI and other sh_dma clients.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mmc/host/sh_mmcif.c  |   20 ++++++++++++++++----
 include/linux/mmc/sh_mmcif.h |    4 +++-
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 557886b..bd91c94 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -165,6 +165,8 @@ struct sh_mmcif_host {
 	struct mmc_host *mmc;
 	struct mmc_data *data;
 	struct platform_device *pd;
+	struct sh_dmae_slave dma_slave_tx;
+	struct sh_dmae_slave dma_slave_rx;
 	struct clk *hclk;
 	unsigned int clk;
 	int bus_width;
@@ -323,25 +325,35 @@ static bool sh_mmcif_filter(struct dma_chan *chan, void *arg)
 static void sh_mmcif_request_dma(struct sh_mmcif_host *host,
 				 struct sh_mmcif_plat_data *pdata)
 {
+	struct sh_dmae_slave *tx, *rx;
 	host->dma_active = false;
 
 	/* We can only either use DMA for both Tx and Rx or not use it at all */
 	if (pdata->dma) {
+		dev_warn(&host->pd->dev,
+			 "Update your platform to use embedded DMA slave IDs\n");
+		tx = &pdata->dma->chan_priv_tx;
+		rx = &pdata->dma->chan_priv_rx;
+	} else {
+		tx = &host->dma_slave_tx;
+		tx->slave_id = pdata->slave_id_tx;
+		rx = &host->dma_slave_rx;
+		rx->slave_id = pdata->slave_id_rx;
+	}
+	if (tx->slave_id > 0 && rx->slave_id > 0) {
 		dma_cap_mask_t mask;
 
 		dma_cap_zero(mask);
 		dma_cap_set(DMA_SLAVE, mask);
 
-		host->chan_tx = dma_request_channel(mask, sh_mmcif_filter,
-						    &pdata->dma->chan_priv_tx);
+		host->chan_tx = dma_request_channel(mask, sh_mmcif_filter, tx);
 		dev_dbg(&host->pd->dev, "%s: TX: got channel %p\n", __func__,
 			host->chan_tx);
 
 		if (!host->chan_tx)
 			return;
 
-		host->chan_rx = dma_request_channel(mask, sh_mmcif_filter,
-						    &pdata->dma->chan_priv_rx);
+		host->chan_rx = dma_request_channel(mask, sh_mmcif_filter, rx);
 		dev_dbg(&host->pd->dev, "%s: RX: got channel %p\n", __func__,
 			host->chan_rx);
 
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 0222cd8..04ff452 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -41,7 +41,9 @@ 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);
-	struct sh_mmcif_dma	*dma;
+	struct sh_mmcif_dma	*dma;		/* Deprecated. Instead */
+	unsigned int		slave_id_tx;	/* use embedded slave_id_[tr]x */
+	unsigned int		slave_id_rx;
 	u8			sup_pclk;	/* 1 :SH7757, 0: SH7724/SH7372 */
 	unsigned long		caps;
 	u32			ocr;
-- 
1.7.2.5


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

* [PATCH 2/2] ARM: mach-shmobile: simplify MMCIF DMA configuration
  2011-08-30 16:26 [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration Guennadi Liakhovetski
  2011-08-30 16:26 ` [PATCH 1/2] mmc: sh_mmcif: simplify platform data Guennadi Liakhovetski
@ 2011-08-30 16:26 ` Guennadi Liakhovetski
  2011-09-05  4:15 ` [PATCH 0/2] mmc: sh_mmcif: simplify platform " Paul Mundt
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Guennadi Liakhovetski @ 2011-08-30 16:26 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, Paul Mundt, Chris Ball

Use the simplified method to specify MMCIF DMA slave configuration.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/mach-shmobile/board-ag5evm.c   |   11 ++---------
 arch/arm/mach-shmobile/board-ap4evb.c   |   12 ++----------
 arch/arm/mach-shmobile/board-mackerel.c |   12 ++----------
 3 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index ce5c251..7f26ecc 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -158,19 +158,12 @@ static struct resource sh_mmcif_resources[] = {
 	},
 };
 
-static struct sh_mmcif_dma sh_mmcif_dma = {
-	.chan_priv_rx	= {
-		.slave_id	= SHDMA_SLAVE_MMCIF_RX,
-	},
-	.chan_priv_tx	= {
-		.slave_id	= SHDMA_SLAVE_MMCIF_TX,
-	},
-};
 static struct sh_mmcif_plat_data sh_mmcif_platdata = {
 	.sup_pclk	= 0,
 	.ocr		= MMC_VDD_165_195,
 	.caps		= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
-	.dma		= &sh_mmcif_dma,
+	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
+	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device mmc_device = {
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index f530bf2..b8ed7a7 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -293,15 +293,6 @@ static struct resource sh_mmcif_resources[] = {
 	},
 };
 
-static struct sh_mmcif_dma sh_mmcif_dma = {
-	.chan_priv_rx	= {
-		.slave_id	= SHDMA_SLAVE_MMCIF_RX,
-	},
-	.chan_priv_tx	= {
-		.slave_id	= SHDMA_SLAVE_MMCIF_TX,
-	},
-};
-
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.sup_pclk	= 0,
 	.ocr		= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -309,7 +300,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
 			  MMC_CAP_8_BIT_DATA |
 			  MMC_CAP_NEEDS_POLL,
 	.get_cd		= slot_cn7_get_cd,
-	.dma		= &sh_mmcif_dma,
+	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
+	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device sh_mmcif_device = {
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 7e7da60..dfae824 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1164,15 +1164,6 @@ static struct resource sh_mmcif_resources[] = {
 	},
 };
 
-static struct sh_mmcif_dma sh_mmcif_dma = {
-	.chan_priv_rx	= {
-		.slave_id	= SHDMA_SLAVE_MMCIF_RX,
-	},
-	.chan_priv_tx	= {
-		.slave_id	= SHDMA_SLAVE_MMCIF_TX,
-	},
-};
-
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
 	.sup_pclk	= 0,
 	.ocr		= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -1180,7 +1171,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
 			  MMC_CAP_8_BIT_DATA |
 			  MMC_CAP_NEEDS_POLL,
 	.get_cd		= slot_cn7_get_cd,
-	.dma		= &sh_mmcif_dma,
+	.slave_id_tx	= SHDMA_SLAVE_MMCIF_TX,
+	.slave_id_rx	= SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device sh_mmcif_device = {
-- 
1.7.2.5


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

* Re: [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration
  2011-08-30 16:26 [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration Guennadi Liakhovetski
  2011-08-30 16:26 ` [PATCH 1/2] mmc: sh_mmcif: simplify platform data Guennadi Liakhovetski
  2011-08-30 16:26 ` [PATCH 2/2] ARM: mach-shmobile: simplify MMCIF DMA configuration Guennadi Liakhovetski
@ 2011-09-05  4:15 ` Paul Mundt
  2011-09-05  7:15 ` Guennadi Liakhovetski
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Paul Mundt @ 2011-09-05  4:15 UTC (permalink / raw)
  To: linux-sh

On Tue, Aug 30, 2011 at 06:26:34PM +0200, Guennadi Liakhovetski wrote:
> A simple cosmetic clean-up, no functional changes. Patch 2/2 depends on 
> patch 1/2 and can wait until 3.3. Paul, would you be able to put it under 
> the carpet somewhere until then or shall I resend it after 3.2-rc1 is out? 
> After both these patches have been applied, we can remove struct 
> sh_mmcif_plat_data::dma around 3.4 or 4.0 or whatever;-)
> 
It's not a problem, I'll just flag it as awaiting upstream in the
tracker. Anything flagged as such I generally give a once over after each
merge window to see if their dependencies have been worked out.

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

* Re: [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration
  2011-08-30 16:26 [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration Guennadi Liakhovetski
                   ` (2 preceding siblings ...)
  2011-09-05  4:15 ` [PATCH 0/2] mmc: sh_mmcif: simplify platform " Paul Mundt
@ 2011-09-05  7:15 ` Guennadi Liakhovetski
  2012-01-17 16:39 ` Guennadi Liakhovetski
  2012-01-18  0:21 ` Paul Mundt
  5 siblings, 0 replies; 8+ messages in thread
From: Guennadi Liakhovetski @ 2011-09-05  7:15 UTC (permalink / raw)
  To: linux-sh

On Mon, 5 Sep 2011, Paul Mundt wrote:

> On Tue, Aug 30, 2011 at 06:26:34PM +0200, Guennadi Liakhovetski wrote:
> > A simple cosmetic clean-up, no functional changes. Patch 2/2 depends on 
> > patch 1/2 and can wait until 3.3. Paul, would you be able to put it under 
> > the carpet somewhere until then or shall I resend it after 3.2-rc1 is out? 
> > After both these patches have been applied, we can remove struct 
> > sh_mmcif_plat_data::dma around 3.4 or 4.0 or whatever;-)
> > 
> It's not a problem, I'll just flag it as awaiting upstream in the
> tracker. Anything flagged as such I generally give a once over after each
> merge window to see if their dependencies have been worked out.

Good, thanks!

Regards
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

* Re: [PATCH 1/2] mmc: sh_mmcif: simplify platform data
  2011-08-30 16:26 ` [PATCH 1/2] mmc: sh_mmcif: simplify platform data Guennadi Liakhovetski
@ 2011-09-21 18:43   ` Chris Ball
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Ball @ 2011-09-21 18:43 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-mmc, linux-sh, Paul Mundt

Hi Guennadi,

On Tue, Aug 30 2011, Guennadi Liakhovetski wrote:
> Provide platforms with a simplified way to specify MMCIF DMA slave IDs in
> a way, similar to SDHI and other sh_dma clients.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks, [1/2] is queued for 3.2 in mmc-next.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration
  2011-08-30 16:26 [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration Guennadi Liakhovetski
                   ` (3 preceding siblings ...)
  2011-09-05  7:15 ` Guennadi Liakhovetski
@ 2012-01-17 16:39 ` Guennadi Liakhovetski
  2012-01-18  0:21 ` Paul Mundt
  5 siblings, 0 replies; 8+ messages in thread
From: Guennadi Liakhovetski @ 2012-01-17 16:39 UTC (permalink / raw)
  To: linux-sh

Hi Paul

On Mon, 5 Sep 2011, Paul Mundt wrote:

> On Tue, Aug 30, 2011 at 06:26:34PM +0200, Guennadi Liakhovetski wrote:
> > A simple cosmetic clean-up, no functional changes. Patch 2/2 depends on 
> > patch 1/2 and can wait until 3.3. Paul, would you be able to put it under 
> > the carpet somewhere until then or shall I resend it after 3.2-rc1 is out? 
> > After both these patches have been applied, we can remove struct 
> > sh_mmcif_plat_data::dma around 3.4 or 4.0 or whatever;-)
> > 
> It's not a problem, I'll just flag it as awaiting upstream in the
> tracker. Anything flagged as such I generally give a once over after each
> merge window to see if their dependencies have been worked out.

You certainly haven't forgotten about this patch;-), in which case it's 
just me, unable to find it in your git branches. Could you give me a hint 
where it can be?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

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

* Re: [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration
  2011-08-30 16:26 [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration Guennadi Liakhovetski
                   ` (4 preceding siblings ...)
  2012-01-17 16:39 ` Guennadi Liakhovetski
@ 2012-01-18  0:21 ` Paul Mundt
  5 siblings, 0 replies; 8+ messages in thread
From: Paul Mundt @ 2012-01-18  0:21 UTC (permalink / raw)
  To: linux-sh

On Tue, Jan 17, 2012 at 05:39:55PM +0100, Guennadi Liakhovetski wrote:
> Hi Paul
> 
> On Mon, 5 Sep 2011, Paul Mundt wrote:
> 
> > On Tue, Aug 30, 2011 at 06:26:34PM +0200, Guennadi Liakhovetski wrote:
> > > A simple cosmetic clean-up, no functional changes. Patch 2/2 depends on 
> > > patch 1/2 and can wait until 3.3. Paul, would you be able to put it under 
> > > the carpet somewhere until then or shall I resend it after 3.2-rc1 is out? 
> > > After both these patches have been applied, we can remove struct 
> > > sh_mmcif_plat_data::dma around 3.4 or 4.0 or whatever;-)
> > > 
> > It's not a problem, I'll just flag it as awaiting upstream in the
> > tracker. Anything flagged as such I generally give a once over after each
> > merge window to see if their dependencies have been worked out.
> 
> You certainly haven't forgotten about this patch;-), in which case it's 
> just me, unable to find it in your git branches. Could you give me a hint 
> where it can be?
> 
Er, no, of course not ;-)

It's out there now..

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

end of thread, other threads:[~2012-01-18  0:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-30 16:26 [PATCH 0/2] mmc: sh_mmcif: simplify platform DMA configuration Guennadi Liakhovetski
2011-08-30 16:26 ` [PATCH 1/2] mmc: sh_mmcif: simplify platform data Guennadi Liakhovetski
2011-09-21 18:43   ` Chris Ball
2011-08-30 16:26 ` [PATCH 2/2] ARM: mach-shmobile: simplify MMCIF DMA configuration Guennadi Liakhovetski
2011-09-05  4:15 ` [PATCH 0/2] mmc: sh_mmcif: simplify platform " Paul Mundt
2011-09-05  7:15 ` Guennadi Liakhovetski
2012-01-17 16:39 ` Guennadi Liakhovetski
2012-01-18  0:21 ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).