]> Git Repo - linux.git/commitdiff
Merge tag 'mmc-merge-for-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Sat, 14 Jan 2012 04:41:15 +0000 (20:41 -0800)
committerLinus Torvalds <[email protected]>
Sat, 14 Jan 2012 04:41:15 +0000 (20:41 -0800)
MMC highlights for 3.3:

Core:
 * Support for the HS200 high-speed eMMC mode.
 * Support SDIO 3.0 Ultra High Speed cards.
 * Kill pending block requests immediately if card is removed.
 * Enable the eMMC feature for locking boot partitions read-only
   until next power on, exposed via sysfs.

Drivers:
 * Runtime PM support for Intel Medfield SDIO.
 * Suspend/resume support for sdhci-spear.
 * sh-mmcif now processes requests asynchronously.

* tag 'mmc-merge-for-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (58 commits)
  mmc: fix a deadlock between system suspend and MMC block IO
  mmc: sdhci: restore the enabled dma when do reset all
  mmc: dw_mmc: miscaculated the fifo-depth with wrong bit operation
  mmc: host: Adds support for eMMC 4.5 HS200 mode
  mmc: core: HS200 mode support for eMMC 4.5
  mmc: dw_mmc: fixed wrong bit operation for SDMMC_GET_FCNT()
  mmc: core: Separate the timeout value for cache-ctrl
  mmc: sdhci-spear: Fix compilation error
  mmc: sdhci: Deal with failure case in sdhci_suspend_host
  mmc: dw_mmc: Clear the DDR mode for non-DDR
  mmc: sd: Fix SDR12 timing regression
  mmc: sdhci: Fix tuning timer incorrect setting when suspending host
  mmc: core: Add option to prevent eMMC sleep command
  mmc: omap_hsmmc: use threaded irq handler for card-detect.
  mmc: sdhci-pci: enable runtime PM for Medfield SDIO
  mmc: sdhci: Always pass clock request value zero to set_clock host op
  mmc: sdhci-pci: remove SDHCI_QUIRK2_OWN_CARD_DETECTION
  mmc: sdhci-pci: get gpio numbers from platform data
  mmc: sdhci-pci: add platform data
  mmc: sdhci: prevent card detection activity for non-removable cards
  ...

1  2 
arch/arm/plat-samsung/include/plat/sdhci.h
drivers/mmc/card/mmc_test.c
drivers/mmc/host/at91_mci.c
drivers/mmc/host/mmci.c
drivers/mmc/host/mxs-mmc.c
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/sdhci-s3c.c

