ARM: S5P64X0: no more support S5P6440 and S5P6450 SoCs
[deliverable/linux.git] / arch / arm / plat-samsung / include / plat / sdhci.h
1 /* linux/arch/arm/plat-samsung/include/plat/sdhci.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics
8 * http://armlinux.simtec.co.uk/
9 * Ben Dooks <ben@simtec.co.uk>
10 *
11 * S3C Platform - SDHCI (HSMMC) platform data definitions
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17
18 #ifndef __PLAT_S3C_SDHCI_H
19 #define __PLAT_S3C_SDHCI_H __FILE__
20
21 #include <linux/platform_data/mmc-sdhci-s3c.h>
22 #include <plat/devs.h>
23
24 /* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
25 * @pd: The default platform data for this device.
26 * @set: Pointer to the platform data to fill in.
27 */
28 extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
29 struct s3c_sdhci_platdata *set);
30
31 /**
32 * s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device.
33 * @pd: Platform data to register to device.
34 *
35 * Register the given platform data for use withe S3C SDHCI device.
36 * The call will copy the platform data, so the board definitions can
37 * make the structure itself __initdata.
38 */
39 extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd);
40 extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
41 extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd);
42 extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd);
43
44 /* Default platform data, exported so that per-cpu initialisation can
45 * set the correct one when there are more than one cpu type selected.
46 */
47
48 extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;
49 extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
50 extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;
51 extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata;
52
53 /* Helper function availability */
54
55 extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
56 extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
57 extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
58 extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
59 extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
60 extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
61 extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
62 extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
63 extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
64 extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
65 extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
66 extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
67 extern void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
68 extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
69 extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
70 extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
71
72 /* S3C2416 SDHCI setup */
73
74 #ifdef CONFIG_S3C2416_SETUP_SDHCI
75 static inline void s3c2416_default_sdhci0(void)
76 {
77 #ifdef CONFIG_S3C_DEV_HSMMC
78 s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
79 #endif /* CONFIG_S3C_DEV_HSMMC */
80 }
81
82 static inline void s3c2416_default_sdhci1(void)
83 {
84 #ifdef CONFIG_S3C_DEV_HSMMC1
85 s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
86 #endif /* CONFIG_S3C_DEV_HSMMC1 */
87 }
88
89 #else
90 static inline void s3c2416_default_sdhci0(void) { }
91 static inline void s3c2416_default_sdhci1(void) { }
92
93 #endif /* CONFIG_S3C2416_SETUP_SDHCI */
94
95 /* S3C64XX SDHCI setup */
96
97 #ifdef CONFIG_S3C64XX_SETUP_SDHCI
98 static inline void s3c6400_default_sdhci0(void)
99 {
100 #ifdef CONFIG_S3C_DEV_HSMMC
101 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
102 #endif
103 }
104
105 static inline void s3c6400_default_sdhci1(void)
106 {
107 #ifdef CONFIG_S3C_DEV_HSMMC1
108 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
109 #endif
110 }
111
112 static inline void s3c6400_default_sdhci2(void)
113 {
114 #ifdef CONFIG_S3C_DEV_HSMMC2
115 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
116 #endif
117 }
118
119 static inline void s3c6410_default_sdhci0(void)
120 {
121 #ifdef CONFIG_S3C_DEV_HSMMC
122 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
123 #endif
124 }
125
126 static inline void s3c6410_default_sdhci1(void)
127 {
128 #ifdef CONFIG_S3C_DEV_HSMMC1
129 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
130 #endif
131 }
132
133 static inline void s3c6410_default_sdhci2(void)
134 {
135 #ifdef CONFIG_S3C_DEV_HSMMC2
136 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
137 #endif
138 }
139
140 #else
141 static inline void s3c6410_default_sdhci0(void) { }
142 static inline void s3c6410_default_sdhci1(void) { }
143 static inline void s3c6410_default_sdhci2(void) { }
144 static inline void s3c6400_default_sdhci0(void) { }
145 static inline void s3c6400_default_sdhci1(void) { }
146 static inline void s3c6400_default_sdhci2(void) { }
147
148 #endif /* CONFIG_S3C64XX_SETUP_SDHCI */
149
150 /* S5PC100 SDHCI setup */
151
152 #ifdef CONFIG_S5PC100_SETUP_SDHCI
153 static inline void s5pc100_default_sdhci0(void)
154 {
155 #ifdef CONFIG_S3C_DEV_HSMMC
156 s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
157 #endif
158 }
159
160 static inline void s5pc100_default_sdhci1(void)
161 {
162 #ifdef CONFIG_S3C_DEV_HSMMC1
163 s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
164 #endif
165 }
166
167 static inline void s5pc100_default_sdhci2(void)
168 {
169 #ifdef CONFIG_S3C_DEV_HSMMC2
170 s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
171 #endif
172 }
173
174 #else
175 static inline void s5pc100_default_sdhci0(void) { }
176 static inline void s5pc100_default_sdhci1(void) { }
177 static inline void s5pc100_default_sdhci2(void) { }
178
179 #endif /* CONFIG_S5PC100_SETUP_SDHCI */
180
181 /* S5PV210 SDHCI setup */
182
183 #ifdef CONFIG_S5PV210_SETUP_SDHCI
184 static inline void s5pv210_default_sdhci0(void)
185 {
186 #ifdef CONFIG_S3C_DEV_HSMMC
187 s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
188 #endif
189 }
190
191 static inline void s5pv210_default_sdhci1(void)
192 {
193 #ifdef CONFIG_S3C_DEV_HSMMC1
194 s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
195 #endif
196 }
197
198 static inline void s5pv210_default_sdhci2(void)
199 {
200 #ifdef CONFIG_S3C_DEV_HSMMC2
201 s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
202 #endif
203 }
204
205 static inline void s5pv210_default_sdhci3(void)
206 {
207 #ifdef CONFIG_S3C_DEV_HSMMC3
208 s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
209 #endif
210 }
211
212 #else
213 static inline void s5pv210_default_sdhci0(void) { }
214 static inline void s5pv210_default_sdhci1(void) { }
215 static inline void s5pv210_default_sdhci2(void) { }
216 static inline void s5pv210_default_sdhci3(void) { }
217
218 #endif /* CONFIG_S5PV210_SETUP_SDHCI */
219
220 static inline void s3c_sdhci_setname(int id, char *name)
221 {
222 switch (id) {
223 #ifdef CONFIG_S3C_DEV_HSMMC
224 case 0:
225 s3c_device_hsmmc0.name = name;
226 break;
227 #endif
228 #ifdef CONFIG_S3C_DEV_HSMMC1
229 case 1:
230 s3c_device_hsmmc1.name = name;
231 break;
232 #endif
233 #ifdef CONFIG_S3C_DEV_HSMMC2
234 case 2:
235 s3c_device_hsmmc2.name = name;
236 break;
237 #endif
238 #ifdef CONFIG_S3C_DEV_HSMMC3
239 case 3:
240 s3c_device_hsmmc3.name = name;
241 break;
242 #endif
243 default:
244 break;
245 }
246 }
247 #endif /* __PLAT_S3C_SDHCI_H */
This page took 0.042161 seconds and 6 git commands to generate.