diff options
Diffstat (limited to 'include/linux/mmc/host.h')
-rw-r--r-- | include/linux/mmc/host.h | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index bfcef8a1ad8b..b1350dfd3e91 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -10,36 +10,13 @@ | |||
10 | #ifndef LINUX_MMC_HOST_H | 10 | #ifndef LINUX_MMC_HOST_H |
11 | #define LINUX_MMC_HOST_H | 11 | #define LINUX_MMC_HOST_H |
12 | 12 | ||
13 | #include <linux/mmc/mmc.h> | 13 | #include <linux/mmc/core.h> |
14 | 14 | ||
15 | struct mmc_ios { | 15 | struct mmc_ios { |
16 | unsigned int clock; /* clock rate */ | 16 | unsigned int clock; /* clock rate */ |
17 | unsigned short vdd; | 17 | unsigned short vdd; |
18 | 18 | ||
19 | #define MMC_VDD_150 0 | 19 | /* vdd stores the bit number of the selected voltage range from below. */ |
20 | #define MMC_VDD_155 1 | ||
21 | #define MMC_VDD_160 2 | ||
22 | #define MMC_VDD_165 3 | ||
23 | #define MMC_VDD_170 4 | ||
24 | #define MMC_VDD_180 5 | ||
25 | #define MMC_VDD_190 6 | ||
26 | #define MMC_VDD_200 7 | ||
27 | #define MMC_VDD_210 8 | ||
28 | #define MMC_VDD_220 9 | ||
29 | #define MMC_VDD_230 10 | ||
30 | #define MMC_VDD_240 11 | ||
31 | #define MMC_VDD_250 12 | ||
32 | #define MMC_VDD_260 13 | ||
33 | #define MMC_VDD_270 14 | ||
34 | #define MMC_VDD_280 15 | ||
35 | #define MMC_VDD_290 16 | ||
36 | #define MMC_VDD_300 17 | ||
37 | #define MMC_VDD_310 18 | ||
38 | #define MMC_VDD_320 19 | ||
39 | #define MMC_VDD_330 20 | ||
40 | #define MMC_VDD_340 21 | ||
41 | #define MMC_VDD_350 22 | ||
42 | #define MMC_VDD_360 23 | ||
43 | 20 | ||
44 | unsigned char bus_mode; /* command output mode */ | 21 | unsigned char bus_mode; /* command output mode */ |
45 | 22 | ||
@@ -88,6 +65,24 @@ struct mmc_host { | |||
88 | unsigned int f_max; | 65 | unsigned int f_max; |
89 | u32 ocr_avail; | 66 | u32 ocr_avail; |
90 | 67 | ||
68 | #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ | ||
69 | #define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ | ||
70 | #define MMC_VDD_21_22 0x00000200 /* VDD voltage 2.1 ~ 2.2 */ | ||
71 | #define MMC_VDD_22_23 0x00000400 /* VDD voltage 2.2 ~ 2.3 */ | ||
72 | #define MMC_VDD_23_24 0x00000800 /* VDD voltage 2.3 ~ 2.4 */ | ||
73 | #define MMC_VDD_24_25 0x00001000 /* VDD voltage 2.4 ~ 2.5 */ | ||
74 | #define MMC_VDD_25_26 0x00002000 /* VDD voltage 2.5 ~ 2.6 */ | ||
75 | #define MMC_VDD_26_27 0x00004000 /* VDD voltage 2.6 ~ 2.7 */ | ||
76 | #define MMC_VDD_27_28 0x00008000 /* VDD voltage 2.7 ~ 2.8 */ | ||
77 | #define MMC_VDD_28_29 0x00010000 /* VDD voltage 2.8 ~ 2.9 */ | ||
78 | #define MMC_VDD_29_30 0x00020000 /* VDD voltage 2.9 ~ 3.0 */ | ||
79 | #define MMC_VDD_30_31 0x00040000 /* VDD voltage 3.0 ~ 3.1 */ | ||
80 | #define MMC_VDD_31_32 0x00080000 /* VDD voltage 3.1 ~ 3.2 */ | ||
81 | #define MMC_VDD_32_33 0x00100000 /* VDD voltage 3.2 ~ 3.3 */ | ||
82 | #define MMC_VDD_33_34 0x00200000 /* VDD voltage 3.3 ~ 3.4 */ | ||
83 | #define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */ | ||
84 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ | ||
85 | |||
91 | unsigned long caps; /* Host capabilities */ | 86 | unsigned long caps; /* Host capabilities */ |
92 | 87 | ||
93 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 88 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
@@ -106,6 +101,8 @@ struct mmc_host { | |||
106 | unsigned int max_blk_count; /* maximum number of blocks in one req */ | 101 | unsigned int max_blk_count; /* maximum number of blocks in one req */ |
107 | 102 | ||
108 | /* private data */ | 103 | /* private data */ |
104 | spinlock_t lock; /* lock for claim and bus ops */ | ||
105 | |||
109 | struct mmc_ios ios; /* current io bus settings */ | 106 | struct mmc_ios ios; /* current io bus settings */ |
110 | u32 ocr; /* the current OCR setting */ | 107 | u32 ocr; /* the current OCR setting */ |
111 | 108 | ||
@@ -113,15 +110,19 @@ struct mmc_host { | |||
113 | #define MMC_MODE_MMC 0 | 110 | #define MMC_MODE_MMC 0 |
114 | #define MMC_MODE_SD 1 | 111 | #define MMC_MODE_SD 1 |
115 | 112 | ||
116 | struct list_head cards; /* devices attached to this host */ | 113 | struct mmc_card *card; /* device attached to this host */ |
117 | 114 | ||
118 | wait_queue_head_t wq; | 115 | wait_queue_head_t wq; |
119 | spinlock_t lock; /* claimed lock */ | ||
120 | unsigned int claimed:1; /* host exclusively claimed */ | 116 | unsigned int claimed:1; /* host exclusively claimed */ |
121 | 117 | ||
122 | struct mmc_card *card_selected; /* the selected MMC card */ | ||
123 | |||
124 | struct delayed_work detect; | 118 | struct delayed_work detect; |
119 | #ifdef CONFIG_MMC_DEBUG | ||
120 | unsigned int removed:1; /* host is being removed */ | ||
121 | #endif | ||
122 | |||
123 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ | ||
124 | unsigned int bus_refs; /* reference counter */ | ||
125 | unsigned int bus_dead:1; /* bus has been released */ | ||
125 | 126 | ||
126 | unsigned long private[0] ____cacheline_aligned; | 127 | unsigned long private[0] ____cacheline_aligned; |
127 | }; | 128 | }; |