index 656dc00d30edde87d8d44ed6dada500672355394,6e999436dad8d6abe32dce905ae45ba4678f5068..f82f888b91a95bb0a238975b4c575408728eb1e9
@@@ -63,9 -63,12 +63,10 @@@ enum clk_types 
  struct s3c_sdhci_platdata {
        unsigned int    max_width;
        unsigned int    host_caps;
+       unsigned int    pm_caps;
        enum cd_types   cd_type;
        enum clk_types  clk_type;
  
 -      char            **clocks;       /* set of clock sources */
 -
        int             ext_cd_gpio;
        bool            ext_cd_gpio_invert;
        int     (*ext_cd_init)(void (*notify_func)(struct platform_device *,
@@@ -123,17 -126,16 +124,17 @@@ extern void exynos4_setup_sdhci0_cfg_gp
  extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
  extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
  extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
 +extern void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
 +extern void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
 +extern void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
 +extern void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
  
  /* S3C2416 SDHCI setup */
  
  #ifdef CONFIG_S3C2416_SETUP_SDHCI
 -extern char *s3c2416_hsmmc_clksrcs[4];
 -
  static inline void s3c2416_default_sdhci0(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC
 -      s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
  #endif /* CONFIG_S3C_DEV_HSMMC */
  }
  static inline void s3c2416_default_sdhci1(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC1
 -      s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
  #endif /* CONFIG_S3C_DEV_HSMMC1 */
  }
@@@ -150,13 -153,15 +151,13 @@@ static inline void s3c2416_default_sdhc
  static inline void s3c2416_default_sdhci1(void) { }
  
  #endif /* CONFIG_S3C2416_SETUP_SDHCI */
 +
  /* S3C64XX SDHCI setup */
  
  #ifdef CONFIG_S3C64XX_SETUP_SDHCI
 -extern char *s3c64xx_hsmmc_clksrcs[4];
 -
  static inline void s3c6400_default_sdhci0(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC
 -      s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
  #endif
  }
  static inline void s3c6400_default_sdhci1(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC1
 -      s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
  #endif
  }
  static inline void s3c6400_default_sdhci2(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC2
 -      s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
  #endif
  }
  static inline void s3c6410_default_sdhci0(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC
 -      s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
  #endif
  }
  static inline void s3c6410_default_sdhci1(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC1
 -      s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
  #endif
  }
  static inline void s3c6410_default_sdhci2(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC2
 -      s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
  #endif
  }
@@@ -206,51 -216,15 +207,51 @@@ static inline void s3c6400_default_sdhc
  
  #endif /* CONFIG_S3C64XX_SETUP_SDHCI */
  
 +/* S5P64X0 SDHCI setup */
 +
 +#ifdef CONFIG_S5P64X0_SETUP_SDHCI
 +static inline void s5p64x0_default_sdhci0(void)
 +{
 +#ifdef CONFIG_S3C_DEV_HSMMC
 +      s3c_hsmmc0_def_platdata.cfg_gpio = s5p64x0_setup_sdhci0_cfg_gpio;
 +#endif
 +}
 +
 +static inline void s5p64x0_default_sdhci1(void)
 +{
 +#ifdef CONFIG_S3C_DEV_HSMMC1
 +      s3c_hsmmc1_def_platdata.cfg_gpio = s5p64x0_setup_sdhci1_cfg_gpio;
 +#endif
 +}
 +
 +static inline void s5p6440_default_sdhci2(void)
 +{
 +#ifdef CONFIG_S3C_DEV_HSMMC2
 +      s3c_hsmmc2_def_platdata.cfg_gpio = s5p6440_setup_sdhci2_cfg_gpio;
 +#endif
 +}
 +
 +static inline void s5p6450_default_sdhci2(void)
 +{
 +#ifdef CONFIG_S3C_DEV_HSMMC2
 +      s3c_hsmmc2_def_platdata.cfg_gpio = s5p6450_setup_sdhci2_cfg_gpio;
 +#endif
 +}
 +
 +#else
 +static inline void s5p64x0_default_sdhci0(void) { }
 +static inline void s5p64x0_default_sdhci1(void) { }
 +static inline void s5p6440_default_sdhci2(void) { }
 +static inline void s5p6450_default_sdhci2(void) { }
 +
 +#endif /* CONFIG_S5P64X0_SETUP_SDHCI */
 +
  /* S5PC100 SDHCI setup */
  
  #ifdef CONFIG_S5PC100_SETUP_SDHCI
 -extern char *s5pc100_hsmmc_clksrcs[4];
 -
  static inline void s5pc100_default_sdhci0(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC
 -      s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
  #endif
  }
  static inline void s5pc100_default_sdhci1(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC1
 -      s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
  #endif
  }
  static inline void s5pc100_default_sdhci2(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC2
 -      s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
  #endif
  }
@@@ -279,9 -255,12 +280,9 @@@ static inline void s5pc100_default_sdhc
  /* S5PV210 SDHCI setup */
  
  #ifdef CONFIG_S5PV210_SETUP_SDHCI
 -extern char *s5pv210_hsmmc_clksrcs[4];
 -
  static inline void s5pv210_default_sdhci0(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC
 -      s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
  #endif
  }
  static inline void s5pv210_default_sdhci1(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC1
 -      s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
  #endif
  }
  static inline void s5pv210_default_sdhci2(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC2
 -      s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
  #endif
  }
  static inline void s5pv210_default_sdhci3(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC3
 -      s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
        s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
  #endif
  }
@@@ -317,9 -299,12 +318,9 @@@ static inline void s5pv210_default_sdhc
  
  /* EXYNOS4 SDHCI setup */
  #ifdef CONFIG_EXYNOS4_SETUP_SDHCI
 -extern char *exynos4_hsmmc_clksrcs[4];
 -
  static inline void exynos4_default_sdhci0(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC
 -      s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
  #endif
  }
  static inline void exynos4_default_sdhci1(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC1
 -      s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
  #endif
  }
  static inline void exynos4_default_sdhci2(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC2
 -      s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
  #endif
  }
  static inline void exynos4_default_sdhci3(void)
  {
  #ifdef CONFIG_S3C_DEV_HSMMC3
 -      s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs;
        s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
  #endif
  }
index e99bdc18002df76b09b54e269714401596419f7c,584899889e8fb86d95e47d540eb30e07b6683e1c..759714ed6bee8f791b2cbd4a5959f2ca12d7e9ec
@@@ -1581,6 -1581,7 +1581,7 @@@ static int mmc_test_area_init(struct mm
  
        t->max_segs = test->card->host->max_segs;
        t->max_seg_sz = test->card->host->max_seg_size;
+       t->max_seg_sz -= t->max_seg_sz % 512;
  
        t->max_tfr = t->max_sz;
        if (t->max_tfr >> 9 > test->card->host->max_blk_count)
@@@ -2949,7 -2950,7 +2950,7 @@@ static void mmc_test_free_dbgfs_file(st
  }
  
  static int __mmc_test_register_dbgfs_file(struct mmc_card *card,
 -      const char *name, mode_t mode, const struct file_operations *fops)
 +      const char *name, umode_t mode, const struct file_operations *fops)
  {
        struct dentry *file = NULL;
        struct mmc_test_dbgfs_file *df;
index f437c3e6f3aaa9b5cf5b96df2d5128c6029dfac1,9a32922265e54ce5a30928cdd35d4f4096d9190e..947faa5d2ce4ebb243f049bca62430541c286efa
@@@ -236,7 -236,7 +236,7 @@@ static inline void at91_mci_sg_to_dma(s
  
                sg = &data->sg[i];
  
-               sgbuffer = kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset;
+               sgbuffer = kmap_atomic(sg_page(sg)) + sg->offset;
                amount = min(size, sg->length);
                size -= amount;
  
                        dmabuf = (unsigned *)tmpv;
                }
  
-               kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
+               kunmap_atomic(sgbuffer);
  
                if (size == 0)
                        break;
@@@ -302,7 -302,7 +302,7 @@@ static void at91_mci_post_dma_read(stru
  
                sg = &data->sg[i];
  
-               sgbuffer = kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset;
+               sgbuffer = kmap_atomic(sg_page(sg)) + sg->offset;
                amount = min(size, sg->length);
                size -= amount;
  
                }
  
                flush_kernel_dcache_page(sg_page(sg));
-               kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
+               kunmap_atomic(sgbuffer);
                data->bytes_xfered += amount;
                if (size == 0)
                        break;
@@@ -741,7 -741,7 +741,7 @@@ static void at91_mci_set_ios(struct mmc
        at91_mci_write(host, AT91_MCI_MR, (at91_mci_read(host, AT91_MCI_MR) & ~AT91_MCI_CLKDIV) | clkdiv);
  
        /* maybe switch power to the card */
 -      if (host->board->vcc_pin) {
 +      if (gpio_is_valid(host->board->vcc_pin)) {
                switch (ios->power_mode) {
                        case MMC_POWER_OFF:
                                gpio_set_value(host->board->vcc_pin, 0);
@@@ -897,7 -897,7 +897,7 @@@ static int at91_mci_get_ro(struct mmc_h
  {
        struct at91mci_host *host = mmc_priv(mmc);
  
 -      if (host->board->wp_pin)
 +      if (gpio_is_valid(host->board->wp_pin))
                return !!gpio_get_value(host->board->wp_pin);
        /*
         * Board doesn't support read only detection; let the mmc core
@@@ -991,21 -991,21 +991,21 @@@ static int __init at91_mci_probe(struc
         * Reserve GPIOs ... board init code makes sure these pins are set
         * up as GPIOs with the right direction (input, except for vcc)
         */
 -      if (host->board->det_pin) {
 +      if (gpio_is_valid(host->board->det_pin)) {
                ret = gpio_request(host->board->det_pin, "mmc_detect");
                if (ret < 0) {
                        dev_dbg(&pdev->dev, "couldn't claim card detect pin\n");
                        goto fail4b;
                }
        }
 -      if (host->board->wp_pin) {
 +      if (gpio_is_valid(host->board->wp_pin)) {
                ret = gpio_request(host->board->wp_pin, "mmc_wp");
                if (ret < 0) {
                        dev_dbg(&pdev->dev, "couldn't claim wp sense pin\n");
                        goto fail4;
                }
        }
 -      if (host->board->vcc_pin) {
 +      if (gpio_is_valid(host->board->vcc_pin)) {
                ret = gpio_request(host->board->vcc_pin, "mmc_vcc");
                if (ret < 0) {
                        dev_dbg(&pdev->dev, "couldn't claim vcc switch pin\n");
        /*
         * Add host to MMC layer
         */
 -      if (host->board->det_pin) {
 +      if (gpio_is_valid(host->board->det_pin)) {
                host->present = !gpio_get_value(host->board->det_pin);
        }
        else
        /*
         * monitor card insertion/removal if we can
         */
 -      if (host->board->det_pin) {
 +      if (gpio_is_valid(host->board->det_pin)) {
                ret = request_irq(gpio_to_irq(host->board->det_pin),
                                at91_mmc_det_irq, 0, mmc_hostname(mmc), host);
                if (ret)
@@@ -1087,13 -1087,13 +1087,13 @@@ fail0
  fail1:
        clk_put(host->mci_clk);
  fail2:
 -      if (host->board->vcc_pin)
 +      if (gpio_is_valid(host->board->vcc_pin))
                gpio_free(host->board->vcc_pin);
  fail3:
 -      if (host->board->wp_pin)
 +      if (gpio_is_valid(host->board->wp_pin))
                gpio_free(host->board->wp_pin);
  fail4:
 -      if (host->board->det_pin)
 +      if (gpio_is_valid(host->board->det_pin))
                gpio_free(host->board->det_pin);
  fail4b:
        if (host->buffer)
@@@ -1125,7 -1125,7 +1125,7 @@@ static int __exit at91_mci_remove(struc
                dma_free_coherent(&pdev->dev, MCI_BUFSIZE,
                                host->buffer, host->physical_address);
  
 -      if (host->board->det_pin) {
 +      if (gpio_is_valid(host->board->det_pin)) {
                if (device_can_wakeup(&pdev->dev))
                        free_irq(gpio_to_irq(host->board->det_pin), host);
                device_init_wakeup(&pdev->dev, 0);
        clk_disable(host->mci_clk);                     /* Disable the peripheral clock */
        clk_put(host->mci_clk);
  
 -      if (host->board->vcc_pin)
 +      if (gpio_is_valid(host->board->vcc_pin))
                gpio_free(host->board->vcc_pin);
 -      if (host->board->wp_pin)
 +      if (gpio_is_valid(host->board->wp_pin))
                gpio_free(host->board->wp_pin);
  
        iounmap(host->baseaddr);
@@@ -1163,7 -1163,7 +1163,7 @@@ static int at91_mci_suspend(struct plat
        struct at91mci_host *host = mmc_priv(mmc);
        int ret = 0;
  
 -      if (host->board->det_pin && device_may_wakeup(&pdev->dev))
 +      if (gpio_is_valid(host->board->det_pin) && device_may_wakeup(&pdev->dev))
                enable_irq_wake(host->board->det_pin);
  
        if (mmc)
@@@ -1178,7 -1178,7 +1178,7 @@@ static int at91_mci_resume(struct platf
        struct at91mci_host *host = mmc_priv(mmc);
        int ret = 0;
  
 -      if (host->board->det_pin && device_may_wakeup(&pdev->dev))
 +      if (gpio_is_valid(host->board->det_pin) && device_may_wakeup(&pdev->dev))
                disable_irq_wake(host->board->det_pin);
  
        if (mmc)
diff --combined drivers/mmc/host/mmci.c
index fa8dd2fda4b270d0858f144ed34abfc30a30da4a,8eabf999a858727fc4ca906ca017a22a9fb6e7f5..ece03b491c7db824fe7a698353f2c14f9f0cb6d2
@@@ -675,8 -675,7 +675,8 @@@ mmci_data_irq(struct mmci_host *host, s
              unsigned int status)
  {
        /* First check for errors */
 -      if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
 +      if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR|
 +                    MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
                u32 remain, success;
  
                /* Terminate the DMA transfer */
@@@ -755,12 -754,8 +755,12 @@@ mmci_cmd_irq(struct mmci_host *host, st
        }
  
        if (!cmd->data || cmd->error) {
 -              if (host->data)
 +              if (host->data) {
 +                      /* Terminate the DMA transfer */
 +                      if (dma_inprogress(host))
 +                              mmci_dma_data_error(host);
                        mmci_stop_data(host);
 +              }
                mmci_request_end(host, cmd->mrq);
        } else if (!(cmd->data->flags & MMC_DATA_READ)) {
                mmci_start_data(host, cmd->data);
@@@ -960,9 -955,8 +960,9 @@@ static irqreturn_t mmci_irq(int irq, vo
                dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status);
  
                data = host->data;
 -              if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|
 -                            MCI_RXOVERRUN|MCI_DATAEND|MCI_DATABLOCKEND) && data)
 +              if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR|
 +                            MCI_TXUNDERRUN|MCI_RXOVERRUN|MCI_DATAEND|
 +                            MCI_DATABLOCKEND) && data)
                        mmci_data_irq(host, data, status);
  
                cmd = host->cmd;
@@@ -1245,6 -1239,7 +1245,7 @@@ static int __devinit mmci_probe(struct 
        if (host->vcc == NULL)
                mmc->ocr_avail = plat->ocr_mask;
        mmc->caps = plat->capabilities;
+       mmc->caps2 = plat->capabilities2;
  
        /*
         * We can do SGIO
@@@ -1502,8 -1497,6 +1503,8 @@@ static struct amba_id mmci_ids[] = 
        { 0, 0 },
  };
  
 +MODULE_DEVICE_TABLE(amba, mmci_ids);
 +
  static struct amba_driver mmci_driver = {
        .drv            = {
                .name   = DRIVER_NAME,
index 973011f9a298ba7ecf9e49d26847d25d5ad99518,cf18fc2b24cdb23c9b01a811222a73c21fdee4bc..4e2e019dd5c94e02a8a6b54b413dcf2e162e7777
@@@ -713,7 -713,7 +713,7 @@@ static int mxs_mmc_probe(struct platfor
                ret = PTR_ERR(host->clk);
                goto out_iounmap;
        }
 -      clk_enable(host->clk);
 +      clk_prepare_enable(host->clk);
  
        mxs_mmc_reset(host);
  
@@@ -772,7 -772,7 +772,7 @@@ out_free_dma
        if (host->dmach)
                dma_release_channel(host->dmach);
  out_clk_put:
 -      clk_disable(host->clk);
 +      clk_disable_unprepare(host->clk);
        clk_put(host->clk);
  out_iounmap:
        iounmap(host->base);
@@@ -798,7 -798,7 +798,7 @@@ static int mxs_mmc_remove(struct platfo
        if (host->dmach)
                dma_release_channel(host->dmach);
  
 -      clk_disable(host->clk);
 +      clk_disable_unprepare(host->clk);
        clk_put(host->clk);
  
        iounmap(host->base);
@@@ -819,7 -819,7 +819,7 @@@ static int mxs_mmc_suspend(struct devic
  
        ret = mmc_suspend_host(mmc);
  
 -      clk_disable(host->clk);
 +      clk_disable_unprepare(host->clk);
  
        return ret;
  }
@@@ -830,7 -830,7 +830,7 @@@ static int mxs_mmc_resume(struct devic
        struct mxs_mmc_host *host = mmc_priv(mmc);
        int ret = 0;
  
 -      clk_enable(host->clk);
 +      clk_prepare_enable(host->clk);
  
        ret = mmc_resume_host(mmc);
  
@@@ -855,18 -855,7 +855,7 @@@ static struct platform_driver mxs_mmc_d
        },
  };
  
- static int __init mxs_mmc_init(void)
- {
-       return platform_driver_register(&mxs_mmc_driver);
- }
- static void __exit mxs_mmc_exit(void)
- {
-       platform_driver_unregister(&mxs_mmc_driver);
- }
- module_init(mxs_mmc_init);
- module_exit(mxs_mmc_exit);
+ module_platform_driver(mxs_mmc_driver);
  
  MODULE_DESCRIPTION("FREESCALE MXS MMC peripheral");
  MODULE_AUTHOR("Freescale Semiconductor");
index d1fb561e089d8e0ba24888d702b01ef428745b25,09fc4f8967ad7d216877b4b0097642145b10d1f8..fd0c661bbad38a7152a37955146ff6068d4d7137
@@@ -24,7 -24,6 +24,6 @@@
  #include <linux/delay.h>
  #include <linux/dma-mapping.h>
  #include <linux/platform_device.h>
- #include <linux/workqueue.h>
  #include <linux/timer.h>
  #include <linux/clk.h>
  #include <linux/mmc/host.h>
  
  #define MMC_AUTOSUSPEND_DELAY 100
  #define MMC_TIMEOUT_MS                20
- #define OMAP_MMC_MASTER_CLOCK 96000000
  #define OMAP_MMC_MIN_CLOCK    400000
  #define OMAP_MMC_MAX_CLOCK    52000000
  #define DRIVER_NAME           "omap_hsmmc"
@@@ -163,7 -161,6 +161,6 @@@ struct omap_hsmmc_host 
         */
        struct  regulator       *vcc;
        struct  regulator       *vcc_aux;
-       struct  work_struct     mmc_carddetect_work;
        void    __iomem         *base;
        resource_size_t         mapbase;
        spinlock_t              irq_lock; /* Prevent races with irq handler */
@@@ -598,12 -595,12 +595,12 @@@ static void omap_hsmmc_disable_irq(stru
  }
  
  /* Calculate divisor for the given clock frequency */
- static u16 calc_divisor(struct mmc_ios *ios)
+ static u16 calc_divisor(struct omap_hsmmc_host *host, struct mmc_ios *ios)
  {
        u16 dsor = 0;
  
        if (ios->clock) {
-               dsor = DIV_ROUND_UP(OMAP_MMC_MASTER_CLOCK, ios->clock);
+               dsor = DIV_ROUND_UP(clk_get_rate(host->fclk), ios->clock);
                if (dsor > 250)
                        dsor = 250;
        }
@@@ -623,7 -620,7 +620,7 @@@ static void omap_hsmmc_set_clock(struc
  
        regval = OMAP_HSMMC_READ(host->base, SYSCTL);
        regval = regval & ~(CLKD_MASK | DTO_MASK);
-       regval = regval | (calc_divisor(ios) << 6) | (DTO << 16);
+       regval = regval | (calc_divisor(host, ios) << 6) | (DTO << 16);
        OMAP_HSMMC_WRITE(host->base, SYSCTL, regval);
        OMAP_HSMMC_WRITE(host->base, SYSCTL,
                OMAP_HSMMC_READ(host->base, SYSCTL) | ICE);
@@@ -1280,17 -1277,16 +1277,16 @@@ static void omap_hsmmc_protect_card(str
  }
  
  /*
-  * Work Item to notify the core about card insertion/removal
+  * irq handler to notify the core about card insertion/removal
   */
- static void omap_hsmmc_detect(struct work_struct *work)
+ static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
  {
-       struct omap_hsmmc_host *host =
-               container_of(work, struct omap_hsmmc_host, mmc_carddetect_work);
+       struct omap_hsmmc_host *host = dev_id;
        struct omap_mmc_slot_data *slot = &mmc_slot(host);
        int carddetect;
  
        if (host->suspended)
-               return;
+               return IRQ_HANDLED;
  
        sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
  
                mmc_detect_change(host->mmc, (HZ * 200) / 1000);
        else
                mmc_detect_change(host->mmc, (HZ * 50) / 1000);
- }
- /*
-  * ISR for handling card insertion and removal
-  */
- static irqreturn_t omap_hsmmc_cd_handler(int irq, void *dev_id)
- {
-       struct omap_hsmmc_host *host = (struct omap_hsmmc_host *)dev_id;
-       if (host->suspended)
-               return IRQ_HANDLED;
-       schedule_work(&host->mmc_carddetect_work);
        return IRQ_HANDLED;
  }
  
@@@ -1919,7 -1902,6 +1902,6 @@@ static int __init omap_hsmmc_probe(stru
        host->next_data.cookie = 1;
  
        platform_set_drvdata(pdev, host);
-       INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect);
  
        mmc->ops        = &omap_hsmmc_ops;
  
        if (mmc_slot(host).nonremovable)
                mmc->caps |= MMC_CAP_NONREMOVABLE;
  
 +      mmc->pm_caps = mmc_slot(host).pm_caps;
 +
        omap_hsmmc_conf_bus_power(host);
  
        /* Select DMA lines */
  
        /* Request IRQ for card detect */
        if ((mmc_slot(host).card_detect_irq)) {
-               ret = request_irq(mmc_slot(host).card_detect_irq,
-                                 omap_hsmmc_cd_handler,
-                                 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-                                 mmc_hostname(mmc), host);
+               ret = request_threaded_irq(mmc_slot(host).card_detect_irq,
+                                          NULL,
+                                          omap_hsmmc_detect,
+                                          IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+                                          mmc_hostname(mmc), host);
                if (ret) {
                        dev_dbg(mmc_dev(host->mmc),
                                "Unable to grab MMC CD IRQ\n");
@@@ -2131,7 -2112,6 +2114,6 @@@ static int omap_hsmmc_remove(struct pla
                free_irq(host->irq, host);
                if (mmc_slot(host).card_detect_irq)
                        free_irq(mmc_slot(host).card_detect_irq, host);
-               flush_work_sync(&host->mmc_carddetect_work);
  
                pm_runtime_put_sync(host->dev);
                pm_runtime_disable(host->dev);
@@@ -2178,10 -2158,15 +2160,9 @@@ static int omap_hsmmc_suspend(struct de
                                return ret;
                        }
                }
-               cancel_work_sync(&host->mmc_carddetect_work);
                ret = mmc_suspend_host(host->mmc);
  
 -              if (ret == 0) {
 -                      omap_hsmmc_disable_irq(host);
 -                      OMAP_HSMMC_WRITE(host->base, HCTL,
 -                              OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
 -                      if (host->got_dbclk)
 -                              clk_disable(host->dbclk);
 -              } else {
 +              if (ret) {
                        host->suspended = 0;
                        if (host->pdata->resume) {
                                ret = host->pdata->resume(&pdev->dev,
                                        dev_dbg(mmc_dev(host->mmc),
                                                "Unmask interrupt failed\n");
                        }
 +                      goto err;
                }
 -              pm_runtime_put_sync(host->dev);
 +
 +              if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) {
 +                      omap_hsmmc_disable_irq(host);
 +                      OMAP_HSMMC_WRITE(host->base, HCTL,
 +                              OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
 +              }
 +              if (host->got_dbclk)
 +                      clk_disable(host->dbclk);
 +
        }
 +err:
 +      pm_runtime_put_sync(host->dev);
        return ret;
  }
  
@@@ -2223,8 -2197,7 +2204,8 @@@ static int omap_hsmmc_resume(struct dev
                if (host->got_dbclk)
                        clk_enable(host->dbclk);
  
 -              omap_hsmmc_conf_bus_power(host);
 +              if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
 +                      omap_hsmmc_conf_bus_power(host);
  
                if (host->pdata->resume) {
                        ret = host->pdata->resume(&pdev->dev, host->slot_id);
index 9a20d1f55bb7a616408f3bc5fc0f41cefec0c64f,d065e3749e560685691bdf14714a5131f98c6653..1af756ee0f9ab5e43db1a348505021a6fd5eee28
@@@ -80,7 -80,7 +80,7 @@@ static void sdhci_s3c_check_sclk(struc
  
                tmp &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK;
                tmp |= ourhost->cur_clk << S3C_SDHCI_CTRL2_SELBASECLK_SHIFT;
-               writel(tmp, host->ioaddr + 0x80);
+               writel(tmp, host->ioaddr + S3C_SDHCI_CONTROL2);
        }
  }
  
@@@ -435,11 -435,14 +435,11 @@@ static int __devinit sdhci_s3c_probe(st
  
        for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
                struct clk *clk;
 -              char *name = pdata->clocks[ptr];
 -
 -              if (name == NULL)
 -                      continue;
 +              char name[14];
  
 +              snprintf(name, 14, "mmc_busclk.%d", ptr);
                clk = clk_get(dev, name);
                if (IS_ERR(clk)) {
 -                      dev_err(dev, "failed to get clock %s\n", name);
                        continue;
                }
  
        if (pdata->host_caps)
                host->mmc->caps |= pdata->host_caps;
  
+       if (pdata->pm_caps)
+               host->mmc->pm_caps |= pdata->pm_caps;
        host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
                         SDHCI_QUIRK_32BIT_DMA_SIZE);
  
@@@ -654,18 -660,7 +657,7 @@@ static struct platform_driver sdhci_s3c
        },
  };
  
- static int __init sdhci_s3c_init(void)
- {
-       return platform_driver_register(&sdhci_s3c_driver);
- }
- static void __exit sdhci_s3c_exit(void)
- {
-       platform_driver_unregister(&sdhci_s3c_driver);
- }
- module_init(sdhci_s3c_init);
- module_exit(sdhci_s3c_exit);
+ module_platform_driver(sdhci_s3c_driver);
  
  MODULE_DESCRIPTION("Samsung SDHCI (HSMMC) glue");
  MODULE_AUTHOR("Ben Dooks, <[email protected]>");
This page took 0.105868 seconds and 4 git commands to generate.