public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding
@ 2013-03-05 12:23 Shawn Guo
  2013-03-05 12:23 ` [PATCH v2 04/12] mmc: mxs-mmc: move to use generic DMA helper Shawn Guo
  2013-03-05 19:39 ` [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Shawn Guo @ 2013-03-05 12:23 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Fabio Estevam, alsa-devel, Chris Ball, linux-serial,
	Arnd Bergmann, Huang Shijie, Vinod Koul, Greg Kroah-Hartman,
	Mark Brown, linux-mmc, Artem Bityutskiy, Marek Vasut, linux-mtd,
	linux-i2c, Wolfram Sang, Shawn Guo

The series converts mxs-dma and its clients to generic DMA device tree
binding/helper.

I published a branch below to ease people who is willing to help
testing the series.

 git://git.linaro.org/people/shawnguo/linux-2.6.git devel/mxs-dma-dt

Changes since v1:
 - Remove the use of of_dma_filter_info which should not be needed by
   a customized xlate function
 - Correct dma-names to have it mean the channel function in client
   devices
 - Add a new dmaengine_pcm API snd_dmaengine_generic_pcm_open() for
   users that support generic DMA device tree binding
 - Remove the old fsl,<module>-dma-channel properties from device tree

Subsystem maintainers,

I need your ACKs to have the series go via arm-soc as a whole if the
patches look good to you.

Thanks,
Shawn

Shawn Guo (12):
  ARM: dts: add generic DMA device tree binding for mxs-dma
  dma: mxs-dma: use devm_* managed functions
  dma: mxs-dma: move to generic device tree binding
  mmc: mxs-mmc: move to use generic DMA helper
  spi: mxs-spi: move to use generic DMA helper
  i2c: i2c-mxs: move to use generic DMA helper
  mtd: gpmi: move to use generic DMA helper
  serial: mxs-auart: move to use generic DMA helper
  ASoC: dmaengine_pcm: add snd_dmaengine_generic_pcm_open()
  ASoC: mxs: move to use generic DMA helper
  dma: mxs-dma: remove code left from generic DMA binding conversion
  ARM: dts: remove old DMA binding data from client nodes

 .../devicetree/bindings/dma/fsl-mxs-dma.txt        |   49 +++++++-
 Documentation/devicetree/bindings/i2c/i2c-mxs.txt  |   12 +-
 Documentation/devicetree/bindings/mmc/mxs-mmc.txt  |   12 +-
 .../devicetree/bindings/mtd/gpmi-nand.txt          |   17 +--
 .../devicetree/bindings/sound/mxs-saif.txt         |   18 +--
 Documentation/devicetree/bindings/spi/mxs-spi.txt  |   12 +-
 .../bindings/tty/serial/fsl-mxs-auart.txt          |   16 ++-
 arch/arm/boot/dts/imx23.dtsi                       |   57 +++++++--
 arch/arm/boot/dts/imx28.dtsi                       |  104 +++++++++++-----
 arch/arm/boot/dts/imx6qdl.dtsi                     |   12 +-
 drivers/dma/mxs-dma.c                              |  128 +++++++++++---------
 drivers/i2c/busses/i2c-mxs.c                       |   40 +-----
 drivers/mmc/host/mxs-mmc.c                         |   48 +-------
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c             |   51 +-------
 drivers/mtd/nand/gpmi-nand/gpmi-nand.h             |    3 +-
 drivers/spi/spi-mxs.c                              |   60 ++-------
 drivers/tty/serial/mxs-auart.c                     |   52 +-------
 include/linux/fsl/mxs-dma.h                        |   20 ---
 include/linux/spi/mxs-spi.h                        |    4 +-
 include/sound/dmaengine_pcm.h                      |    2 +
 sound/soc/mxs/mxs-pcm.c                            |   42 +------
 sound/soc/mxs/mxs-pcm.h                            |    5 -
 sound/soc/mxs/mxs-saif.c                           |   28 +----
 sound/soc/mxs/mxs-saif.h                           |    1 -
 sound/soc/soc-dmaengine-pcm.c                      |   39 ++++++
 25 files changed, 368 insertions(+), 464 deletions(-)
 delete mode 100644 include/linux/fsl/mxs-dma.h

-- 
1.7.9.5

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

* [PATCH v2 04/12] mmc: mxs-mmc: move to use generic DMA helper
  2013-03-05 12:23 [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Shawn Guo
@ 2013-03-05 12:23 ` Shawn Guo
  2013-03-05 19:39 ` [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2013-03-05 12:23 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Fabio Estevam, Chris Ball, Arnd Bergmann, Huang Shijie,
	Vinod Koul, linux-mmc, Marek Vasut, Shawn Guo

With the generic DMA device tree helper supported by mxs-dma driver,
client devices only need to call dma_request_slave_channel() for
requesting a DMA channel from dmaengine.

Since mxs is a DT only platform now, along with the changes, the non-DT
case checking in probe function also gets cleaned up.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org
---
 Documentation/devicetree/bindings/mmc/mxs-mmc.txt |   12 ++++--
 drivers/mmc/host/mxs-mmc.c                        |   48 +++------------------
 2 files changed, 13 insertions(+), 47 deletions(-)

diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
index 54949f6..515addc 100644
--- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
@@ -9,15 +9,19 @@ and the properties used by the mxsmmc driver.
 Required properties:
 - compatible: Should be "fsl,<chip>-mmc".  The supported chips include
   imx23 and imx28.
-- interrupts: Should contain ERROR and DMA interrupts
-- fsl,ssp-dma-channel: APBH DMA channel for the SSP
+- interrupts: Should contain ERROR interrupt number
+- dmas: DMA specifier, consisting of a phandle to DMA controller node
+  and SSP DMA channel ID.
+  Refer to dma.txt and fsl-mxs-dma.txt for details.
+- dma-names: Must be "rx-tx".
 
 Examples:
 
 ssp0: ssp@80010000 {
 	compatible = "fsl,imx28-mmc";
 	reg = <0x80010000 2000>;
-	interrupts = <96 82>;
-	fsl,ssp-dma-channel = <0>;
+	interrupts = <96>;
+	dmas = <&dma_apbh 0>;
+	dma-names = "rx-tx";
 	bus-width = <8>;
 };
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4efe302..4fdc711 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -548,22 +548,6 @@ static const struct mmc_host_ops mxs_mmc_ops = {
 	.enable_sdio_irq = mxs_mmc_enable_sdio_irq,
 };
 
-static bool mxs_mmc_dma_filter(struct dma_chan *chan, void *param)
-{
-	struct mxs_mmc_host *host = param;
-	struct mxs_ssp *ssp = &host->ssp;
-
-	if (!mxs_dma_is_apbh(chan))
-		return false;
-
-	if (chan->chan_id != ssp->dma_channel)
-		return false;
-
-	chan->private = &ssp->dma_data;
-
-	return true;
-}
-
 static struct platform_device_id mxs_ssp_ids[] = {
 	{
 		.name = "imx23-mmc",
@@ -591,20 +575,17 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct mxs_mmc_host *host;
 	struct mmc_host *mmc;
-	struct resource *iores, *dmares;
+	struct resource *iores;
 	struct pinctrl *pinctrl;
-	int ret = 0, irq_err, irq_dma;
-	dma_cap_mask_t mask;
+	int ret = 0, irq_err;
 	struct regulator *reg_vmmc;
 	enum of_gpio_flags flags;
 	struct mxs_ssp *ssp;
 	u32 bus_width = 0;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
 	irq_err = platform_get_irq(pdev, 0);
-	irq_dma = platform_get_irq(pdev, 1);
-	if (!iores || irq_err < 0 || irq_dma < 0)
+	if (!iores || irq_err < 0)
 		return -EINVAL;
 
 	mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev);
@@ -620,23 +601,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 		goto out_mmc_free;
 	}
 
-	if (np) {
-		ssp->devid = (enum mxs_ssp_id) of_id->data;
-		/*
-		 * TODO: This is a temporary solution and should be changed
-		 * to use generic DMA binding later when the helpers get in.
-		 */
-		ret = of_property_read_u32(np, "fsl,ssp-dma-channel",
-					   &ssp->dma_channel);
-		if (ret) {
-			dev_err(mmc_dev(host->mmc),
-				"failed to get dma channel\n");
-			goto out_mmc_free;
-		}
-	} else {
-		ssp->devid = pdev->id_entry->driver_data;
-		ssp->dma_channel = dmares->start;
-	}
+	ssp->devid = (enum mxs_ssp_id) of_id->data;
 
 	host->mmc = mmc;
 	host->sdio_irq_en = 0;
@@ -666,10 +631,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 
 	mxs_mmc_reset(host);
 
-	dma_cap_zero(mask);
-	dma_cap_set(DMA_SLAVE, mask);
-	ssp->dma_data.chan_irq = irq_dma;
-	ssp->dmach = dma_request_channel(mask, mxs_mmc_dma_filter, host);
+	ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
 	if (!ssp->dmach) {
 		dev_err(mmc_dev(host->mmc),
 			"%s: failed to request dma\n", __func__);
-- 
1.7.9.5

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

* Re: [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding
  2013-03-05 12:23 [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Shawn Guo
  2013-03-05 12:23 ` [PATCH v2 04/12] mmc: mxs-mmc: move to use generic DMA helper Shawn Guo
@ 2013-03-05 19:39 ` Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2013-03-05 19:39 UTC (permalink / raw)
  To: Shawn Guo
  Cc: linux-arm-kernel, Vinod Koul, Marek Vasut, Fabio Estevam,
	Huang Shijie, Mark Brown, Greg Kroah-Hartman, Artem Bityutskiy,
	Wolfram Sang, Chris Ball, alsa-devel, linux-serial, linux-mtd,
	linux-i2c, linux-mmc

On Tuesday 05 March 2013, Shawn Guo wrote:
> The series converts mxs-dma and its clients to generic DMA device tree
> binding/helper.
> 
> I published a branch below to ease people who is willing to help
> testing the series.

Looks all good, aside from the bug I found in the first patch.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

end of thread, other threads:[~2013-03-05 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 12:23 [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Shawn Guo
2013-03-05 12:23 ` [PATCH v2 04/12] mmc: mxs-mmc: move to use generic DMA helper Shawn Guo
2013-03-05 19:39 ` [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox