blob: f82f888b91a95bb0a238975b4c575408728eb1e9 [file] [log] [blame]
Kukjin Kim3db3ae52011-02-14 16:22:36 +09001/* linux/arch/arm/plat-samsung/include/plat/sdhci.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
Ben Dooks5cc7fd82008-10-31 16:14:38 +00005 *
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
21struct platform_device;
22struct mmc_host;
23struct mmc_card;
24struct mmc_ios;
25
Marek Szyprowski19206b12010-07-23 09:27:18 +090026enum cd_types {
27 S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */
28 S3C_SDHCI_CD_EXTERNAL, /* use external callback */
29 S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */
30 S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */
31 S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
32};
33
Jeongbae Seo28c80aa2010-10-08 18:03:27 +090034enum clk_types {
35 S3C_SDHCI_CLK_DIV_INTERNAL, /* use mmc internal clock divider */
36 S3C_SDHCI_CLK_DIV_EXTERNAL, /* use external clock divider */
37};
38
Ben Dooks5cc7fd82008-10-31 16:14:38 +000039/**
40 * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
41 * @max_width: The maximum number of data bits supported.
42 * @host_caps: Standard MMC host capabilities bit field.
Marek Szyprowski19206b12010-07-23 09:27:18 +090043 * @cd_type: Type of Card Detection method (see cd_types enum above)
Jeongbae Seo28c80aa2010-10-08 18:03:27 +090044 * @clk_type: Type of clock divider method (see clk_types enum above)
Marek Szyprowski19206b12010-07-23 09:27:18 +090045 * @ext_cd_init: Initialize external card detect subsystem. Called on
46 * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
47 * notify_func argument is a callback to the sdhci-s3c driver
48 * that triggers the card detection event. Callback arguments:
49 * dev is pointer to platform device of the host controller,
50 * state is new state of the card (0 - removed, 1 - inserted).
51 * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on
52 * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL.
53 * notify_func argument is the same callback as for ext_cd_init.
54 * @ext_cd_gpio: gpio pin used for external CD line, valid only if
55 * cd_type == S3C_SDHCI_CD_GPIO
56 * @ext_cd_gpio_invert: invert values for external CD gpio line
Ben Dooks5cc7fd82008-10-31 16:14:38 +000057 * @cfg_gpio: Configure the GPIO for a specific card bit-width
Ben Dooks5cc7fd82008-10-31 16:14:38 +000058 *
59 * Initialisation data specific to either the machine or the platform
60 * for the device driver to use or call-back when configuring gpio or
61 * card speed information.
62*/
63struct s3c_sdhci_platdata {
64 unsigned int max_width;
65 unsigned int host_caps;
Sangwook Lee92df9542011-12-07 22:49:29 -050066 unsigned int pm_caps;
Marek Szyprowski19206b12010-07-23 09:27:18 +090067 enum cd_types cd_type;
Jeongbae Seo28c80aa2010-10-08 18:03:27 +090068 enum clk_types clk_type;
Ben Dooks5cc7fd82008-10-31 16:14:38 +000069
Marek Szyprowski19206b12010-07-23 09:27:18 +090070 int ext_cd_gpio;
71 bool ext_cd_gpio_invert;
72 int (*ext_cd_init)(void (*notify_func)(struct platform_device *,
73 int state));
74 int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
75 int state));
76
Ben Dooks5cc7fd82008-10-31 16:14:38 +000077 void (*cfg_gpio)(struct platform_device *dev, int width);
Ben Dooks5cc7fd82008-10-31 16:14:38 +000078};
79
Banajit Goswami5e8e0a12011-08-18 20:32:01 +090080/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
81 * @pd: The default platform data for this device.
82 * @set: Pointer to the platform data to fill in.
83 */
84extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
85 struct s3c_sdhci_platdata *set);
86
Ben Dooks5cc7fd82008-10-31 16:14:38 +000087/**
88 * s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device.
89 * @pd: Platform data to register to device.
90 *
91 * Register the given platform data for use withe S3C SDHCI device.
92 * The call will copy the platform data, so the board definitions can
93 * make the structure itself __initdata.
94 */
95extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd);
Ben Dooksa2205cd2008-10-31 16:14:39 +000096extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
Kyungmin Park86cd4f52009-11-17 08:41:23 +010097extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd);
Hyuk Leeb3c674b2010-06-10 15:22:16 +090098extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd);
Ben Dooks5cc7fd82008-10-31 16:14:38 +000099
100/* Default platform data, exported so that per-cpu initialisation can
101 * set the correct one when there are more than one cpu type selected.
102*/
103
Ben Dooksa2205cd2008-10-31 16:14:39 +0000104extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;
105extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100106extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;
Hyuk Leeb3c674b2010-06-10 15:22:16 +0900107extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata;
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000108
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300109/* Helper function availability */
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000110
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900111extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
112extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
Ben Dooks4faf68672009-03-25 11:01:24 +0000113extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
114extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100115extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
116extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
117extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100118extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200119extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
120extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
121extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Hyuk Lee976a62f2010-06-14 10:18:56 +0900122extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900123extern void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
124extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
125extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
126extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
Rajeshwari Shindeebc433c2011-12-26 16:28:54 +0900127extern void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
128extern void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
129extern void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
130extern void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Ben Dooks4faf68672009-03-25 11:01:24 +0000131
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900132/* S3C2416 SDHCI setup */
133
134#ifdef CONFIG_S3C2416_SETUP_SDHCI
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900135static inline void s3c2416_default_sdhci0(void)
136{
137#ifdef CONFIG_S3C_DEV_HSMMC
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900138 s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900139#endif /* CONFIG_S3C_DEV_HSMMC */
140}
141
142static inline void s3c2416_default_sdhci1(void)
143{
144#ifdef CONFIG_S3C_DEV_HSMMC1
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900145 s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900146#endif /* CONFIG_S3C_DEV_HSMMC1 */
147}
148
149#else
150static inline void s3c2416_default_sdhci0(void) { }
151static inline void s3c2416_default_sdhci1(void) { }
152
153#endif /* CONFIG_S3C2416_SETUP_SDHCI */
Rajeshwari Shindeebc433c2011-12-26 16:28:54 +0900154
Kukjin Kim88eb7152010-07-29 22:18:45 +0900155/* S3C64XX SDHCI setup */
Ben Dooks4faf68672009-03-25 11:01:24 +0000156
Ben Dooks2f6c2ac2010-01-26 10:38:52 +0900157#ifdef CONFIG_S3C64XX_SETUP_SDHCI
Ben Dooks4faf68672009-03-25 11:01:24 +0000158static inline void s3c6400_default_sdhci0(void)
159{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900160#ifdef CONFIG_S3C_DEV_HSMMC
Ben Dooks4faf68672009-03-25 11:01:24 +0000161 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900162#endif
Ben Dooks4faf68672009-03-25 11:01:24 +0000163}
164
Ben Dooks4faf68672009-03-25 11:01:24 +0000165static inline void s3c6400_default_sdhci1(void)
166{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900167#ifdef CONFIG_S3C_DEV_HSMMC1
Ben Dooks4faf68672009-03-25 11:01:24 +0000168 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900169#endif
Ben Dooks4faf68672009-03-25 11:01:24 +0000170}
Ben Dooks4faf68672009-03-25 11:01:24 +0000171
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100172static inline void s3c6400_default_sdhci2(void)
173{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900174#ifdef CONFIG_S3C_DEV_HSMMC2
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100175 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900176#endif
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100177}
Ben Dooks4faf68672009-03-25 11:01:24 +0000178
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000179static inline void s3c6410_default_sdhci0(void)
180{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900181#ifdef CONFIG_S3C_DEV_HSMMC
Ben Dooks4faf68672009-03-25 11:01:24 +0000182 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900183#endif
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000184}
Ben Dooksa2205cd2008-10-31 16:14:39 +0000185
186static inline void s3c6410_default_sdhci1(void)
187{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900188#ifdef CONFIG_S3C_DEV_HSMMC1
Ben Dooks4faf68672009-03-25 11:01:24 +0000189 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900190#endif
Ben Dooksa2205cd2008-10-31 16:14:39 +0000191}
Ben Dooks713e9de2008-10-31 16:29:19 +0000192
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100193static inline void s3c6410_default_sdhci2(void)
194{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900195#ifdef CONFIG_S3C_DEV_HSMMC2
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100196 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900197#endif
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100198}
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100199
Ben Dooks713e9de2008-10-31 16:29:19 +0000200#else
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000201static inline void s3c6410_default_sdhci0(void) { }
Ben Dooksa2205cd2008-10-31 16:14:39 +0000202static inline void s3c6410_default_sdhci1(void) { }
Marek Szyprowski6b34f492010-06-22 15:45:26 +0900203static inline void s3c6410_default_sdhci2(void) { }
Ben Dooks2f6c2ac2010-01-26 10:38:52 +0900204static inline void s3c6400_default_sdhci0(void) { }
205static inline void s3c6400_default_sdhci1(void) { }
Marek Szyprowski6b34f492010-06-22 15:45:26 +0900206static inline void s3c6400_default_sdhci2(void) { }
Ben Dooks2f6c2ac2010-01-26 10:38:52 +0900207
208#endif /* CONFIG_S3C64XX_SETUP_SDHCI */
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000209
Rajeshwari Shindeebc433c2011-12-26 16:28:54 +0900210/* S5P64X0 SDHCI setup */
211
212#ifdef CONFIG_S5P64X0_SETUP_SDHCI
213static inline void s5p64x0_default_sdhci0(void)
214{
215#ifdef CONFIG_S3C_DEV_HSMMC
216 s3c_hsmmc0_def_platdata.cfg_gpio = s5p64x0_setup_sdhci0_cfg_gpio;
217#endif
218}
219
220static inline void s5p64x0_default_sdhci1(void)
221{
222#ifdef CONFIG_S3C_DEV_HSMMC1
223 s3c_hsmmc1_def_platdata.cfg_gpio = s5p64x0_setup_sdhci1_cfg_gpio;
224#endif
225}
226
227static inline void s5p6440_default_sdhci2(void)
228{
229#ifdef CONFIG_S3C_DEV_HSMMC2
230 s3c_hsmmc2_def_platdata.cfg_gpio = s5p6440_setup_sdhci2_cfg_gpio;
231#endif
232}
233
234static inline void s5p6450_default_sdhci2(void)
235{
236#ifdef CONFIG_S3C_DEV_HSMMC2
237 s3c_hsmmc2_def_platdata.cfg_gpio = s5p6450_setup_sdhci2_cfg_gpio;
238#endif
239}
240
241#else
242static inline void s5p64x0_default_sdhci0(void) { }
243static inline void s5p64x0_default_sdhci1(void) { }
244static inline void s5p6440_default_sdhci2(void) { }
245static inline void s5p6450_default_sdhci2(void) { }
246
247#endif /* CONFIG_S5P64X0_SETUP_SDHCI */
248
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100249/* S5PC100 SDHCI setup */
250
251#ifdef CONFIG_S5PC100_SETUP_SDHCI
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100252static inline void s5pc100_default_sdhci0(void)
253{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900254#ifdef CONFIG_S3C_DEV_HSMMC
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100255 s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900256#endif
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100257}
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100258
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100259static inline void s5pc100_default_sdhci1(void)
260{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900261#ifdef CONFIG_S3C_DEV_HSMMC1
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100262 s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900263#endif
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100264}
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100265
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100266static inline void s5pc100_default_sdhci2(void)
267{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900268#ifdef CONFIG_S3C_DEV_HSMMC2
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100269 s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900270#endif
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100271}
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100272
273#else
274static inline void s5pc100_default_sdhci0(void) { }
275static inline void s5pc100_default_sdhci1(void) { }
276static inline void s5pc100_default_sdhci2(void) { }
Kukjin Kim88eb7152010-07-29 22:18:45 +0900277
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100278#endif /* CONFIG_S5PC100_SETUP_SDHCI */
279
Kukjin Kim88eb7152010-07-29 22:18:45 +0900280/* S5PV210 SDHCI setup */
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200281
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200282#ifdef CONFIG_S5PV210_SETUP_SDHCI
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200283static inline void s5pv210_default_sdhci0(void)
284{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900285#ifdef CONFIG_S3C_DEV_HSMMC
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200286 s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900287#endif
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200288}
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200289
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200290static inline void s5pv210_default_sdhci1(void)
291{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900292#ifdef CONFIG_S3C_DEV_HSMMC1
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200293 s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900294#endif
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200295}
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200296
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200297static inline void s5pv210_default_sdhci2(void)
298{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900299#ifdef CONFIG_S3C_DEV_HSMMC2
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200300 s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900301#endif
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200302}
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200303
Hyuk Lee976a62f2010-06-14 10:18:56 +0900304static inline void s5pv210_default_sdhci3(void)
305{
Kukjin Kimd61bd772010-08-06 21:49:18 +0900306#ifdef CONFIG_S3C_DEV_HSMMC3
Hyuk Lee976a62f2010-06-14 10:18:56 +0900307 s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
Kukjin Kimd61bd772010-08-06 21:49:18 +0900308#endif
Hyuk Lee976a62f2010-06-14 10:18:56 +0900309}
Hyuk Lee976a62f2010-06-14 10:18:56 +0900310
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200311#else
312static inline void s5pv210_default_sdhci0(void) { }
313static inline void s5pv210_default_sdhci1(void) { }
314static inline void s5pv210_default_sdhci2(void) { }
Hyuk Lee976a62f2010-06-14 10:18:56 +0900315static inline void s5pv210_default_sdhci3(void) { }
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200316
Kukjin Kim88eb7152010-07-29 22:18:45 +0900317#endif /* CONFIG_S5PV210_SETUP_SDHCI */
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200318
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900319/* EXYNOS4 SDHCI setup */
320#ifdef CONFIG_EXYNOS4_SETUP_SDHCI
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900321static inline void exynos4_default_sdhci0(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900322{
323#ifdef CONFIG_S3C_DEV_HSMMC
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900324 s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900325#endif
326}
327
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900328static inline void exynos4_default_sdhci1(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900329{
330#ifdef CONFIG_S3C_DEV_HSMMC1
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900331 s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900332#endif
333}
334
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900335static inline void exynos4_default_sdhci2(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900336{
337#ifdef CONFIG_S3C_DEV_HSMMC2
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900338 s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900339#endif
340}
341
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900342static inline void exynos4_default_sdhci3(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900343{
344#ifdef CONFIG_S3C_DEV_HSMMC3
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900345 s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900346#endif
347}
348
349#else
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900350static inline void exynos4_default_sdhci0(void) { }
351static inline void exynos4_default_sdhci1(void) { }
352static inline void exynos4_default_sdhci2(void) { }
353static inline void exynos4_default_sdhci3(void) { }
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900354
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900355#endif /* CONFIG_EXYNOS4_SETUP_SDHCI */
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900356
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000357#endif /* __PLAT_S3C_SDHCI_H */