* [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT
@ 2013-04-24 10:58 Lee Jones
2013-04-24 15:55 ` [PATCH v2] " Lee Jones
2013-04-30 13:01 ` [PATCH] " Linus Walleij
0 siblings, 2 replies; 5+ messages in thread
From: Lee Jones @ 2013-04-24 10:58 UTC (permalink / raw)
To: linux-arm-kernel
Currently, if DMA information isn't passed from platform data, then DMA
will not be used. This patch allows DMA information obtained though Device
Tree to be used as well.
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mmc/host/mmci.c | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 372e921..ecd256b 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -304,10 +304,8 @@ static void mmci_dma_setup(struct mmci_host *host)
const char *rxname, *txname;
dma_cap_mask_t mask;
- if (!plat || !plat->dma_filter) {
- dev_info(mmc_dev(host->mmc), "no DMA platform data\n");
- return;
- }
+ host->dma_rx_channel = dma_request_slave_channel(dev, "rx");
+ host->dma_tx_channel = dma_request_slave_channel(dev, "tx");
/* initialize pre request cookie */
host->next_data.cookie = 1;
@@ -316,30 +314,33 @@ static void mmci_dma_setup(struct mmci_host *host)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
- /*
- * If only an RX channel is specified, the driver will
- * attempt to use it bidirectionally, however if it is
- * is specified but cannot be located, DMA will be disabled.
- */
- if (plat->dma_rx_param) {
- host->dma_rx_channel = dma_request_channel(mask,
+ if (plat && plat->dma_filter) {
+ if (!host->dma_rx_channel && plat->dma_rx_param) {
+ host->dma_rx_channel = dma_request_channel(mask,
plat->dma_filter,
plat->dma_rx_param);
- /* E.g if no DMA hardware is present */
- if (!host->dma_rx_channel)
- dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");
- }
+ /* E.g if no DMA hardware is present */
+ if (!host->dma_rx_channel)
+ dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");
+ }
- if (plat->dma_tx_param) {
- host->dma_tx_channel = dma_request_channel(mask,
+ if (!host->dma_tx_channel && plat->dma_tx_param) {
+ host->dma_tx_channel = dma_request_channel(mask,
plat->dma_filter,
plat->dma_tx_param);
- if (!host->dma_tx_channel)
- dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n");
- } else {
- host->dma_tx_channel = host->dma_rx_channel;
+ if (!host->dma_tx_channel)
+ dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n");
+ }
}
+ /*
+ * If only an RX channel is specified, the driver will
+ * attempt to use it bidirectionally, however if it is
+ * is specified but cannot be located, DMA will be disabled.
+ */
+ if (host->dma_rx_channel && !host->dma_tx_channel)
+ host->dma_tx_channel = host->dma_rx_channel;
+
if (host->dma_rx_channel)
rxname = dma_chan_name(host->dma_rx_channel);
else
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] mmc: mmci: Allow MMCI to request channels with information acquired from DT
2013-04-24 10:58 [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT Lee Jones
@ 2013-04-24 15:55 ` Lee Jones
2013-05-23 19:00 ` Linus Walleij
2013-04-30 13:01 ` [PATCH] " Linus Walleij
1 sibling, 1 reply; 5+ messages in thread
From: Lee Jones @ 2013-04-24 15:55 UTC (permalink / raw)
To: linux-arm-kernel
Currently, if DMA information isn't passed from platform data, then DMA
will not be used. This patch allows DMA information obtained though Device
Tree to be used as well.
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 372e921..45dda46 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -304,10 +304,8 @@ static void mmci_dma_setup(struct mmci_host *host)
const char *rxname, *txname;
dma_cap_mask_t mask;
- if (!plat || !plat->dma_filter) {
- dev_info(mmc_dev(host->mmc), "no DMA platform data\n");
- return;
- }
+ host->dma_rx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "rx");
+ host->dma_tx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "tx");
/* initialize pre request cookie */
host->next_data.cookie = 1;
@@ -316,30 +314,33 @@ static void mmci_dma_setup(struct mmci_host *host)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
- /*
- * If only an RX channel is specified, the driver will
- * attempt to use it bidirectionally, however if it is
- * is specified but cannot be located, DMA will be disabled.
- */
- if (plat->dma_rx_param) {
- host->dma_rx_channel = dma_request_channel(mask,
+ if (plat && plat->dma_filter) {
+ if (!host->dma_rx_channel && plat->dma_rx_param) {
+ host->dma_rx_channel = dma_request_channel(mask,
plat->dma_filter,
plat->dma_rx_param);
- /* E.g if no DMA hardware is present */
- if (!host->dma_rx_channel)
- dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");
- }
+ /* E.g if no DMA hardware is present */
+ if (!host->dma_rx_channel)
+ dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");
+ }
- if (plat->dma_tx_param) {
- host->dma_tx_channel = dma_request_channel(mask,
+ if (!host->dma_tx_channel && plat->dma_tx_param) {
+ host->dma_tx_channel = dma_request_channel(mask,
plat->dma_filter,
plat->dma_tx_param);
- if (!host->dma_tx_channel)
- dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n");
- } else {
- host->dma_tx_channel = host->dma_rx_channel;
+ if (!host->dma_tx_channel)
+ dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n");
+ }
}
+ /*
+ * If only an RX channel is specified, the driver will
+ * attempt to use it bidirectionally, however if it is
+ * is specified but cannot be located, DMA will be disabled.
+ */
+ if (host->dma_rx_channel && !host->dma_tx_channel)
+ host->dma_tx_channel = host->dma_rx_channel;
+
if (host->dma_rx_channel)
rxname = dma_chan_name(host->dma_rx_channel);
else
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] mmc: mmci: Allow MMCI to request channels with information acquired from DT
2013-04-24 15:55 ` [PATCH v2] " Lee Jones
@ 2013-05-23 19:00 ` Linus Walleij
0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2013-05-23 19:00 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 24, 2013 at 5:55 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Currently, if DMA information isn't passed from platform data, then DMA
> will not be used. This patch allows DMA information obtained though Device
> Tree to be used as well.
>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Chris Ball <cjb@laptop.org>
> Cc: linux-mmc at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
I've now tested this v2 version with device tree on Nomadik and
U300 and it works like a charm.
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT
2013-04-24 10:58 [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT Lee Jones
2013-04-24 15:55 ` [PATCH v2] " Lee Jones
@ 2013-04-30 13:01 ` Linus Walleij
2013-04-30 13:12 ` Lee Jones
1 sibling, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2013-04-30 13:01 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 24, 2013 at 12:58 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Currently, if DMA information isn't passed from platform data, then DMA
> will not be used. This patch allows DMA information obtained though Device
> Tree to be used as well.
>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Chris Ball <cjb@laptop.org>
> Cc: linux-mmc at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
(...)
I tried to test this patch, but:
CC drivers/mmc/host/mmci.o
/drivers/mmc/host/mmci.c: In function 'mmci_dma_setup':
/drivers/mmc/host/mmci.c:307:51: error: 'dev' undeclared (first use in
this function)
/drivers/mmc/host/mmci.c:307:51: note: each undeclared identifier is
reported only once for each function it appears in
make[5]: *** [drivers/mmc/host/mmci.o] Error 1
make[4]: *** [drivers/mmc/host] Error 2
make[3]: *** [drivers/mmc] Error 2
Due to:
> @@ -304,10 +304,8 @@ static void mmci_dma_setup(struct mmci_host *host)
> const char *rxname, *txname;
> dma_cap_mask_t mask;
>
> - if (!plat || !plat->dma_filter) {
> - dev_info(mmc_dev(host->mmc), "no DMA platform data\n");
> - return;
> - }
> + host->dma_rx_channel = dma_request_slave_channel(dev, "rx");
> + host->dma_tx_channel = dma_request_slave_channel(dev, "tx");
There is no "dev" here.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT
2013-04-30 13:01 ` [PATCH] " Linus Walleij
@ 2013-04-30 13:12 ` Lee Jones
0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2013-04-30 13:12 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 30 Apr 2013, Linus Walleij wrote:
> On Wed, Apr 24, 2013 at 12:58 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
> > Currently, if DMA information isn't passed from platform data, then DMA
> > will not be used. This patch allows DMA information obtained though Device
> > Tree to be used as well.
> >
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Chris Ball <cjb@laptop.org>
> > Cc: linux-mmc at vger.kernel.org
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> (...)
>
> I tried to test this patch, but:
> CC drivers/mmc/host/mmci.o
> /drivers/mmc/host/mmci.c: In function 'mmci_dma_setup':
> /drivers/mmc/host/mmci.c:307:51: error: 'dev' undeclared (first use in
> this function)
> /drivers/mmc/host/mmci.c:307:51: note: each undeclared identifier is
> reported only once for each function it appears in
> make[5]: *** [drivers/mmc/host/mmci.o] Error 1
> make[4]: *** [drivers/mmc/host] Error 2
> make[3]: *** [drivers/mmc] Error 2
>
> Due to:
>
> > @@ -304,10 +304,8 @@ static void mmci_dma_setup(struct mmci_host *host)
> > const char *rxname, *txname;
> > dma_cap_mask_t mask;
> >
> > - if (!plat || !plat->dma_filter) {
> > - dev_info(mmc_dev(host->mmc), "no DMA platform data\n");
> > - return;
> > - }
> > + host->dma_rx_channel = dma_request_slave_channel(dev, "rx");
> > + host->dma_tx_channel = dma_request_slave_channel(dev, "tx");
>
> There is no "dev" here.
You've missed v2 again dude.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-23 19:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 10:58 [PATCH] mmc: mmci: Allow MMCI to request channels with information acquired from DT Lee Jones
2013-04-24 15:55 ` [PATCH v2] " Lee Jones
2013-05-23 19:00 ` Linus Walleij
2013-04-30 13:01 ` [PATCH] " Linus Walleij
2013-04-30 13:12 ` Lee Jones
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).