tifm_sd: remove tifm_sd_terminate function
[safe/jmp/linux-2.6] / drivers / mmc / pxamci.c
index f97b472..9774fc6 100644 (file)
@@ -16,7 +16,6 @@
  *     1 and 3 byte data transfers not supported
  *     max block length up to 1023
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -119,7 +118,7 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
                nob = 0xffff;
 
        writel(nob, host->base + MMC_NOB);
-       writel(1 << data->blksz_bits, host->base + MMC_BLKLEN);
+       writel(data->blksz, host->base + MMC_BLKLEN);
 
        clks = (unsigned long long)data->timeout_ns * CLOCKRATE;
        do_div(clks, 1000000000UL);
@@ -172,7 +171,7 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd,
 
 #define RSP_TYPE(x)    ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE))
        switch (RSP_TYPE(mmc_resp_type(cmd))) {
-       case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6 */
+       case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6, r7 */
                cmdat |= CMDAT_RESP_SHORT;
                break;
        case RSP_TYPE(MMC_RSP_R3):
@@ -283,7 +282,7 @@ static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
         * data blocks as being in error.
         */
        if (data->error == MMC_ERR_NONE)
-               data->bytes_xfered = data->blocks << data->blksz_bits;
+               data->bytes_xfered = data->blocks * data->blksz;
        else
                data->bytes_xfered = 0;
 
@@ -300,7 +299,7 @@ static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
        return 1;
 }
 
-static irqreturn_t pxamci_irq(int irq, void *devid, struct pt_regs *regs)
+static irqreturn_t pxamci_irq(int irq, void *devid)
 {
        struct pxamci_host *host = devid;
        unsigned int ireg;
@@ -356,7 +355,7 @@ static int pxamci_get_ro(struct mmc_host *mmc)
        struct pxamci_host *host = mmc_priv(mmc);
 
        if (host->pdata && host->pdata->get_ro)
-               return host->pdata->get_ro(mmc->dev);
+               return host->pdata->get_ro(mmc_dev(mmc));
        /* Host doesn't support read only detection so assume writeable */
        return 0;
 }
@@ -384,7 +383,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                host->power_mode = ios->power_mode;
 
                if (host->pdata && host->pdata->setpower)
-                       host->pdata->setpower(mmc->dev, ios->vdd);
+                       host->pdata->setpower(mmc_dev(mmc), ios->vdd);
 
                if (ios->power_mode == MMC_POWER_ON)
                        host->cmdat |= CMDAT_INIT;
@@ -394,19 +393,19 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                 host->clkrt, host->cmdat);
 }
 
-static struct mmc_host_ops pxamci_ops = {
+static const struct mmc_host_ops pxamci_ops = {
        .request        = pxamci_request,
        .get_ro         = pxamci_get_ro,
        .set_ios        = pxamci_set_ios,
 };
 
-static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs)
+static void pxamci_dma_irq(int dma, void *devid)
 {
        printk(KERN_ERR "DMA%d: IRQ???\n", dma);
        DCSR(dma) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
 }
 
-static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
+static irqreturn_t pxamci_detect_irq(int irq, void *devid)
 {
        struct pxamci_host *host = mmc_priv(devid);
 
@@ -451,6 +450,16 @@ static int pxamci_probe(struct platform_device *pdev)
         */
        mmc->max_seg_size = PAGE_SIZE;
 
+       /*
+        * Block length register is 10 bits.
+        */
+       mmc->max_blk_size = 1023;
+
+       /*
+        * Block count register is 16 bits.
+        */
+       mmc->max_blk_count = 65535;
+
        host = mmc_priv(mmc);
        host->mmc = mmc;
        host->dma = -1;