blob: 9b87f38fc4f400e24332d00bffabe08e6cfb56cd [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
Thomas Abraham8482c812012-04-14 08:04:46 -070021#include <plat/devs.h>
22
Ben Dooks5cc7fd82008-10-31 16:14:38 +000023struct platform_device;
24struct mmc_host;
25struct mmc_card;
26struct mmc_ios;
27
Marek Szyprowski19206b12010-07-23 09:27:18 +090028enum cd_types {
29 S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */
30 S3C_SDHCI_CD_EXTERNAL, /* use external callback */
31 S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */
32 S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */
33 S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
34};
35
Ben Dooks5cc7fd82008-10-31 16:14:38 +000036/**
37 * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
38 * @max_width: The maximum number of data bits supported.
39 * @host_caps: Standard MMC host capabilities bit field.
Jaehoon Chung25419012012-02-07 15:59:01 +090040 * @host_caps2: The second standard MMC host capabilities bit field.
Marek Szyprowski19206b12010-07-23 09:27:18 +090041 * @cd_type: Type of Card Detection method (see cd_types enum above)
42 * @ext_cd_init: Initialize external card detect subsystem. Called on
43 * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
44 * notify_func argument is a callback to the sdhci-s3c driver
45 * that triggers the card detection event. Callback arguments:
46 * dev is pointer to platform device of the host controller,
47 * state is new state of the card (0 - removed, 1 - inserted).
48 * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on
49 * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL.
50 * notify_func argument is the same callback as for ext_cd_init.
51 * @ext_cd_gpio: gpio pin used for external CD line, valid only if
52 * cd_type == S3C_SDHCI_CD_GPIO
53 * @ext_cd_gpio_invert: invert values for external CD gpio line
Ben Dooks5cc7fd82008-10-31 16:14:38 +000054 * @cfg_gpio: Configure the GPIO for a specific card bit-width
Ben Dooks5cc7fd82008-10-31 16:14:38 +000055 *
56 * Initialisation data specific to either the machine or the platform
57 * for the device driver to use or call-back when configuring gpio or
58 * card speed information.
59*/
60struct s3c_sdhci_platdata {
61 unsigned int max_width;
62 unsigned int host_caps;
Jaehoon Chung25419012012-02-07 15:59:01 +090063 unsigned int host_caps2;
Sangwook Lee92df9542011-12-07 22:49:29 -050064 unsigned int pm_caps;
Marek Szyprowski19206b12010-07-23 09:27:18 +090065 enum cd_types cd_type;
Ben Dooks5cc7fd82008-10-31 16:14:38 +000066
Marek Szyprowski19206b12010-07-23 09:27:18 +090067 int ext_cd_gpio;
68 bool ext_cd_gpio_invert;
69 int (*ext_cd_init)(void (*notify_func)(struct platform_device *,
70 int state));
71 int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
72 int state));
73
Ben Dooks5cc7fd82008-10-31 16:14:38 +000074 void (*cfg_gpio)(struct platform_device *dev, int width);
Ben Dooks5cc7fd82008-10-31 16:14:38 +000075};
76
Banajit Goswami5e8e0a12011-08-18 20:32:01 +090077/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
78 * @pd: The default platform data for this device.
79 * @set: Pointer to the platform data to fill in.
80 */
81extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
82 struct s3c_sdhci_platdata *set);
83
Ben Dooks5cc7fd82008-10-31 16:14:38 +000084/**
85 * s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device.
86 * @pd: Platform data to register to device.
87 *
88 * Register the given platform data for use withe S3C SDHCI device.
89 * The call will copy the platform data, so the board definitions can
90 * make the structure itself __initdata.
91 */
92extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd);
Ben Dooksa2205cd2008-10-31 16:14:39 +000093extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
Kyungmin Park86cd4f52009-11-17 08:41:23 +010094extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd);
Hyuk Leeb3c674b2010-06-10 15:22:16 +090095extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd);
Ben Dooks5cc7fd82008-10-31 16:14:38 +000096
97/* Default platform data, exported so that per-cpu initialisation can
98 * set the correct one when there are more than one cpu type selected.
99*/
100
Ben Dooksa2205cd2008-10-31 16:14:39 +0000101extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;
102extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100103extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;
Hyuk Leeb3c674b2010-06-10 15:22:16 +0900104extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata;
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000105
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300106/* Helper function availability */
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000107
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900108extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
109extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
Ben Dooks4faf68672009-03-25 11:01:24 +0000110extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
111extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100112extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
113extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
114extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100115extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200116extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
117extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
118extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Hyuk Lee976a62f2010-06-14 10:18:56 +0900119extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900120extern void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
121extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
122extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
123extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
Rajeshwari Shindeebc433c2011-12-26 16:28:54 +0900124extern void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
125extern void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
126extern void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
127extern void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
Ben Dooks4faf68672009-03-25 11:01:24 +0000128
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900129/* S3C2416 SDHCI setup */
130
131#ifdef CONFIG_S3C2416_SETUP_SDHCI
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900132static inline void s3c2416_default_sdhci0(void)
133{
134#ifdef CONFIG_S3C_DEV_HSMMC
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900135 s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900136#endif /* CONFIG_S3C_DEV_HSMMC */
137}
138
139static inline void s3c2416_default_sdhci1(void)
140{
141#ifdef CONFIG_S3C_DEV_HSMMC1
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900142 s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
Yauhen Kharuzhyc29cfa62010-12-17 14:42:09 +0900143#endif /* CONFIG_S3C_DEV_HSMMC1 */
144}
145
146#else
147static inline void s3c2416_default_sdhci0(void) { }
148static inline void s3c2416_default_sdhci1(void) { }
149
150#endif /* CONFIG_S3C2416_SETUP_SDHCI */
Rajeshwari Shindeebc433c2011-12-26 16:28:54 +0900151
Kukjin Kim88eb7152010-07-29 22:18:45 +0900152/* S3C64XX SDHCI setup */
Ben Dooks4faf68672009-03-25 11:01:24 +0000153
Ben Dooks2f6c2ac2010-01-26 10:38:52 +0900154#ifdef CONFIG_S3C64XX_SETUP_SDHCI
Ben Dooks4faf68672009-03-25 11:01:24 +0000155static inline void s3c6400_default_sdhci0(void)
156{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900157#ifdef CONFIG_S3C_DEV_HSMMC
Ben Dooks4faf68672009-03-25 11:01:24 +0000158 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900159#endif
Ben Dooks4faf68672009-03-25 11:01:24 +0000160}
161
Ben Dooks4faf68672009-03-25 11:01:24 +0000162static inline void s3c6400_default_sdhci1(void)
163{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900164#ifdef CONFIG_S3C_DEV_HSMMC1
Ben Dooks4faf68672009-03-25 11:01:24 +0000165 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900166#endif
Ben Dooks4faf68672009-03-25 11:01:24 +0000167}
Ben Dooks4faf68672009-03-25 11:01:24 +0000168
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100169static inline void s3c6400_default_sdhci2(void)
170{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900171#ifdef CONFIG_S3C_DEV_HSMMC2
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100172 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900173#endif
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100174}
Ben Dooks4faf68672009-03-25 11:01:24 +0000175
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000176static inline void s3c6410_default_sdhci0(void)
177{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900178#ifdef CONFIG_S3C_DEV_HSMMC
Ben Dooks4faf68672009-03-25 11:01:24 +0000179 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900180#endif
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000181}
Ben Dooksa2205cd2008-10-31 16:14:39 +0000182
183static inline void s3c6410_default_sdhci1(void)
184{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900185#ifdef CONFIG_S3C_DEV_HSMMC1
Ben Dooks4faf68672009-03-25 11:01:24 +0000186 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900187#endif
Ben Dooksa2205cd2008-10-31 16:14:39 +0000188}
Ben Dooks713e9de2008-10-31 16:29:19 +0000189
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100190static inline void s3c6410_default_sdhci2(void)
191{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900192#ifdef CONFIG_S3C_DEV_HSMMC2
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100193 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900194#endif
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100195}
Maurus Cuelenaere92b118f2009-11-23 13:34:46 +0100196
Ben Dooks713e9de2008-10-31 16:29:19 +0000197#else
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000198static inline void s3c6410_default_sdhci0(void) { }
Ben Dooksa2205cd2008-10-31 16:14:39 +0000199static inline void s3c6410_default_sdhci1(void) { }
Marek Szyprowski6b34f492010-06-22 15:45:26 +0900200static inline void s3c6410_default_sdhci2(void) { }
Ben Dooks2f6c2ac2010-01-26 10:38:52 +0900201static inline void s3c6400_default_sdhci0(void) { }
202static inline void s3c6400_default_sdhci1(void) { }
Marek Szyprowski6b34f492010-06-22 15:45:26 +0900203static inline void s3c6400_default_sdhci2(void) { }
Ben Dooks2f6c2ac2010-01-26 10:38:52 +0900204
205#endif /* CONFIG_S3C64XX_SETUP_SDHCI */
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000206
Rajeshwari Shindeebc433c2011-12-26 16:28:54 +0900207/* S5P64X0 SDHCI setup */
208
209#ifdef CONFIG_S5P64X0_SETUP_SDHCI
210static inline void s5p64x0_default_sdhci0(void)
211{
212#ifdef CONFIG_S3C_DEV_HSMMC
213 s3c_hsmmc0_def_platdata.cfg_gpio = s5p64x0_setup_sdhci0_cfg_gpio;
214#endif
215}
216
217static inline void s5p64x0_default_sdhci1(void)
218{
219#ifdef CONFIG_S3C_DEV_HSMMC1
220 s3c_hsmmc1_def_platdata.cfg_gpio = s5p64x0_setup_sdhci1_cfg_gpio;
221#endif
222}
223
224static inline void s5p6440_default_sdhci2(void)
225{
226#ifdef CONFIG_S3C_DEV_HSMMC2
227 s3c_hsmmc2_def_platdata.cfg_gpio = s5p6440_setup_sdhci2_cfg_gpio;
228#endif
229}
230
231static inline void s5p6450_default_sdhci2(void)
232{
233#ifdef CONFIG_S3C_DEV_HSMMC2
234 s3c_hsmmc2_def_platdata.cfg_gpio = s5p6450_setup_sdhci2_cfg_gpio;
235#endif
236}
237
238#else
239static inline void s5p64x0_default_sdhci0(void) { }
240static inline void s5p64x0_default_sdhci1(void) { }
241static inline void s5p6440_default_sdhci2(void) { }
242static inline void s5p6450_default_sdhci2(void) { }
243
244#endif /* CONFIG_S5P64X0_SETUP_SDHCI */
245
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100246/* S5PC100 SDHCI setup */
247
248#ifdef CONFIG_S5PC100_SETUP_SDHCI
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100249static inline void s5pc100_default_sdhci0(void)
250{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900251#ifdef CONFIG_S3C_DEV_HSMMC
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100252 s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900253#endif
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100254}
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100255
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100256static inline void s5pc100_default_sdhci1(void)
257{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900258#ifdef CONFIG_S3C_DEV_HSMMC1
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100259 s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900260#endif
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100261}
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100262
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100263static inline void s5pc100_default_sdhci2(void)
264{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900265#ifdef CONFIG_S3C_DEV_HSMMC2
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100266 s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900267#endif
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100268}
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100269
270#else
271static inline void s5pc100_default_sdhci0(void) { }
272static inline void s5pc100_default_sdhci1(void) { }
273static inline void s5pc100_default_sdhci2(void) { }
Kukjin Kim88eb7152010-07-29 22:18:45 +0900274
Kyungmin Park86cd4f52009-11-17 08:41:23 +0100275#endif /* CONFIG_S5PC100_SETUP_SDHCI */
276
Kukjin Kim88eb7152010-07-29 22:18:45 +0900277/* S5PV210 SDHCI setup */
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200278
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200279#ifdef CONFIG_S5PV210_SETUP_SDHCI
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200280static inline void s5pv210_default_sdhci0(void)
281{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900282#ifdef CONFIG_S3C_DEV_HSMMC
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200283 s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900284#endif
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200285}
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200286
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200287static inline void s5pv210_default_sdhci1(void)
288{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900289#ifdef CONFIG_S3C_DEV_HSMMC1
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200290 s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900291#endif
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200292}
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200293
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200294static inline void s5pv210_default_sdhci2(void)
295{
Kukjin Kim88eb7152010-07-29 22:18:45 +0900296#ifdef CONFIG_S3C_DEV_HSMMC2
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200297 s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
Kukjin Kim88eb7152010-07-29 22:18:45 +0900298#endif
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200299}
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200300
Hyuk Lee976a62f2010-06-14 10:18:56 +0900301static inline void s5pv210_default_sdhci3(void)
302{
Kukjin Kimd61bd772010-08-06 21:49:18 +0900303#ifdef CONFIG_S3C_DEV_HSMMC3
Hyuk Lee976a62f2010-06-14 10:18:56 +0900304 s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
Kukjin Kimd61bd772010-08-06 21:49:18 +0900305#endif
Hyuk Lee976a62f2010-06-14 10:18:56 +0900306}
Hyuk Lee976a62f2010-06-14 10:18:56 +0900307
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200308#else
309static inline void s5pv210_default_sdhci0(void) { }
310static inline void s5pv210_default_sdhci1(void) { }
311static inline void s5pv210_default_sdhci2(void) { }
Hyuk Lee976a62f2010-06-14 10:18:56 +0900312static inline void s5pv210_default_sdhci3(void) { }
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200313
Kukjin Kim88eb7152010-07-29 22:18:45 +0900314#endif /* CONFIG_S5PV210_SETUP_SDHCI */
Marek Szyprowskie6f66a92010-05-20 08:13:07 +0200315
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900316/* EXYNOS4 SDHCI setup */
317#ifdef CONFIG_EXYNOS4_SETUP_SDHCI
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900318static inline void exynos4_default_sdhci0(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900319{
320#ifdef CONFIG_S3C_DEV_HSMMC
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900321 s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900322#endif
323}
324
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900325static inline void exynos4_default_sdhci1(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900326{
327#ifdef CONFIG_S3C_DEV_HSMMC1
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900328 s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900329#endif
330}
331
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900332static inline void exynos4_default_sdhci2(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900333{
334#ifdef CONFIG_S3C_DEV_HSMMC2
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900335 s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900336#endif
337}
338
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900339static inline void exynos4_default_sdhci3(void)
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900340{
341#ifdef CONFIG_S3C_DEV_HSMMC3
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900342 s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900343#endif
344}
345
346#else
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900347static inline void exynos4_default_sdhci0(void) { }
348static inline void exynos4_default_sdhci1(void) { }
349static inline void exynos4_default_sdhci2(void) { }
350static inline void exynos4_default_sdhci3(void) { }
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900351
Kukjin Kim3db3ae52011-02-14 16:22:36 +0900352#endif /* CONFIG_EXYNOS4_SETUP_SDHCI */
Hyuk Lee1036c3a2010-10-05 19:07:41 +0900353
Thomas Abraham8482c812012-04-14 08:04:46 -0700354static inline void s3c_sdhci_setname(int id, char *name)
355{
356 switch (id) {
357#ifdef CONFIG_S3C_DEV_HSMMC
358 case 0:
359 s3c_device_hsmmc0.name = name;
360 break;
361#endif
362#ifdef CONFIG_S3C_DEV_HSMMC1
363 case 1:
364 s3c_device_hsmmc1.name = name;
365 break;
366#endif
367#ifdef CONFIG_S3C_DEV_HSMMC2
368 case 2:
369 s3c_device_hsmmc2.name = name;
370 break;
371#endif
372#ifdef CONFIG_S3C_DEV_HSMMC3
373 case 3:
374 s3c_device_hsmmc3.name = name;
375 break;
376#endif
Sachin Kamat8d67ec82013-02-12 10:27:52 -0800377 default:
378 break;
Thomas Abraham8482c812012-04-14 08:04:46 -0700379 }
380}
381
Ben Dooks5cc7fd82008-10-31 16:14:38 +0000382#endif /* __PLAT_S3C_SDHCI_H */