diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mfd/tmio.h | 4 | ||||
| -rw-r--r-- | include/linux/mmc/card.h | 1 | ||||
| -rw-r--r-- | include/linux/mmc/cd-gpio.h | 18 | ||||
| -rw-r--r-- | include/linux/mmc/host.h | 48 | ||||
| -rw-r--r-- | include/linux/mmc/sdhci.h | 4 | ||||
| -rw-r--r-- | include/linux/mmc/sh_mmcif.h | 2 | ||||
| -rw-r--r-- | include/linux/mmc/sh_mobile_sdhi.h | 1 | ||||
| -rw-r--r-- | include/linux/mmc/slot-gpio.h | 24 |
8 files changed, 71 insertions, 31 deletions
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index f5171dbf8850..d83af39815ab 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -101,6 +101,7 @@ struct tmio_mmc_host; | |||
| 101 | struct tmio_mmc_data { | 101 | struct tmio_mmc_data { |
| 102 | unsigned int hclk; | 102 | unsigned int hclk; |
| 103 | unsigned long capabilities; | 103 | unsigned long capabilities; |
| 104 | unsigned long capabilities2; | ||
| 104 | unsigned long flags; | 105 | unsigned long flags; |
| 105 | u32 ocr_mask; /* available voltages */ | 106 | u32 ocr_mask; /* available voltages */ |
| 106 | struct tmio_mmc_dma *dma; | 107 | struct tmio_mmc_dma *dma; |
| @@ -110,6 +111,9 @@ struct tmio_mmc_data { | |||
| 110 | void (*set_clk_div)(struct platform_device *host, int state); | 111 | void (*set_clk_div)(struct platform_device *host, int state); |
| 111 | int (*get_cd)(struct platform_device *host); | 112 | int (*get_cd)(struct platform_device *host); |
| 112 | int (*write16_hook)(struct tmio_mmc_host *host, int addr); | 113 | int (*write16_hook)(struct tmio_mmc_host *host, int addr); |
| 114 | /* clock management callbacks */ | ||
| 115 | int (*clk_enable)(struct platform_device *pdev, unsigned int *f); | ||
| 116 | void (*clk_disable)(struct platform_device *pdev); | ||
| 113 | }; | 117 | }; |
| 114 | 118 | ||
| 115 | /* | 119 | /* |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index d76513b5b263..111aca5e97f3 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -149,6 +149,7 @@ struct sd_switch_caps { | |||
| 149 | #define SD_SET_CURRENT_LIMIT_400 1 | 149 | #define SD_SET_CURRENT_LIMIT_400 1 |
| 150 | #define SD_SET_CURRENT_LIMIT_600 2 | 150 | #define SD_SET_CURRENT_LIMIT_600 2 |
| 151 | #define SD_SET_CURRENT_LIMIT_800 3 | 151 | #define SD_SET_CURRENT_LIMIT_800 3 |
| 152 | #define SD_SET_CURRENT_NO_CHANGE (-1) | ||
| 152 | 153 | ||
| 153 | #define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) | 154 | #define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) |
| 154 | #define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400) | 155 | #define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400) |
diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h deleted file mode 100644 index cefaba038ccb..000000000000 --- a/include/linux/mmc/cd-gpio.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Generic GPIO card-detect helper header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef MMC_CD_GPIO_H | ||
| 12 | #define MMC_CD_GPIO_H | ||
| 13 | |||
| 14 | struct mmc_host; | ||
| 15 | int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio); | ||
| 16 | void mmc_cd_gpio_free(struct mmc_host *host); | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 0707d228d7f1..f578a71d82a6 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define LINUX_MMC_HOST_H | 11 | #define LINUX_MMC_HOST_H |
| 12 | 12 | ||
| 13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
| 14 | #include <linux/mutex.h> | ||
| 14 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 15 | #include <linux/device.h> | 16 | #include <linux/device.h> |
| 16 | #include <linux/fault-inject.h> | 17 | #include <linux/fault-inject.h> |
| @@ -150,11 +151,31 @@ struct mmc_async_req { | |||
| 150 | int (*err_check) (struct mmc_card *, struct mmc_async_req *); | 151 | int (*err_check) (struct mmc_card *, struct mmc_async_req *); |
| 151 | }; | 152 | }; |
| 152 | 153 | ||
| 153 | struct mmc_hotplug { | 154 | /** |
| 154 | unsigned int irq; | 155 | * struct mmc_slot - MMC slot functions |
| 156 | * | ||
| 157 | * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL | ||
| 158 | * @lock: protect the @handler_priv pointer | ||
| 159 | * @handler_priv: MMC/SD-card slot context | ||
| 160 | * | ||
| 161 | * Some MMC/SD host controllers implement slot-functions like card and | ||
| 162 | * write-protect detection natively. However, a large number of controllers | ||
| 163 | * leave these functions to the CPU. This struct provides a hook to attach | ||
| 164 | * such slot-function drivers. | ||
| 165 | */ | ||
| 166 | struct mmc_slot { | ||
| 167 | int cd_irq; | ||
| 168 | struct mutex lock; | ||
| 155 | void *handler_priv; | 169 | void *handler_priv; |
| 156 | }; | 170 | }; |
| 157 | 171 | ||
| 172 | struct regulator; | ||
| 173 | |||
| 174 | struct mmc_supply { | ||
| 175 | struct regulator *vmmc; /* Card power supply */ | ||
| 176 | struct regulator *vqmmc; /* Optional Vccq supply */ | ||
| 177 | }; | ||
| 178 | |||
| 158 | struct mmc_host { | 179 | struct mmc_host { |
| 159 | struct device *parent; | 180 | struct device *parent; |
| 160 | struct device class_dev; | 181 | struct device class_dev; |
| @@ -168,6 +189,9 @@ struct mmc_host { | |||
| 168 | u32 ocr_avail_sd; /* SD-specific OCR */ | 189 | u32 ocr_avail_sd; /* SD-specific OCR */ |
| 169 | u32 ocr_avail_mmc; /* MMC-specific OCR */ | 190 | u32 ocr_avail_mmc; /* MMC-specific OCR */ |
| 170 | struct notifier_block pm_notify; | 191 | struct notifier_block pm_notify; |
| 192 | u32 max_current_330; | ||
| 193 | u32 max_current_300; | ||
| 194 | u32 max_current_180; | ||
| 171 | 195 | ||
| 172 | #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ | 196 | #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ |
| 173 | #define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ | 197 | #define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ |
| @@ -211,16 +235,9 @@ struct mmc_host { | |||
| 211 | #define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ | 235 | #define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ |
| 212 | #define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ | 236 | #define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ |
| 213 | #define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ | 237 | #define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ |
| 214 | #define MMC_CAP_SET_XPC_330 (1 << 20) /* Host supports >150mA current at 3.3V */ | ||
| 215 | #define MMC_CAP_SET_XPC_300 (1 << 21) /* Host supports >150mA current at 3.0V */ | ||
| 216 | #define MMC_CAP_SET_XPC_180 (1 << 22) /* Host supports >150mA current at 1.8V */ | ||
| 217 | #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ | 238 | #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ |
| 218 | #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ | 239 | #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ |
| 219 | #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ | 240 | #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ |
| 220 | #define MMC_CAP_MAX_CURRENT_200 (1 << 26) /* Host max current limit is 200mA */ | ||
| 221 | #define MMC_CAP_MAX_CURRENT_400 (1 << 27) /* Host max current limit is 400mA */ | ||
| 222 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ | ||
| 223 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ | ||
| 224 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ | 241 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ |
| 225 | #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ | 242 | #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ |
| 226 | 243 | ||
| @@ -238,6 +255,8 @@ struct mmc_host { | |||
| 238 | #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ | 255 | #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ |
| 239 | #define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ | 256 | #define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ |
| 240 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ | 257 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ |
| 258 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ | ||
| 259 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ | ||
| 241 | 260 | ||
| 242 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 261 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
| 243 | unsigned int power_notify_type; | 262 | unsigned int power_notify_type; |
| @@ -290,7 +309,7 @@ struct mmc_host { | |||
| 290 | 309 | ||
| 291 | struct delayed_work detect; | 310 | struct delayed_work detect; |
| 292 | int detect_change; /* card detect flag */ | 311 | int detect_change; /* card detect flag */ |
| 293 | struct mmc_hotplug hotplug; | 312 | struct mmc_slot slot; |
| 294 | 313 | ||
| 295 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ | 314 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ |
| 296 | unsigned int bus_refs; /* reference counter */ | 315 | unsigned int bus_refs; /* reference counter */ |
| @@ -309,6 +328,7 @@ struct mmc_host { | |||
| 309 | #ifdef CONFIG_REGULATOR | 328 | #ifdef CONFIG_REGULATOR |
| 310 | bool regulator_enabled; /* regulator state */ | 329 | bool regulator_enabled; /* regulator state */ |
| 311 | #endif | 330 | #endif |
| 331 | struct mmc_supply supply; | ||
| 312 | 332 | ||
| 313 | struct dentry *debugfs_root; | 333 | struct dentry *debugfs_root; |
| 314 | 334 | ||
| @@ -357,13 +377,12 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host) | |||
| 357 | wake_up_process(host->sdio_irq_thread); | 377 | wake_up_process(host->sdio_irq_thread); |
| 358 | } | 378 | } |
| 359 | 379 | ||
| 360 | struct regulator; | ||
| 361 | |||
| 362 | #ifdef CONFIG_REGULATOR | 380 | #ifdef CONFIG_REGULATOR |
| 363 | int mmc_regulator_get_ocrmask(struct regulator *supply); | 381 | int mmc_regulator_get_ocrmask(struct regulator *supply); |
| 364 | int mmc_regulator_set_ocr(struct mmc_host *mmc, | 382 | int mmc_regulator_set_ocr(struct mmc_host *mmc, |
| 365 | struct regulator *supply, | 383 | struct regulator *supply, |
| 366 | unsigned short vdd_bit); | 384 | unsigned short vdd_bit); |
| 385 | int mmc_regulator_get_supply(struct mmc_host *mmc); | ||
| 367 | #else | 386 | #else |
| 368 | static inline int mmc_regulator_get_ocrmask(struct regulator *supply) | 387 | static inline int mmc_regulator_get_ocrmask(struct regulator *supply) |
| 369 | { | 388 | { |
| @@ -376,6 +395,11 @@ static inline int mmc_regulator_set_ocr(struct mmc_host *mmc, | |||
| 376 | { | 395 | { |
| 377 | return 0; | 396 | return 0; |
| 378 | } | 397 | } |
| 398 | |||
| 399 | static inline int mmc_regulator_get_supply(struct mmc_host *mmc) | ||
| 400 | { | ||
| 401 | return 0; | ||
| 402 | } | ||
| 379 | #endif | 403 | #endif |
| 380 | 404 | ||
| 381 | int mmc_card_awake(struct mmc_host *host); | 405 | int mmc_card_awake(struct mmc_host *host); |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index e9051e1cb1ce..ac83b105bedd 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -122,6 +122,7 @@ struct sdhci_host { | |||
| 122 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ | 122 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ |
| 123 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ | 123 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ |
| 124 | #define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ | 124 | #define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ |
| 125 | #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ | ||
| 125 | 126 | ||
| 126 | unsigned int version; /* SDHCI spec. version */ | 127 | unsigned int version; /* SDHCI spec. version */ |
| 127 | 128 | ||
| @@ -155,7 +156,8 @@ struct sdhci_host { | |||
| 155 | 156 | ||
| 156 | struct timer_list timer; /* Timer for timeouts */ | 157 | struct timer_list timer; /* Timer for timeouts */ |
| 157 | 158 | ||
| 158 | unsigned int caps; /* Alternative capabilities */ | 159 | unsigned int caps; /* Alternative CAPABILITY_0 */ |
| 160 | unsigned int caps1; /* Alternative CAPABILITY_1 */ | ||
| 159 | 161 | ||
| 160 | unsigned int ocr_avail_sdio; /* OCR bit masks */ | 162 | unsigned int ocr_avail_sdio; /* OCR bit masks */ |
| 161 | unsigned int ocr_avail_sd; | 163 | unsigned int ocr_avail_sd; |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 05f0e3db1c12..c2f73cbb4d5c 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
| @@ -44,6 +44,8 @@ struct sh_mmcif_plat_data { | |||
| 44 | struct sh_mmcif_dma *dma; /* Deprecated. Instead */ | 44 | struct sh_mmcif_dma *dma; /* Deprecated. Instead */ |
| 45 | unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */ | 45 | unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */ |
| 46 | unsigned int slave_id_rx; | 46 | unsigned int slave_id_rx; |
| 47 | bool use_cd_gpio : 1; | ||
| 48 | unsigned int cd_gpio; | ||
| 47 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ | 49 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ |
| 48 | unsigned long caps; | 50 | unsigned long caps; |
| 49 | u32 ocr; | 51 | u32 ocr; |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index e94e620aeddc..b65679ffa880 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
| @@ -23,6 +23,7 @@ struct sh_mobile_sdhi_info { | |||
| 23 | int dma_slave_rx; | 23 | int dma_slave_rx; |
| 24 | unsigned long tmio_flags; | 24 | unsigned long tmio_flags; |
| 25 | unsigned long tmio_caps; | 25 | unsigned long tmio_caps; |
| 26 | unsigned long tmio_caps2; | ||
| 26 | u32 tmio_ocr_mask; /* available MMC voltages */ | 27 | u32 tmio_ocr_mask; /* available MMC voltages */ |
| 27 | unsigned int cd_gpio; | 28 | unsigned int cd_gpio; |
| 28 | struct tmio_mmc_data *pdata; | 29 | struct tmio_mmc_data *pdata; |
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h new file mode 100644 index 000000000000..7d88d27bfafa --- /dev/null +++ b/include/linux/mmc/slot-gpio.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Generic GPIO card-detect helper header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef MMC_SLOT_GPIO_H | ||
| 12 | #define MMC_SLOT_GPIO_H | ||
| 13 | |||
| 14 | struct mmc_host; | ||
| 15 | |||
| 16 | int mmc_gpio_get_ro(struct mmc_host *host); | ||
| 17 | int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); | ||
| 18 | void mmc_gpio_free_ro(struct mmc_host *host); | ||
| 19 | |||
| 20 | int mmc_gpio_get_cd(struct mmc_host *host); | ||
| 21 | int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio); | ||
| 22 | void mmc_gpio_free_cd(struct mmc_host *host); | ||
| 23 | |||
| 24 | #endif | ||
