Commit c9565287 authored by Russell King's avatar Russell King

[MMC] Update PXAMCI for later kernels.

Remove obsolete platform_device_resource/irq functions.  The driver
model now has equivalents, so these can be removed.

Use pxa_set_cken() to enable/disable the clock to the MMC interface.
parent 83bc4198
...@@ -401,26 +401,6 @@ static struct mmc_host_ops pxamci_ops = { ...@@ -401,26 +401,6 @@ static struct mmc_host_ops pxamci_ops = {
.set_ios = pxamci_set_ios, .set_ios = pxamci_set_ios,
}; };
static struct resource *platform_device_resource(struct platform_device *dev, unsigned int mask, int nr)
{
int i;
for (i = 0; i < dev->num_resources; i++)
if (dev->resource[i].flags == mask && nr-- == 0)
return &dev->resource[i];
return NULL;
}
static int platform_device_irq(struct platform_device *dev, int nr)
{
int i;
for (i = 0; i < dev->num_resources; i++)
if (dev->resource[i].flags == IORESOURCE_IRQ && nr-- == 0)
return dev->resource[i].start;
return NO_IRQ;
}
static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs) static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs)
{ {
printk(KERN_ERR "DMA%d: IRQ???\n", dma); printk(KERN_ERR "DMA%d: IRQ???\n", dma);
...@@ -435,8 +415,8 @@ static int pxamci_probe(struct device *dev) ...@@ -435,8 +415,8 @@ static int pxamci_probe(struct device *dev)
struct resource *r; struct resource *r;
int ret, irq; int ret, irq;
r = platform_device_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_device_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (!r || irq == NO_IRQ) if (!r || irq == NO_IRQ)
return -ENXIO; return -ENXIO;
...@@ -485,12 +465,9 @@ static int pxamci_probe(struct device *dev) ...@@ -485,12 +465,9 @@ static int pxamci_probe(struct device *dev)
writel(0, host->base + MMC_SPI); writel(0, host->base + MMC_SPI);
writel(64, host->base + MMC_RESTO); writel(64, host->base + MMC_RESTO);
#ifdef CONFIG_PREEMPT
#error Not Preempt-safe
#endif
pxa_gpio_mode(GPIO6_MMCCLK_MD); pxa_gpio_mode(GPIO6_MMCCLK_MD);
pxa_gpio_mode(GPIO8_MMCCS0_MD); pxa_gpio_mode(GPIO8_MMCCS0_MD);
CKEN |= CKEN12_MMC; pxa_set_cken(CKEN12_MMC, 1);
host->dma = pxa_request_dma("PXAMCI", DMA_PRIO_LOW, pxamci_dma_irq, host); host->dma = pxa_request_dma("PXAMCI", DMA_PRIO_LOW, pxamci_dma_irq, host);
if (host->dma < 0) { if (host->dma < 0) {
...@@ -544,6 +521,8 @@ static int pxamci_remove(struct device *dev) ...@@ -544,6 +521,8 @@ static int pxamci_remove(struct device *dev)
iounmap(host->base); iounmap(host->base);
dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
pxa_set_cken(CKEN12_MMC, 0);
release_resource(host->res); release_resource(host->res);
mmc_free_host(mmc); mmc_free_host(mmc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment