Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373971
b: refs/heads/master
c: 0e91e43
h: refs/heads/master
i:
  373969: 299ff0a
  373967: 685c2d8
v: v3
  • Loading branch information
Shawn Guo committed Apr 4, 2013
1 parent 887e97a commit 7ac255d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d84f638b037fcd132ecf6f09f5b8ccf82278b9ee
refs/heads/master: 0e91e434c86c84e84c46cf8bff2b5e53daee85d5
12 changes: 8 additions & 4 deletions trunk/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};
48 changes: 5 additions & 43 deletions trunk/drivers/mmc/host/mxs-mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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__);
Expand Down

0 comments on commit 7ac255d

Please sign in to comment.