diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-11 13:56:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-11 13:56:48 -0500 |
commit | aa7ed01f93ff7e149cad46f13f66b269d59c9bc0 (patch) | |
tree | ab46a44f3c83c75e1c81f211acd0d68ffe60dd7c /include/linux/mmc | |
parent | 7796c11c728ad40ba4151d559a949c002deffb9a (diff) | |
parent | 017210d1c0dc2e2d3b142985cb31d90b98dc0f0f (diff) |
Merge tag 'mmc-v3.20-1' of git://git.linaro.org/people/ulf.hansson/mmc
Pull MMC updates from Ulf Hansson:
"MMC core:
- Support for MMC power sequences.
- SDIO function devicetree subnode parsing.
- Refactor the hardware reset routines and enable it for SD cards.
- Various code quality improvements, especially for slot-gpio.
MMC host:
- dw_mmc: Various fixes and cleanups.
- dw_mmc: Convert to mmc_send_tuning().
- moxart: Fix probe logic.
- sdhci: Various fixes and cleanups
- sdhci: Asynchronous request handling support.
- sdhci-pxav3: Various fixes and cleanups.
- sdhci-tegra: Fixes for T114, T124 and T132.
- rtsx: Various fixes and cleanups.
- rtsx: Support for SDIO.
- sdhi/tmio: Refactor and cleanup of header files.
- omap_hsmmc: Use slot-gpio and common MMC DT parser.
- Make all hosts to deal with errors from mmc_of_parse().
- sunxi: Various fixes and cleanups.
- sdhci: Support for Fujitsu SDHCI controller f_sdh30"
* tag 'mmc-v3.20-1' of git://git.linaro.org/people/ulf.hansson/mmc: (117 commits)
mmc: sdhci-s3c: solve problem with sleeping in atomic context
mmc: pwrseq: add driver for emmc hardware reset
mmc: moxart: fix probe logic
mmc: core: Invoke mmc_pwrseq_post_power_on() prior MMC_POWER_ON state
mmc: pwrseq_simple: Add optional reference clock support
mmc: pwrseq: Document optional clock for the simple power sequence
mmc: pwrseq_simple: Extend to support more pins
mmc: pwrseq: Document that simple sequence support more than one GPIO
mmc: Add hardware dependencies for sdhci-pxav3 and sdhci-pxav2
mmc: sdhci-pxav3: Modify clock settings for the SDR50 and DDR50 modes
mmc: sdhci-pxav3: Extend binding with SDIO3 conf reg for the Armada 38x
mmc: sdhci-pxav3: Fix Armada 38x controller's caps according to erratum ERR-7878951
mmc: sdhci-pxav3: Fix SDR50 and DDR50 capabilities for the Armada 38x flavor
mmc: sdhci: switch voltage before sdhci_set_ios in runtime resume
mmc: tegra: Write xfer_mode, CMD regs in together
mmc: Resolve BKOPS compatability issue
mmc: sdhci-pxav3: fix setting of pdata->clk_delay_cycles
mmc: dw_mmc: rockchip: remove incorrect __exit_p()
mmc: dw_mmc: exynos: remove incorrect __exit_p()
mmc: Fix menuconfig alignment of MMC_SDHCI_* 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 | 10 | ||||
-rw-r--r-- | include/linux/mmc/sh_mobile_sdhi.h | 15 | ||||
-rw-r--r-- | include/linux/mmc/slot-gpio.h | 5 |
8 files changed, 26 insertions, 27 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 f767a0de611f..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 */ |
@@ -203,6 +212,7 @@ struct sdhci_host { | |||
203 | #define SDHCI_TUNING_MODE_1 0 | 212 | #define SDHCI_TUNING_MODE_1 0 |
204 | struct timer_list tuning_timer; /* Timer for tuning */ | 213 | struct timer_list tuning_timer; /* Timer for tuning */ |
205 | 214 | ||
215 | struct sdhci_host_next next_data; | ||
206 | unsigned long private[0] ____cacheline_aligned; | 216 | unsigned long private[0] ____cacheline_aligned; |
207 | }; | 217 | }; |
208 | #endif /* LINUX_MMC_SDHCI_H */ | 218 | #endif /* LINUX_MMC_SDHCI_H */ |
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 |