Skip to contentSkip to conversation

omap_hsmmc DT DMA Client support

PATCH In review Matt Porter 2 participants 4 messages Mar 6, 2013 – Apr 5, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover omap_hsmmc DT DMA Client support

Changes since v2:
- dropped skip platform_get_resource_byname() patch
Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers and the dma_request_slave_channel_compat() wrapper to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

Matt Porter (2):
mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
mmc: omap_hsmmc: add generic DMA request support to the DT binding

 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |   26 +++++++++++++++++++-
 drivers/mmc/host/omap_hsmmc.c                      |   10 ++++++--
 2 files changed, 33 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/2 mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()

Convert dmaengine channel requests to use dma_request_slave_channel_compat(). This supports platforms booting with or without DT populated.

---
 drivers/mmc/host/omap_hsmmc.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/mmc/host/omap_hsmmc.c +8 -2
index bc58078..e79b12d 100644
@@ -1915,14 +1915,20 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);
 
-	host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req);
+	host->rx_chan =
+		dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+						 &rx_req, &pdev->dev, "rx");
+
 	if (!host->rx_chan) {
 		dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
 		ret = -ENXIO;
 		goto err_irq;
 	}
 
-	host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req);
+	host->tx_chan =
+		dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+						 &tx_req, &pdev->dev, "tx");
+
 	if (!host->tx_chan) {
 		dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req);
 		ret = -ENXIO;
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v3 2/2 mmc: omap_hsmmc: add generic DMA request support to the DT binding

In reply to Matt Porter

The binding definition is based on the generic DMA request binding.

---
 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |   26 +++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt +25 -1
index ed271fc..8c8908a 100644
@@ -20,8 +20,29 @@ ti,dual-volt: boolean, supports dual voltage cards
 ti,non-removable: non-removable slot (like eMMC)
 ti,needs-special-reset: Requires a special softreset sequence
 ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed
+dmas: List of DMA specifiers with the controller specific format
+as described in the generic DMA client binding. A tx and rx
+specifier is required.
+dma-names: List of DMA request names. These strings correspond
+1:1 with the DMA specifiers listed in dmas. The string naming is
+to be "rx" and "tx" for RX and TX DMA requests, respectively.
+
+Examples:
+
+[hwmod populated DMA resources]
+
+	mmc1: mmc@0x4809c000 {
+		compatible = "ti,omap4-hsmmc";
+		reg = <0x4809c000 0x400>;
+		ti,hwmods = "mmc1";
+		ti,dual-volt;
+		bus-width = <4>;
+		vmmc-supply = <&vmmc>; /* phandle to regulator node */
+		ti,non-removable;
+	};
+
+[generic DMA request binding]
 
-Example:
 	mmc1: mmc@0x4809c000 {
 		compatible = "ti,omap4-hsmmc";
 		reg = <0x4809c000 0x400>;
@@ -30,4 +51,7 @@ Example:
 		bus-width = <4>;
 		vmmc-supply = <&vmmc>; /* phandle to regulator node */
 		ti,non-removable;
+		dmas = <&edma 24
+			&edma 25>;
+		dma-names = "tx", "rx";
 	};
Signature · 1 line
1.7.9.5
Acked-by on the v3 series
#3 lore raw
In reply to Matt Porter
Quoted 11 lines · Matt Porter

Changes since v2:
- dropped skip platform_get_resource_byname() patch
Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers and the dma_request_slave_channel_compat() wrapper to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

Quoted 7 lines

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

Matt Porter (2):
mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
mmc: omap_hsmmc: add generic DMA request support to the DT binding

Looks good to me

Quoted 4 lines
  .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |   26 +++++++++++++++++++-
  drivers/mmc/host/omap_hsmmc.c                      |   10 ++++++--
  2 files changed, 33 insertions(+), 3 deletions(-)