All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sourav Poddar <sourav.poddar@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Joel A Fernandes <joelagnel@ti.com>,
	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>,
	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>,
	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>
Subject: Re: [PATCH v12 09/11] spi: omap2-mcspi: convert to dma_request_slave_channel_compat()
Date: Fri, 21 Jun 2013 15:56:57 +0530	[thread overview]
Message-ID: <51C42A71.1090403@ti.com> (raw)
In-Reply-To: <1371762407-24544-10-git-send-email-joelagnel@ti.com>

Hi Mark,
On Friday 21 June 2013 02:36 AM, Joel A Fernandes wrote:
> 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)
Acked-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>

This patch can go independently and does not depend on the rest of the
series.
Can these patch be pulled?




WARNING: multiple messages have this Message-ID (diff)
From: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
To: Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Koen,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>,
	Kooi <koen-hcmAuCOw+vXj4SYmN/TMmA@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Linux Documentation List
	<linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Vinod,
	Devicetree Discuss
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Jason Kridner <jkridner-hcmAuCOw+vXj4SYmN/TMmA@public.gmane.org>,
	Linux OMAP List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux ARM Kernel List
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>,
	Linux DaVinci Kernel List
	<davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org>,
	Benoit Cousson <b-cousson-l0cyMroinI0@public.gmane.org>,
	Linux MMC List
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Landley <rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org>,
	Linux SPI Devel List
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Andrew Morton <akpm@linux-fo>
Subject: Re: [PATCH v12 09/11] spi: omap2-mcspi: convert to dma_request_slave_channel_compat()
Date: Fri, 21 Jun 2013 15:56:57 +0530	[thread overview]
Message-ID: <51C42A71.1090403@ti.com> (raw)
In-Reply-To: <1371762407-24544-10-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>

Hi Mark,
On Friday 21 June 2013 02:36 AM, Joel A Fernandes wrote:
> From: Matt Porter<mporter-l0cyMroinI0@public.gmane.org>
>
> 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-l0cyMroinI0@public.gmane.org>
> Acked-by: Mark Brown<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
> Signed-off-by: Joel A Fernandes<joelagnel-l0cyMroinI0@public.gmane.org>
> ---
>   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)
Acked-by: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
Tested-by: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>

This patch can go independently and does not depend on the rest of the
series.
Can these patch be pulled?




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

WARNING: multiple messages have this Message-ID (diff)
From: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
To: Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Koen,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>,
	Kooi <koen-hcmAuCOw+vXj4SYmN/TMmA@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Linux Documentation List
	<linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Vinod,
	Devicetree Discuss
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Jason Kridner <jkridner-hcmAuCOw+vXj4SYmN/TMmA@public.gmane.org>,
	Linux OMAP List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux ARM Kernel List
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>,
	Linux DaVinci Kernel List
	<davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org>,
	Benoit Cousson <b-cousson-l0cyMroinI0@public.gmane.org>,
	Linux MMC List
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Landley <rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org>,
	Linux SPI Devel List
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Andrew Morton <akpm@linux-fo
Subject: Re: [PATCH v12 09/11] spi: omap2-mcspi: convert to dma_request_slave_channel_compat()
Date: Fri, 21 Jun 2013 15:56:57 +0530	[thread overview]
Message-ID: <51C42A71.1090403@ti.com> (raw)
In-Reply-To: <1371762407-24544-10-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>

Hi Mark,
On Friday 21 June 2013 02:36 AM, Joel A Fernandes wrote:
> From: Matt Porter<mporter-l0cyMroinI0@public.gmane.org>
>
> 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-l0cyMroinI0@public.gmane.org>
> Acked-by: Mark Brown<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
> Signed-off-by: Joel A Fernandes<joelagnel-l0cyMroinI0@public.gmane.org>
> ---
>   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)
Acked-by: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
Tested-by: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>

This patch can go independently and does not depend on the rest of the
series.
Can these patch be pulled?




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

