diff options
Diffstat (limited to 'include/linux/mmc')
| -rw-r--r-- | include/linux/mmc/card.h | 2 | ||||
| -rw-r--r-- | include/linux/mmc/core.h | 1 | ||||
| -rw-r--r-- | include/linux/mmc/dw_mmc.h | 6 | ||||
| -rw-r--r-- | include/linux/mmc/host.h | 4 | ||||
| -rw-r--r-- | include/linux/mmc/mmc.h | 10 | ||||
| -rw-r--r-- | include/linux/mmc/sdhci.h | 11 | ||||
| -rw-r--r-- | include/linux/mmc/sdio_ids.h | 6 | ||||
| -rw-r--r-- | include/linux/mmc/sh_mobile_sdhi.h | 15 | ||||
| -rw-r--r-- | include/linux/mmc/slot-gpio.h | 5 |
9 files changed, 31 insertions, 29 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 4d69c00497bd..a6cf4c063e4e 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -83,7 +83,7 @@ struct mmc_ext_csd { | |||
| 83 | bool hpi; /* HPI support bit */ | 83 | bool hpi; /* HPI support bit */ |
| 84 | unsigned int hpi_cmd; /* cmd used as HPI */ | 84 | unsigned int hpi_cmd; /* cmd used as HPI */ |
| 85 | bool bkops; /* background support bit */ | 85 | bool bkops; /* background support bit */ |
| 86 | bool bkops_en; /* background enable bit */ | 86 | bool man_bkops_en; /* manual bkops enable bit */ |
| 87 | unsigned int data_sector_size; /* 512 bytes or 4KB */ | 87 | unsigned int data_sector_size; /* 512 bytes or 4KB */ |
| 88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ | 88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ |
| 89 | unsigned int boot_ro_lock; /* ro lock support */ | 89 | unsigned int boot_ro_lock; /* ro lock support */ |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index cb2b0400d284..160448f920ac 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
| @@ -182,7 +182,6 @@ extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | |||
| 182 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, | 182 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, |
| 183 | bool is_rel_write); | 183 | bool is_rel_write); |
| 184 | extern int mmc_hw_reset(struct mmc_host *host); | 184 | extern int mmc_hw_reset(struct mmc_host *host); |
| 185 | extern int mmc_hw_reset_check(struct mmc_host *host); | ||
| 186 | extern int mmc_can_reset(struct mmc_card *card); | 185 | extern int mmc_can_reset(struct mmc_card *card); |
| 187 | 186 | ||
| 188 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); | 187 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 42b724e8d503..471fb3116dbe 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -106,6 +106,11 @@ struct mmc_data; | |||
| 106 | * @cur_slot, @mrq and @state. These must always be updated | 106 | * @cur_slot, @mrq and @state. These must always be updated |
| 107 | * at the same time while holding @lock. | 107 | * at the same time while holding @lock. |
| 108 | * | 108 | * |
| 109 | * @irq_lock is an irq-safe spinlock protecting the INTMASK register | ||
| 110 | * to allow the interrupt handler to modify it directly. Held for only long | ||
| 111 | * enough to read-modify-write INTMASK and no other locks are grabbed when | ||
| 112 | * holding this one. | ||
| 113 | * | ||
| 109 | * The @mrq field of struct dw_mci_slot is also protected by @lock, | 114 | * The @mrq field of struct dw_mci_slot is also protected by @lock, |
| 110 | * and must always be written at the same time as the slot is added to | 115 | * and must always be written at the same time as the slot is added to |
| 111 | * @queue. | 116 | * @queue. |
| @@ -125,6 +130,7 @@ struct mmc_data; | |||
| 125 | */ | 130 | */ |
| 126 | struct dw_mci { | 131 | struct dw_mci { |
| 127 | spinlock_t lock; | 132 | spinlock_t lock; |
| 133 | spinlock_t irq_lock; | ||
| 128 | void __iomem *regs; | 134 | void __iomem *regs; |
| 129 | 135 | ||
| 130 | struct scatterlist *sg; | 136 | struct scatterlist *sg; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 9f322706f7cb..0c8cbe5d1550 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -166,7 +166,6 @@ struct mmc_async_req { | |||
| 166 | * struct mmc_slot - MMC slot functions | 166 | * struct mmc_slot - MMC slot functions |
| 167 | * | 167 | * |
| 168 | * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL | 168 | * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL |
| 169 | * @lock: protect the @handler_priv pointer | ||
| 170 | * @handler_priv: MMC/SD-card slot context | 169 | * @handler_priv: MMC/SD-card slot context |
| 171 | * | 170 | * |
| 172 | * Some MMC/SD host controllers implement slot-functions like card and | 171 | * Some MMC/SD host controllers implement slot-functions like card and |
| @@ -176,7 +175,6 @@ struct mmc_async_req { | |||
| 176 | */ | 175 | */ |
| 177 | struct mmc_slot { | 176 | struct mmc_slot { |
| 178 | int cd_irq; | 177 | int cd_irq; |
| 179 | struct mutex lock; | ||
| 180 | void *handler_priv; | 178 | void *handler_priv; |
| 181 | }; | 179 | }; |
| 182 | 180 | ||
| @@ -197,6 +195,7 @@ struct mmc_context_info { | |||
| 197 | }; | 195 | }; |
| 198 | 196 | ||
| 199 | struct regulator; | 197 | struct regulator; |
| 198 | struct mmc_pwrseq; | ||
| 200 | 199 | ||
| 201 | struct mmc_supply { | 200 | struct mmc_supply { |
| 202 | struct regulator *vmmc; /* Card power supply */ | 201 | struct regulator *vmmc; /* Card power supply */ |
| @@ -208,6 +207,7 @@ struct mmc_host { | |||
| 208 | struct device class_dev; | 207 | struct device class_dev; |
| 209 | int index; | 208 | int index; |
| 210 | const struct mmc_host_ops *ops; | 209 | const struct mmc_host_ops *ops; |
| 210 | struct mmc_pwrseq *pwrseq; | ||
| 211 | unsigned int f_min; | 211 | unsigned int f_min; |
| 212 | unsigned int f_max; | 212 | unsigned int f_max; |
| 213 | unsigned int f_init; | 213 | unsigned int f_init; |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 49ad7a943638..124f562118b8 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -53,11 +53,6 @@ | |||
| 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ | 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ |
| 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ | 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ |
| 55 | 55 | ||
| 56 | #define MMC_TUNING_BLK_PATTERN_4BIT_SIZE 64 | ||
| 57 | #define MMC_TUNING_BLK_PATTERN_8BIT_SIZE 128 | ||
| 58 | extern const u8 tuning_blk_pattern_4bit[MMC_TUNING_BLK_PATTERN_4BIT_SIZE]; | ||
| 59 | extern const u8 tuning_blk_pattern_8bit[MMC_TUNING_BLK_PATTERN_8BIT_SIZE]; | ||
| 60 | |||
| 61 | /* class 3 */ | 56 | /* class 3 */ |
| 62 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | 57 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
| 63 | 58 | ||
| @@ -433,6 +428,11 @@ struct _mmc_csd { | |||
| 433 | #define EXT_CSD_BKOPS_LEVEL_2 0x2 | 428 | #define EXT_CSD_BKOPS_LEVEL_2 0x2 |
| 434 | 429 | ||
| 435 | /* | 430 | /* |
| 431 | * BKOPS modes | ||
| 432 | */ | ||
| 433 | #define EXT_CSD_MANUAL_BKOPS_MASK 0x01 | ||
| 434 | |||
| 435 | /* | ||
| 436 | * MMC_SWITCH access modes | 436 | * MMC_SWITCH access modes |
| 437 | */ | 437 | */ |
| 438 | 438 | ||
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 375af80bde7d..c3e3db196738 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -17,6 +17,11 @@ | |||
| 17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
| 18 | #include <linux/mmc/host.h> | 18 | #include <linux/mmc/host.h> |
| 19 | 19 | ||
| 20 | struct sdhci_host_next { | ||
| 21 | unsigned int sg_count; | ||
| 22 | s32 cookie; | ||
| 23 | }; | ||
| 24 | |||
| 20 | struct sdhci_host { | 25 | struct sdhci_host { |
| 21 | /* Data set by hardware interface driver */ | 26 | /* Data set by hardware interface driver */ |
| 22 | const char *hw_name; /* Hardware bus name */ | 27 | const char *hw_name; /* Hardware bus name */ |
| @@ -106,6 +111,10 @@ struct sdhci_host { | |||
| 106 | #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) | 111 | #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) |
| 107 | /* Capability register bit-63 indicates HS400 support */ | 112 | /* Capability register bit-63 indicates HS400 support */ |
| 108 | #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) | 113 | #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) |
| 114 | /* forced tuned clock */ | ||
| 115 | #define SDHCI_QUIRK2_TUNING_WORK_AROUND (1<<12) | ||
| 116 | /* disable the block count for single block transactions */ | ||
| 117 | #define SDHCI_QUIRK2_SUPPORT_SINGLE (1<<13) | ||
| 109 | 118 | ||
| 110 | int irq; /* Device IRQ */ | 119 | int irq; /* Device IRQ */ |
| 111 | void __iomem *ioaddr; /* Mapped address */ | 120 | void __iomem *ioaddr; /* Mapped address */ |
| @@ -137,6 +146,7 @@ struct sdhci_host { | |||
| 137 | #define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */ | 146 | #define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */ |
| 138 | #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ | 147 | #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ |
| 139 | #define SDHCI_USE_64_BIT_DMA (1<<12) /* Use 64-bit DMA */ | 148 | #define SDHCI_USE_64_BIT_DMA (1<<12) /* Use 64-bit DMA */ |
| 149 | #define SDHCI_HS400_TUNING (1<<13) /* Tuning for HS400 */ | ||
| 140 | 150 | ||
| 141 | unsigned int version; /* SDHCI spec. version */ | 151 | unsigned int version; /* SDHCI spec. version */ |
| 142 | 152 | ||
| @@ -202,6 +212,7 @@ struct sdhci_host { | |||
| 202 | #define SDHCI_TUNING_MODE_1 0 | 212 | #define SDHCI_TUNING_MODE_1 0 |
| 203 | struct timer_list tuning_timer; /* Timer for tuning */ | 213 | struct timer_list tuning_timer; /* Timer for tuning */ |
| 204 | 214 | ||
| 215 | struct sdhci_host_next next_data; | ||
| 205 | unsigned long private[0] ____cacheline_aligned; | 216 | unsigned long private[0] ____cacheline_aligned; |
| 206 | }; | 217 | }; |
| 207 | #endif /* LINUX_MMC_SDHCI_H */ | 218 | #endif /* LINUX_MMC_SDHCI_H */ |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 0f01fe065424..996807963716 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
| @@ -24,13 +24,15 @@ | |||
| 24 | * Vendors and devices. Sort key: vendor first, device next. | 24 | * Vendors and devices. Sort key: vendor first, device next. |
| 25 | */ | 25 | */ |
| 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 | 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 |
| 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 43143 | 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 0xa887 |
| 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 | 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 |
| 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 | 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 |
| 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 | 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 |
| 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 | 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 |
| 32 | #define SDIO_DEVICE_ID_BROADCOM_43340 0xa94c | ||
| 33 | #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d | ||
| 32 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 | 34 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 |
| 33 | #define SDIO_DEVICE_ID_BROADCOM_43362 43362 | 35 | #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 |
| 34 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 | 36 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 |
| 35 | 37 | ||
| 36 | #define SDIO_VENDOR_ID_INTEL 0x0089 | 38 | #define SDIO_VENDOR_ID_INTEL 0x0089 |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index 68927ae50845..da77e5e2041d 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
| @@ -3,20 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | struct platform_device; | ||
| 7 | |||
| 8 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | 6 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" |
| 9 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | 7 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" |
| 10 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" | 8 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" |
| 11 | 9 | ||
| 12 | /** | ||
| 13 | * struct sh_mobile_sdhi_ops - SDHI driver callbacks | ||
| 14 | * @cd_wakeup: trigger a card-detection run | ||
| 15 | */ | ||
| 16 | struct sh_mobile_sdhi_ops { | ||
| 17 | void (*cd_wakeup)(const struct platform_device *pdev); | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct sh_mobile_sdhi_info { | 10 | struct sh_mobile_sdhi_info { |
| 21 | int dma_slave_tx; | 11 | int dma_slave_tx; |
| 22 | int dma_slave_rx; | 12 | int dma_slave_rx; |
| @@ -25,11 +15,6 @@ struct sh_mobile_sdhi_info { | |||
| 25 | unsigned long tmio_caps2; | 15 | unsigned long tmio_caps2; |
| 26 | u32 tmio_ocr_mask; /* available MMC voltages */ | 16 | u32 tmio_ocr_mask; /* available MMC voltages */ |
| 27 | unsigned int cd_gpio; | 17 | unsigned int cd_gpio; |
| 28 | |||
| 29 | /* callbacks for board specific setup code */ | ||
| 30 | int (*init)(struct platform_device *pdev, | ||
| 31 | const struct sh_mobile_sdhi_ops *ops); | ||
| 32 | void (*cleanup)(struct platform_device *pdev); | ||
| 33 | }; | 18 | }; |
| 34 | 19 | ||
| 35 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ | 20 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ |
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h index e56fa24c9322..3945a8c9d3cb 100644 --- a/include/linux/mmc/slot-gpio.h +++ b/include/linux/mmc/slot-gpio.h | |||
| @@ -15,12 +15,10 @@ struct mmc_host; | |||
| 15 | 15 | ||
| 16 | int mmc_gpio_get_ro(struct mmc_host *host); | 16 | int mmc_gpio_get_ro(struct mmc_host *host); |
| 17 | int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); | 17 | int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); |
| 18 | void mmc_gpio_free_ro(struct mmc_host *host); | ||
| 19 | 18 | ||
| 20 | int mmc_gpio_get_cd(struct mmc_host *host); | 19 | int mmc_gpio_get_cd(struct mmc_host *host); |
| 21 | int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, | 20 | int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, |
| 22 | unsigned int debounce); | 21 | unsigned int debounce); |
| 23 | void mmc_gpio_free_cd(struct mmc_host *host); | ||
| 24 | 22 | ||
| 25 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | 23 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, |
| 26 | unsigned int idx, bool override_active_level, | 24 | unsigned int idx, bool override_active_level, |
| @@ -28,7 +26,8 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | |||
| 28 | int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, | 26 | int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, |
| 29 | unsigned int idx, bool override_active_level, | 27 | unsigned int idx, bool override_active_level, |
| 30 | unsigned int debounce, bool *gpio_invert); | 28 | unsigned int debounce, bool *gpio_invert); |
| 31 | void mmc_gpiod_free_cd(struct mmc_host *host); | 29 | void mmc_gpio_set_cd_isr(struct mmc_host *host, |
| 30 | irqreturn_t (*isr)(int irq, void *dev_id)); | ||
| 32 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); | 31 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); |
| 33 | 32 | ||
| 34 | #endif | 33 | #endif |
