diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 19:55:55 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 19:55:55 -0400 |
| commit | 8c1c77ff9be27137fa7cbbf51efedef1a2ae915b (patch) | |
| tree | cdbd09cac5f5d1c6eb5ec4257dc478c6acca70c5 /include/linux | |
| parent | f3ae1c75203535f65448517e46c8dd70a56b6c71 (diff) | |
| parent | 08ee80cc397ac1a306ca689a22ede954d92d0db1 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (75 commits)
mmc: core: eMMC bus width may not work on all platforms
mmc: sdhci: Auto-CMD23 fixes.
mmc: sdhci: Auto-CMD23 support.
mmc: core: Block CMD23 support for UHS104/SDXC cards.
mmc: sdhci: Implement MMC_CAP_CMD23 for SDHCI.
mmc: core: Use CMD23 for multiblock transfers when we can.
mmc: quirks: Add/remove quirks conditional support.
mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver
mmc: sdhci-pxa: Add quirks for DMA/ADMA to match h/w
mmc: core: duplicated trial with same freq in mmc_rescan_try_freq()
mmc: core: add support for eMMC Dual Data Rate
mmc: core: eMMC signal voltage does not use CMD11
mmc: sdhci-pxa: add platform code for UHS signaling
mmc: sdhci: add hooks for setting UHS in platform specific code
mmc: core: clear MMC_PM_KEEP_POWER flag on resume
mmc: dw_mmc: fixed wrong regulator_enable in suspend/resume
mmc: sdhi: allow powering down controller with no card inserted
mmc: tmio: runtime suspend the controller, where possible
mmc: sdhi: support up to 3 interrupt sources
mmc: sdhi: print physical base address and clock rate
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/Kbuild | 1 | ||||
| -rw-r--r-- | include/linux/mfd/tmio.h | 17 | ||||
| -rw-r--r-- | include/linux/mmc/Kbuild | 1 | ||||
| -rw-r--r-- | include/linux/mmc/card.h | 189 | ||||
| -rw-r--r-- | include/linux/mmc/core.h | 5 | ||||
| -rw-r--r-- | include/linux/mmc/host.h | 49 | ||||
| -rw-r--r-- | include/linux/mmc/ioctl.h | 54 | ||||
| -rw-r--r-- | include/linux/mmc/mmc.h | 18 | ||||
| -rw-r--r-- | include/linux/mmc/sd.h | 9 | ||||
| -rw-r--r-- | include/linux/mmc/sdhci.h | 15 | ||||
| -rw-r--r-- | include/linux/mmc/sh_mobile_sdhi.h | 4 |
11 files changed, 358 insertions, 4 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index ccfedb4f3eb..01f63627505 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -4,6 +4,7 @@ header-y += caif/ | |||
| 4 | header-y += dvb/ | 4 | header-y += dvb/ |
| 5 | header-y += hdlc/ | 5 | header-y += hdlc/ |
| 6 | header-y += isdn/ | 6 | header-y += isdn/ |
| 7 | header-y += mmc/ | ||
| 7 | header-y += nfsd/ | 8 | header-y += nfsd/ |
| 8 | header-y += raid/ | 9 | header-y += raid/ |
| 9 | header-y += spi/ | 10 | header-y += spi/ |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 8e70310ee94..5a90266c3a5 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
| 5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
| 6 | #include <linux/platform_device.h> | 6 | #include <linux/platform_device.h> |
| 7 | #include <linux/pm_runtime.h> | ||
| 7 | 8 | ||
| 8 | #define tmio_ioread8(addr) readb(addr) | 9 | #define tmio_ioread8(addr) readb(addr) |
| 9 | #define tmio_ioread16(addr) readw(addr) | 10 | #define tmio_ioread16(addr) readw(addr) |
| @@ -61,6 +62,12 @@ | |||
| 61 | * Some controllers can support SDIO IRQ signalling. | 62 | * Some controllers can support SDIO IRQ signalling. |
| 62 | */ | 63 | */ |
| 63 | #define TMIO_MMC_SDIO_IRQ (1 << 2) | 64 | #define TMIO_MMC_SDIO_IRQ (1 << 2) |
| 65 | /* | ||
| 66 | * Some platforms can detect card insertion events with controller powered | ||
| 67 | * down, in which case they have to call tmio_mmc_cd_wakeup() to power up the | ||
| 68 | * controller and report the event to the driver. | ||
| 69 | */ | ||
| 70 | #define TMIO_MMC_HAS_COLD_CD (1 << 3) | ||
| 64 | 71 | ||
| 65 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | 72 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); |
| 66 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | 73 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); |
| @@ -82,11 +89,21 @@ struct tmio_mmc_data { | |||
| 82 | unsigned long flags; | 89 | unsigned long flags; |
| 83 | u32 ocr_mask; /* available voltages */ | 90 | u32 ocr_mask; /* available voltages */ |
| 84 | struct tmio_mmc_dma *dma; | 91 | struct tmio_mmc_dma *dma; |
| 92 | struct device *dev; | ||
| 93 | bool power; | ||
| 85 | void (*set_pwr)(struct platform_device *host, int state); | 94 | void (*set_pwr)(struct platform_device *host, int state); |
| 86 | void (*set_clk_div)(struct platform_device *host, int state); | 95 | void (*set_clk_div)(struct platform_device *host, int state); |
| 87 | int (*get_cd)(struct platform_device *host); | 96 | int (*get_cd)(struct platform_device *host); |
| 88 | }; | 97 | }; |
| 89 | 98 | ||
| 99 | static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) | ||
| 100 | { | ||
| 101 | if (pdata && !pdata->power) { | ||
| 102 | pdata->power = true; | ||
| 103 | pm_runtime_get(pdata->dev); | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 90 | /* | 107 | /* |
| 91 | * data for the NAND controller | 108 | * data for the NAND controller |
| 92 | */ | 109 | */ |
diff --git a/include/linux/mmc/Kbuild b/include/linux/mmc/Kbuild new file mode 100644 index 00000000000..1fb26448faa --- /dev/null +++ b/include/linux/mmc/Kbuild | |||
| @@ -0,0 +1 @@ | |||
| header-y += ioctl.h | |||
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index adb4888248b..c6927a4d157 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define LINUX_MMC_CARD_H | 11 | #define LINUX_MMC_CARD_H |
| 12 | 12 | ||
| 13 | #include <linux/mmc/core.h> | 13 | #include <linux/mmc/core.h> |
| 14 | #include <linux/mod_devicetable.h> | ||
| 14 | 15 | ||
| 15 | struct mmc_cid { | 16 | struct mmc_cid { |
| 16 | unsigned int manfid; | 17 | unsigned int manfid; |
| @@ -29,6 +30,7 @@ struct mmc_csd { | |||
| 29 | unsigned short cmdclass; | 30 | unsigned short cmdclass; |
| 30 | unsigned short tacc_clks; | 31 | unsigned short tacc_clks; |
| 31 | unsigned int tacc_ns; | 32 | unsigned int tacc_ns; |
| 33 | unsigned int c_size; | ||
| 32 | unsigned int r2w_factor; | 34 | unsigned int r2w_factor; |
| 33 | unsigned int max_dtr; | 35 | unsigned int max_dtr; |
| 34 | unsigned int erase_size; /* In sectors */ | 36 | unsigned int erase_size; /* In sectors */ |
| @@ -45,6 +47,10 @@ struct mmc_ext_csd { | |||
| 45 | u8 rev; | 47 | u8 rev; |
| 46 | u8 erase_group_def; | 48 | u8 erase_group_def; |
| 47 | u8 sec_feature_support; | 49 | u8 sec_feature_support; |
| 50 | u8 rel_sectors; | ||
| 51 | u8 rel_param; | ||
| 52 | u8 part_config; | ||
| 53 | unsigned int part_time; /* Units: ms */ | ||
| 48 | unsigned int sa_timeout; /* Units: 100ns */ | 54 | unsigned int sa_timeout; /* Units: 100ns */ |
| 49 | unsigned int hs_max_dtr; | 55 | unsigned int hs_max_dtr; |
| 50 | unsigned int sectors; | 56 | unsigned int sectors; |
| @@ -57,13 +63,18 @@ struct mmc_ext_csd { | |||
| 57 | bool enhanced_area_en; /* enable bit */ | 63 | bool enhanced_area_en; /* enable bit */ |
| 58 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 64 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
| 59 | unsigned int enhanced_area_size; /* Units: KB */ | 65 | unsigned int enhanced_area_size; /* Units: KB */ |
| 66 | unsigned int boot_size; /* in bytes */ | ||
| 60 | }; | 67 | }; |
| 61 | 68 | ||
| 62 | struct sd_scr { | 69 | struct sd_scr { |
| 63 | unsigned char sda_vsn; | 70 | unsigned char sda_vsn; |
| 71 | unsigned char sda_spec3; | ||
| 64 | unsigned char bus_widths; | 72 | unsigned char bus_widths; |
| 65 | #define SD_SCR_BUS_WIDTH_1 (1<<0) | 73 | #define SD_SCR_BUS_WIDTH_1 (1<<0) |
| 66 | #define SD_SCR_BUS_WIDTH_4 (1<<2) | 74 | #define SD_SCR_BUS_WIDTH_4 (1<<2) |
| 75 | unsigned char cmds; | ||
| 76 | #define SD_SCR_CMD20_SUPPORT (1<<0) | ||
| 77 | #define SD_SCR_CMD23_SUPPORT (1<<1) | ||
| 67 | }; | 78 | }; |
| 68 | 79 | ||
| 69 | struct sd_ssr { | 80 | struct sd_ssr { |
| @@ -74,6 +85,39 @@ struct sd_ssr { | |||
| 74 | 85 | ||
| 75 | struct sd_switch_caps { | 86 | struct sd_switch_caps { |
| 76 | unsigned int hs_max_dtr; | 87 | unsigned int hs_max_dtr; |
| 88 | unsigned int uhs_max_dtr; | ||
| 89 | #define UHS_SDR104_MAX_DTR 208000000 | ||
| 90 | #define UHS_SDR50_MAX_DTR 100000000 | ||
| 91 | #define UHS_DDR50_MAX_DTR 50000000 | ||
| 92 | #define UHS_SDR25_MAX_DTR UHS_DDR50_MAX_DTR | ||
| 93 | #define UHS_SDR12_MAX_DTR 25000000 | ||
| 94 | unsigned int sd3_bus_mode; | ||
| 95 | #define UHS_SDR12_BUS_SPEED 0 | ||
| 96 | #define UHS_SDR25_BUS_SPEED 1 | ||
| 97 | #define UHS_SDR50_BUS_SPEED 2 | ||
| 98 | #define UHS_SDR104_BUS_SPEED 3 | ||
| 99 | #define UHS_DDR50_BUS_SPEED 4 | ||
| 100 | |||
| 101 | #define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED) | ||
| 102 | #define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED) | ||
| 103 | #define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED) | ||
| 104 | #define SD_MODE_UHS_SDR104 (1 << UHS_SDR104_BUS_SPEED) | ||
| 105 | #define SD_MODE_UHS_DDR50 (1 << UHS_DDR50_BUS_SPEED) | ||
| 106 | unsigned int sd3_drv_type; | ||
| 107 | #define SD_DRIVER_TYPE_B 0x01 | ||
| 108 | #define SD_DRIVER_TYPE_A 0x02 | ||
| 109 | #define SD_DRIVER_TYPE_C 0x04 | ||
| 110 | #define SD_DRIVER_TYPE_D 0x08 | ||
| 111 | unsigned int sd3_curr_limit; | ||
| 112 | #define SD_SET_CURRENT_LIMIT_200 0 | ||
| 113 | #define SD_SET_CURRENT_LIMIT_400 1 | ||
| 114 | #define SD_SET_CURRENT_LIMIT_600 2 | ||
| 115 | #define SD_SET_CURRENT_LIMIT_800 3 | ||
| 116 | |||
| 117 | #define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) | ||
| 118 | #define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400) | ||
| 119 | #define SD_MAX_CURRENT_600 (1 << SD_SET_CURRENT_LIMIT_600) | ||
| 120 | #define SD_MAX_CURRENT_800 (1 << SD_SET_CURRENT_LIMIT_800) | ||
| 77 | }; | 121 | }; |
| 78 | 122 | ||
| 79 | struct sdio_cccr { | 123 | struct sdio_cccr { |
| @@ -118,6 +162,8 @@ struct mmc_card { | |||
| 118 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 162 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
| 119 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 163 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
| 120 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ | 164 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ |
| 165 | #define MMC_STATE_ULTRAHIGHSPEED (1<<5) /* card is in ultra high speed mode */ | ||
| 166 | #define MMC_CARD_SDXC (1<<6) /* card is SDXC */ | ||
| 121 | unsigned int quirks; /* card quirks */ | 167 | unsigned int quirks; /* card quirks */ |
| 122 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | ||