WARNING: multiple messages have this Message-ID (diff)
From: sourav.poddar@ti.com (Sourav Poddar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v12 09/11] spi: omap2-mcspi: convert to dma_request_slave_channel_compat()
Date: Fri, 21 Jun 2013 15:56:57 +0530	[thread overview]
Message-ID: <51C42A71.1090403@ti.com> (raw)
In-Reply-To: <1371762407-24544-10-git-send-email-joelagnel@ti.com>

Hi Mark,
On Friday 21 June 2013 02:36 AM, Joel A Fernandes wrote:
> 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)
Acked-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>

This patch can go independently and does not depend on the rest of the
series.
Can these patch be pulled?

  reply	other threads:[~2013-06-21 10:27 UTC|newest]

Thread overview: 203+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 21:06 [PATCH v12 00/11] DMA Engine support for AM33XX Joel A Fernandes
2013-06-20 21:06 ` Joel A Fernandes
2013-06-20 21:06 ` Joel A Fernandes
2013-06-20 21:06 ` [PATCH v12 01/11] dmaengine: edma: Add TI EDMA device tree binding Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06 ` [PATCH v12 02/11] ARM: edma: Add DT and runtime PM support to the private EDMA API Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-21  9:37   ` Sekhar Nori
2013-06-21  9:37     ` Sekhar Nori
2013-06-21  9:37     ` Sekhar Nori
2013-06-21  9:37     ` Sekhar Nori
2013-06-21  9:53     ` [PATCH v13] " Sekhar Nori
2013-06-21  9:53       ` Sekhar Nori
2013-06-21  9:53       ` Sekhar Nori
2013-06-21  9:53       ` Sekhar Nori
2013-06-24 10:06       ` Sekhar Nori
2013-06-24 10:06         ` Sekhar Nori
2013-06-24 10:06         ` Sekhar Nori
2013-06-24 10:06         ` Sekhar Nori
2013-06-21 13:37     ` [PATCH v12 02/11] " Joel A Fernandes
2013-06-21 13:37       ` Joel A Fernandes
2013-06-21 13:37       ` Joel A Fernandes
2013-06-21 13:37       ` Joel A Fernandes
2013-06-20 21:06 ` [PATCH v12 03/11] ARM: edma: Add EDMA crossbar event mux support Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-21 10:12   ` Sekhar Nori
2013-06-21 10:12     ` Sekhar Nori
2013-06-21 10:12     ` Sekhar Nori
2013-06-21 10:12     ` Sekhar Nori
2013-06-21 10:14     ` [PATCH] " Sekhar Nori
2013-06-21 10:14       ` Sekhar Nori
2013-06-21 10:14       ` Sekhar Nori
2013-06-21 10:14       ` Sekhar Nori
2013-06-20 21:06 ` [PATCH v12 04/11] dmaengine: edma: enable build for AM33XX Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-21 10:15   ` Sekhar Nori
2013-06-21 10:15     ` Sekhar Nori
2013-06-21 10:15     ` Sekhar Nori
2013-06-21 10:15     ` Sekhar Nori
2013-06-24 10:17     ` Tony Lindgren
2013-06-24 10:17       ` Tony Lindgren
2013-06-24 10:17       ` Tony Lindgren
2013-06-24 10:17       ` Tony Lindgren
2013-06-24 10:31       ` Sekhar Nori
2013-06-24 10:31         ` Sekhar Nori
2013-06-24 10:31         ` Sekhar Nori
2013-06-24 10:31         ` Sekhar Nori
2013-06-20 21:06 ` [PATCH v12 05/11] edma: config: Enable config options for EDMA Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-21 10:16   ` Sekhar Nori
2013-06-21 10:16     ` Sekhar Nori
2013-06-21 10:16     ` Sekhar Nori
2013-06-21 10:16     ` Sekhar Nori
2013-06-21 13:52     ` Joel A Fernandes
2013-06-21 13:52       ` Joel A Fernandes
2013-06-21 13:52       ` Joel A Fernandes
2013-06-21 13:52       ` Joel A Fernandes
2013-06-21 14:00       ` Arnd Bergmann
2013-06-21 14:00         ` Arnd Bergmann
2013-06-21 14:00         ` Arnd Bergmann
2013-06-21 14:00         ` Arnd Bergmann
2013-06-21 14:20         ` Joel A Fernandes
2013-06-21 14:20           ` Joel A Fernandes
2013-06-21 14:20           ` Joel A Fernandes
2013-06-21 14:32           ` Arnd Bergmann
2013-06-21 14:32             ` Arnd Bergmann
2013-06-21 14:32             ` Arnd Bergmann
2013-06-21 18:40             ` Joel A Fernandes
2013-06-21 18:40               ` Joel A Fernandes
2013-06-21 18:40               ` Joel A Fernandes
2013-06-21 18:44               ` Arnd Bergmann
2013-06-21 18:44                 ` Arnd Bergmann
2013-06-21 18:44                 ` Arnd Bergmann
2013-06-21 21:53                 ` Joel A Fernandes
2013-06-21 21:53                   ` Joel A Fernandes
2013-06-21 21:53                   ` Joel A Fernandes
2013-06-21 22:14                   ` Arnd Bergmann
2013-06-21 22:14                     ` Arnd Bergmann
2013-06-21 22:14                     ` Arnd Bergmann
2013-06-22  2:53                     ` Joel A Fernandes
2013-06-22  2:53                       ` Joel A Fernandes
2013-06-22  2:53                       ` Joel A Fernandes
2013-06-22  2:53                       ` Joel A Fernandes
2013-06-24 11:53                       ` Sekhar Nori
2013-06-24 11:53                         ` Sekhar Nori
2013-06-24 11:53                         ` Sekhar Nori
2013-06-24 11:53                         ` Sekhar Nori
2013-06-24 14:48                         ` Joel A Fernandes
2013-06-24 14:48                           ` Joel A Fernandes
2013-06-24 14:48                           ` Joel A Fernandes
2013-06-24 14:48                           ` Joel A Fernandes
2013-06-24 20:28                       ` Arnd Bergmann
2013-06-24 20:28                         ` Arnd Bergmann
2013-06-24 20:28                         ` Arnd Bergmann
2013-06-24 20:28                         ` Arnd Bergmann
2013-06-24 20:32                         ` Joel A Fernandes
2013-06-24 20:32                           ` Joel A Fernandes
2013-06-24 20:32                           ` Joel A Fernandes
2013-06-24 21:07                           ` Arnd Bergmann
2013-06-24 21:07                             ` Arnd Bergmann
2013-06-24 21:07                             ` Arnd Bergmann
2013-06-24 21:09                             ` Fernandes, Joel A
2013-06-24 21:09                               ` Fernandes, Joel A
2013-06-24 21:09                               ` Fernandes, Joel A
2013-06-24 21:09                               ` Fernandes, Joel A
2013-06-24 11:23                   ` Sekhar Nori
2013-06-24 11:23                     ` Sekhar Nori
2013-06-24 11:23                     ` Sekhar Nori
2013-06-24 11:23                     ` Sekhar Nori
2013-06-24 11:34                     ` Sekhar Nori
2013-06-24 11:34                       ` Sekhar Nori
2013-06-24 11:34                       ` Sekhar Nori
2013-06-24 11:34                       ` Sekhar Nori
2013-06-24 20:10                     ` Joel A Fernandes
2013-06-24 20:10                       ` Joel A Fernandes
2013-06-24 20:10                       ` Joel A Fernandes
2013-06-24 20:10                       ` Joel A Fernandes
2013-06-20 21:06 ` [PATCH v12 06/11] da8xx: config: Enable MMC and FS options Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06 ` [PATCH v12 07/11] ARM: davinci: Fix compiler warnings in devices-da8xx Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06 ` [PATCH v12 08/11] spi: omap2-mcspi: add generic DMA request support to the DT binding Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-21 10:35   ` Sourav Poddar
2013-06-21 10:35     ` Sourav Poddar
2013-06-21 10:35     ` Sourav Poddar
2013-06-21 10:35     ` Sourav Poddar
2013-06-20 21:06 ` [PATCH v12 09/11] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-21 10:26   ` Sourav Poddar [this message]
2013-06-21 10:26     ` Sourav Poddar
2013-06-21 10:26     ` Sourav Poddar
2013-06-21 10:26     ` Sourav Poddar
2013-06-21 10:37     ` Sekhar Nori
2013-06-21 10:37       ` Sekhar Nori
2013-06-21 10:37       ` Sekhar Nori
2013-06-21 10:37       ` Sekhar Nori
2013-06-21 11:28       ` Mark Brown
2013-06-21 11:28         ` Mark Brown
2013-06-21 11:28         ` Mark Brown
2013-06-21 11:28         ` Mark Brown
2013-06-21 12:22         ` Sourav Poddar
2013-06-21 12:22           ` Sourav Poddar
2013-06-21 12:22           ` Sourav Poddar
2013-06-21 12:22           ` Sourav Poddar
2013-06-20 21:06 ` [PATCH v12 10/11] ARM: dts: add AM33XX EDMA support Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-08-19 14:22   ` Sebastian Andrzej Siewior
2013-08-19 14:22     ` Sebastian Andrzej Siewior
2013-08-19 14:22     ` Sebastian Andrzej Siewior
2013-08-19 14:22     ` Sebastian Andrzej Siewior
2013-06-20 21:06 ` [PATCH v12 11/11] ARM: dts: add AM33XX SPI DMA support Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-20 21:06   ` Joel A Fernandes
2013-06-21 10:27 ` [PATCH v12 00/11] DMA Engine support for AM33XX Sekhar Nori
2013-06-21 10:27   ` Sekhar Nori
2013-06-21 10:27   ` Sekhar Nori
2013-06-21 10:27   ` Sekhar Nori
2013-06-22  0:07   ` Joel A Fernandes
2013-06-22  0:07     ` Joel A Fernandes
2013-06-22  0:07     ` Joel A Fernandes
2013-06-22  0:07     ` Joel A Fernandes
2013-06-22  3:36     ` Joel A Fernandes
2013-06-22  3:36       ` Joel A Fernandes
2013-06-22  3:36       ` Joel A Fernandes
2013-06-22  3:36       ` Joel A Fernandes
2013-06-24 10:19 ` Tony Lindgren
2013-06-24 10:19   ` Tony Lindgren
2013-06-24 10:19   ` Tony Lindgren
2013-06-24 10:19   ` Tony Lindgren
2013-06-24 11:39   ` Sekhar Nori
2013-06-24 11:39     ` Sekhar Nori
2013-06-24 11:39     ` Sekhar Nori
2013-06-24 11:39     ` Sekhar Nori
2013-06-24 11:48     ` Sourav Poddar
2013-06-24 11:48       ` Sourav Poddar
2013-06-24 11:48       ` Sourav Poddar
2013-06-24 11:48       ` Sourav Poddar
2013-06-24 14:36   ` Benoit Cousson
2013-06-24 14:36     ` Benoit Cousson
2013-06-24 14:36     ` Benoit Cousson
2013-06-24 14:36     ` Benoit Cousson
2013-06-25  6:54     ` Tony Lindgren
2013-06-25  6:54       ` Tony Lindgren
2013-06-25  6:54       ` Tony Lindgren
2013-06-25  6:54       ` Tony Lindgren
2013-06-25 14:16       ` Sekhar Nori
2013-06-25 14:16         ` Sekhar Nori
2013-06-25 14:16         ` Sekhar Nori
2013-06-25 14:42         ` Santosh Shilimkar
2013-06-25 14:42           ` Santosh Shilimkar
2013-06-25 14:42           ` Santosh Shilimkar
2013-06-25 14:42           ` Santosh Shilimkar

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=51C42A71.1090403@ti.com \
    --to=sourav.poddar@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=joelagnel@ti.com \
    --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: link
Be 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.