From: Joel A Fernandes <joelagnel@ti.com> To: Tony Lindgren <tony@atomide.com>, Sekhar Nori <nsekhar@ti.com>, Matt Porter <matt@ohporter.com>, Grant Likely <grant.likely@secretlab.ca>, Rob Herring <rob.herring@calxeda.com>, Vinod Koul <vinod.koul@intel.com>, Mark Brown <broonie@opensource.wolfsonmicro.com>, Benoit Cousson <b-cousson@ti.com>, Russell King <linux@arm.linux.org.uk>, Rob Landley <rob@landley.net>, Andrew Morton <akpm@linux-foundation.org>, Jason Kridner <jkridner@beagleboard.org>, Koen Kooi <koen@beagleboard.org> Cc: Devicetree Discuss <devicetree-discuss@lists.ozlabs.org>, Linux OMAP List <linux-omap@vger.kernel.org>, Linux ARM Kernel List <linux-arm-kernel@lists.infradead.org>, Linux DaVinci Kernel List <davinci-linux-open-source@linux.davincidsp.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux Documentation List <linux-doc@vger.kernel.org>, Linux MMC List <linux-mmc@vger.kernel.org>, Linux SPI Devel List <spi-devel-general@lists.sourceforge.net>, Arnd Bergmann <arnd@arndb.de>, Joel A Fernandes <joelagnel@ti.com> Subject: [PATCH v11 8/8] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Date: Tue, 18 Jun 2013 01:38:19 -0500 [thread overview] Message-ID: <1371537499-12970-9-git-send-email-joelagnel@ti.com> (raw) In-Reply-To: <1371537499-12970-1-git-send-email-joelagnel@ti.com> From: Matt Porter <mporter@ti.com> Convert dmaengine channel requests to use dma_request_slave_channel_compat(). This supports the DT case of platforms requiring channel selection from either the OMAP DMA or the EDMA engine. AM33xx only boots from DT and is the only user implementing EDMA so in the !DT case we can default to the OMAP DMA filter. Signed-off-by: Matt Porter <mporter@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Joel A Fernandes <joelagnel@ti.com> --- drivers/spi/spi-omap2-mcspi.c | 64 ++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 86d2158..ca4ab78 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -102,6 +102,9 @@ struct omap2_mcspi_dma { struct completion dma_tx_completion; struct completion dma_rx_completion; + + char dma_rx_ch_name[14]; + char dma_tx_ch_name[14]; }; /* use PIO for small transfers, avoiding DMA setup/teardown overhead and @@ -830,12 +833,20 @@ static int omap2_mcspi_request_dma(struct spi_device *spi) dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); sig = mcspi_dma->dma_rx_sync_dev; - mcspi_dma->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + + mcspi_dma->dma_rx = + dma_request_slave_channel_compat(mask, omap_dma_filter_fn, + &sig, &master->dev, + mcspi_dma->dma_rx_ch_name); if (!mcspi_dma->dma_rx) goto no_dma; sig = mcspi_dma->dma_tx_sync_dev; - mcspi_dma->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + mcspi_dma->dma_tx = + dma_request_slave_channel_compat(mask, omap_dma_filter_fn, + &sig, &master->dev, + mcspi_dma->dma_tx_ch_name); + if (!mcspi_dma->dma_tx) { dma_release_channel(mcspi_dma->dma_rx); mcspi_dma->dma_rx = NULL; @@ -1256,29 +1267,42 @@ static int omap2_mcspi_probe(struct platform_device *pdev) goto free_master; for (i = 0; i < master->num_chipselect; i++) { - char dma_ch_name[14]; + char *dma_rx_ch_name = mcspi->dma_channels[i].dma_rx_ch_name; + char *dma_tx_ch_name = mcspi->dma_channels[i].dma_tx_ch_name; struct resource *dma_res; - sprintf(dma_ch_name, "rx%d", i); - dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA, - dma_ch_name); - if (!dma_res) { - dev_dbg(&pdev->dev, "cannot get DMA RX channel\n"); - status = -ENODEV; - break; - } + sprintf(dma_rx_ch_name, "rx%d", i); + if (!pdev->dev.of_node) { + dma_res = + platform_get_resource_byname(pdev, + IORESOURCE_DMA, + dma_rx_ch_name); + if (!dma_res) { + dev_dbg(&pdev->dev, + "cannot get DMA RX channel\n"); + status = -ENODEV; + break; + } - mcspi->dma_channels[i].dma_rx_sync_dev = dma_res->start; - sprintf(dma_ch_name, "tx%d", i); - dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA, - dma_ch_name); - if (!dma_res) { - dev_dbg(&pdev->dev, "cannot get DMA TX channel\n"); - status = -ENODEV; - break; + mcspi->dma_channels[i].dma_rx_sync_dev = + dma_res->start; } + sprintf(dma_tx_ch_name, "tx%d", i); + if (!pdev->dev.of_node) { + dma_res = + platform_get_resource_byname(pdev, + IORESOURCE_DMA, + dma_tx_ch_name); + if (!dma_res) { + dev_dbg(&pdev->dev, + "cannot get DMA TX channel\n"); + status = -ENODEV; + break; + } - mcspi->dma_channels[i].dma_tx_sync_dev = dma_res->start; + mcspi->dma_channels[i].dma_tx_sync_dev = + dma_res->start; + } } if (status < 0) -- 1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: joelagnel@ti.com (Joel A Fernandes) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v11 8/8] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Date: Tue, 18 Jun 2013 01:38:19 -0500 [thread overview] Message-ID: <1371537499-12970-9-git-send-email-joelagnel@ti.com> (raw) In-Reply-To: <1371537499-12970-1-git-send-email-joelagnel@ti.com> From: Matt Porter <mporter@ti.com> Convert dmaengine channel requests to use dma_request_slave_channel_compat(). This supports the DT case of platforms requiring channel selection from either the OMAP DMA or the EDMA engine. AM33xx only boots from DT and is the only user implementing EDMA so in the !DT case we can default to the OMAP DMA filter. Signed-off-by: Matt Porter <mporter@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Joel A Fernandes <joelagnel@ti.com> --- drivers/spi/spi-omap2-mcspi.c | 64 ++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 86d2158..ca4ab78 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -102,6 +102,9 @@ struct omap2_mcspi_dma { struct completion dma_tx_completion; struct completion dma_rx_completion; + + char dma_rx_ch_name[14]; + char dma_tx_ch_name[14]; }; /* use PIO for small transfers, avoiding DMA setup/teardown overhead and @@ -830,12 +833,20 @@ static int omap2_mcspi_request_dma(struct spi_device *spi) dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); sig = mcspi_dma->dma_rx_sync_dev; - mcspi_dma->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + + mcspi_dma->dma_rx = + dma_request_slave_channel_compat(mask, omap_dma_filter_fn, + &sig, &master->dev, + mcspi_dma->dma_rx_ch_name); if (!mcspi_dma->dma_rx) goto no_dma; sig = mcspi_dma->dma_tx_sync_dev; - mcspi_dma->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig); + mcspi_dma->dma_tx = + dma_request_slave_channel_compat(mask, omap_dma_filter_fn, + &sig, &master->dev, + mcspi_dma->dma_tx_ch_name); + if (!mcspi_dma->dma_tx) { dma_release_channel(mcspi_dma->dma_rx); mcspi_dma->dma_rx = NULL; @@ -1256,29 +1267,42 @@ static int omap2_mcspi_probe(struct platform_device *pdev) goto free_master; for (i = 0; i < master->num_chipselect; i++) { - char dma_ch_name[14]; + char *dma_rx_ch_name = mcspi->dma_channels[i].dma_rx_ch_name; + char *dma_tx_ch_name = mcspi->dma_channels[i].dma_tx_ch_name; struct resource *dma_res; - sprintf(dma_ch_name, "rx%d", i); - dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA, - dma_ch_name); - if (!dma_res) { - dev_dbg(&pdev->dev, "cannot get DMA RX channel\n"); - status = -ENODEV; - break; - } + sprintf(dma_rx_ch_name, "rx%d", i); + if (!pdev->dev.of_node) { + dma_res = + platform_get_resource_byname(pdev, + IORESOURCE_DMA, + dma_rx_ch_name); + if (!dma_res) { + dev_dbg(&pdev->dev, + "cannot get DMA RX channel\n"); + status = -ENODEV; + break; + } - mcspi->dma_channels[i].dma_rx_sync_dev = dma_res->start; - sprintf(dma_ch_name, "tx%d", i); - dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA, - dma_ch_name); - if (!dma_res) { - dev_dbg(&pdev->dev, "cannot get DMA TX channel\n"); - status = -ENODEV; - break; + mcspi->dma_channels[i].dma_rx_sync_dev = + dma_res->start; } + sprintf(dma_tx_ch_name, "tx%d", i); + if (!pdev->dev.of_node) { + dma_res = + platform_get_resource_byname(pdev, + IORESOURCE_DMA, + dma_tx_ch_name); + if (!dma_res) { + dev_dbg(&pdev->dev, + "cannot get DMA TX channel\n"); + status = -ENODEV; + break; + } - mcspi->dma_channels[i].dma_tx_sync_dev = dma_res->start; + mcspi->dma_channels[i].dma_tx_sync_dev = + dma_res->start; + } } if (status < 0) -- 1.7.9.5
next prev parent reply other threads:[~2013-06-18 6:39 UTC|newest] Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-06-18 6:38 [PATCH v11 0/8] ] DMA Engine support for AM33XX Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` [PATCH v11 1/8] dmaengine: edma: Add TI EDMA device tree binding Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` [PATCH v11 2/8] ARM: edma: Add DT and runtime PM support to the private EDMA API Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 9:39 ` Sekhar Nori 2013-06-18 9:39 ` Sekhar Nori 2013-06-18 9:39 ` Sekhar Nori 2013-06-18 9:39 ` Sekhar Nori 2013-06-18 6:38 ` [PATCH v11 3/8] ARM: edma: Add EDMA crossbar event mux support Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 10:19 ` Sekhar Nori 2013-06-18 10:19 ` Sekhar Nori 2013-06-18 10:19 ` Sekhar Nori 2013-06-18 10:19 ` Sekhar Nori 2013-06-20 0:36 ` Joel A Fernandes 2013-06-20 0:36 ` Joel A Fernandes 2013-06-20 0:36 ` Joel A Fernandes 2013-06-20 0:36 ` Joel A Fernandes 2013-06-20 4:49 ` Sekhar Nori 2013-06-20 4:49 ` Sekhar Nori 2013-06-20 4:49 ` Sekhar Nori 2013-06-20 4:49 ` Sekhar Nori 2013-06-18 6:38 ` [PATCH v11 4/8] ARM: dts: add AM33XX EDMA support Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` [PATCH v11 5/8] ARM: dts: add AM33XX SPI DMA support Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` [PATCH v11 6/8] dmaengine: edma: enable build for AM33XX Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` [PATCH v11 7/8] spi: omap2-mcspi: add generic DMA request support to the DT binding Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes [this message] 2013-06-18 6:38 ` [PATCH v11 8/8] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Joel A Fernandes 2013-06-18 6:38 ` Joel A Fernandes 2013-06-18 13:07 ` [PATCH v11 0/8] ] DMA Engine support for AM33XX Arnd Bergmann 2013-06-18 13:07 ` Arnd Bergmann 2013-06-18 13:07 ` Arnd Bergmann 2013-06-18 13:07 ` Arnd Bergmann
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1371537499-12970-9-git-send-email-joelagnel@ti.com \ --to=joelagnel@ti.com \ --cc=akpm@linux-foundation.org \ --cc=arnd@arndb.de \ --cc=b-cousson@ti.com \ --cc=broonie@opensource.wolfsonmicro.com \ --cc=davinci-linux-open-source@linux.davincidsp.com \ --cc=devicetree-discuss@lists.ozlabs.org \ --cc=grant.likely@secretlab.ca \ --cc=jkridner@beagleboard.org \ --cc=koen@beagleboard.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-doc@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mmc@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=matt@ohporter.com \ --cc=nsekhar@ti.com \ --cc=rob.herring@calxeda.com \ --cc=rob@landley.net \ --cc=spi-devel-general@lists.sourceforge.net \ --cc=tony@atomide.com \ --cc=vinod.koul@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.