aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-05-27 08:22:37 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-09-23 14:10:56 -0400
commitfa64efa1f2a0672767ad0753a6e4bfa4bcc77b87 (patch)
tree9d85f00c23c5e7c922becb639d3dfec9d08f4e89 /include
parent46f555f2731a14545a09ec06d27bd18e8e07069f (diff)
mmc: enable/disable functions for SDIO
Like many other buses, the devices (functions) on the SDIO bus must be enabled before they can be used. Add functions that allow drivers to do so. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/sdio.h92
-rw-r--r--include/linux/mmc/sdio_func.h3
2 files changed, 95 insertions, 0 deletions
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index e5f06de7d527..56239f4aab04 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -49,5 +49,97 @@
49#define R5_STATUS(x) (x & 0xCB00) 49#define R5_STATUS(x) (x & 0xCB00)
50#define R5_IO_CURRENT_STATE(x) ((x & 0x3000) >> 12) /* s, b */ 50#define R5_IO_CURRENT_STATE(x) ((x & 0x3000) >> 12) /* s, b */
51 51
52/*
53 * Card Common Control Registers (CCCR)
54 */
55
56#define SDIO_CCCR_CCCR 0x00
57
58#define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */
59#define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */
60#define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */
61
62#define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */
63#define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */
64#define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */
65#define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */
66
67#define SDIO_CCCR_SD 0x01
68
69#define SDIO_SD_REV_1_01 0 /* SD Physical Spec Version 1.01 */
70#define SDIO_SD_REV_1_10 1 /* SD Physical Spec Version 1.10 */
71#define SDIO_SD_REV_2_00 2 /* SD Physical Spec Version 2.00 */
72
73#define SDIO_CCCR_IOEx 0x02
74#define SDIO_CCCR_IORx 0x03
75
76#define SDIO_CCCR_IENx 0x04 /* Function/Master Interrupt Enable */
77#define SDIO_CCCR_INTx 0x05 /* Function Interrupt Pending */
78
79#define SDIO_CCCR_ABORT 0x06 /* function abort/card reset */
80
81#define SDIO_CCCR_IF 0x07 /* bus interface controls */
82
83#define SDIO_BUS_WIDTH_1BIT 0x00
84#define SDIO_BUS_WIDTH_4BIT 0x02
85
86#define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */
87
88#define SDIO_CCCR_CAPS 0x08
89
90#define SDIO_CCCR_CAP_SDC 0x01 /* can do CMD52 while data transfer */
91#define SDIO_CCCR_CAP_SMB 0x02 /* can do multi-block xfers (CMD53) */
92#define SDIO_CCCR_CAP_SRW 0x04 /* supports read-wait protocol */
93#define SDIO_CCCR_CAP_SBS 0x08 /* supports suspend/resume */
94#define SDIO_CCCR_CAP_S4MI 0x10 /* interrupt during 4-bit CMD53 */
95#define SDIO_CCCR_CAP_E4MI 0x20 /* enable ints during 4-bit CMD53 */
96#define SDIO_CCCR_CAP_LSC 0x40 /* low speed card */
97#define SDIO_CCCR_CAP_4BLS 0x80 /* 4 bit low speed card */
98
99#define SDIO_CCCR_CIS 0x09 /* common CIS pointer (3 bytes) */
100
101/* Following 4 regs are valid only if SBS is set */
102#define SDIO_CCCR_SUSPEND 0x0c
103#define SDIO_CCCR_SELx 0x0d
104#define SDIO_CCCR_EXECx 0x0e
105#define SDIO_CCCR_READYx 0x0f
106
107#define SDIO_CCCR_BLKSIZE 0x10
108
109#define SDIO_CCCR_POWER 0x12
110
111#define SDIO_POWER_SMPC 0x01 /* Supports Master Power Control */
112#define SDIO_POWER_EMPC 0x02 /* Enable Master Power Control */
113
114#define SDIO_CCCR_SPEED 0x13
115
116#define SDIO_SPEED_SHS 0x01 /* Supports High-Speed mode */
117#define SDIO_SPEED_EHS 0x02 /* Enable High-Speed mode */
118
119/*
120 * Function Basic Registers (FBR)
121 */
122
123#define SDIO_FBR_STD_IF 0x00
124
125#define SDIO_FBR_SUPPORTS_CSA 0x40 /* supports Code Storage Area */
126#define SDIO_FBR_ENABLE_CSA 0x80 /* enable Code Storage Area */
127
128#define SDIO_FBR_STD_IF_EXT 0x01
129
130#define SDIO_FBR_POWER 0x02
131
132#define SDIO_FBR_POWER_SPS 0x01 /* Supports Power Selection */
133#define SDIO_FBR_POWER_EPS 0x02 /* Enable (low) Power Selection */
134
135#define SDIO_FBR_CIS 0x09 /* CIS pointer (3 bytes) */
136
137
138#define SDIO_FBR_CSA 0x0C /* CSA pointer (3 bytes) */
139
140#define SDIO_FBR_CSA_DATA 0x0F
141
142#define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */
143
52#endif 144#endif
53 145
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 5c56df196287..3365fef5f713 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -55,6 +55,9 @@ extern void sdio_unregister_driver(struct sdio_driver *);
55extern void sdio_claim_host(struct sdio_func *func); 55extern void sdio_claim_host(struct sdio_func *func);
56extern void sdio_release_host(struct sdio_func *func); 56extern void sdio_release_host(struct sdio_func *func);
57 57
58extern int sdio_enable_func(struct sdio_func *func);
59extern int sdio_disable_func(struct sdio_func *func);
60
58extern unsigned char sdio_readb(struct sdio_func *func, 61extern unsigned char sdio_readb(struct sdio_func *func,
59 unsigned int addr, int *err_ret); 62 unsigned int addr, int *err_ret);
60 63