Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/plat-samsung/include/plat/sdhci.h |
| 2 | * |
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 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 | struct platform_device; |
| 22 | struct mmc_host; |
| 23 | struct mmc_card; |
| 24 | struct mmc_ios; |
| 25 | |
Marek Szyprowski | 19206b17 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 26 | enum 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 Seo | 28c80aa | 2010-10-08 18:03:27 +0900 | [diff] [blame] | 34 | enum 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 Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 39 | /** |
| 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. |
Jaehoon Chung | 2541901 | 2012-02-07 15:59:01 +0900 | [diff] [blame] | 43 | * @host_caps2: The second standard MMC host capabilities bit field. |
Marek Szyprowski | 19206b17 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 44 | * @cd_type: Type of Card Detection method (see cd_types enum above) |
Jeongbae Seo | 28c80aa | 2010-10-08 18:03:27 +0900 | [diff] [blame] | 45 | * @clk_type: Type of clock divider method (see clk_types enum above) |
Marek Szyprowski | 19206b17 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 46 | * @ext_cd_init: Initialize external card detect subsystem. Called on |
| 47 | * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL. |
| 48 | * notify_func argument is a callback to the sdhci-s3c driver |
| 49 | * that triggers the card detection event. Callback arguments: |
| 50 | * dev is pointer to platform device of the host controller, |
| 51 | * state is new state of the card (0 - removed, 1 - inserted). |
| 52 | * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on |
| 53 | * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL. |
| 54 | * notify_func argument is the same callback as for ext_cd_init. |
| 55 | * @ext_cd_gpio: gpio pin used for external CD line, valid only if |
| 56 | * cd_type == S3C_SDHCI_CD_GPIO |
| 57 | * @ext_cd_gpio_invert: invert values for external CD gpio line |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 58 | * @cfg_gpio: Configure the GPIO for a specific card bit-width |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 59 | * |
| 60 | * Initialisation data specific to either the machine or the platform |
| 61 | * for the device driver to use or call-back when configuring gpio or |
| 62 | * card speed information. |
| 63 | */ |
| 64 | struct s3c_sdhci_platdata { |
| 65 | unsigned int max_width; |
| 66 | unsigned int host_caps; |
Jaehoon Chung | 2541901 | 2012-02-07 15:59:01 +0900 | [diff] [blame] | 67 | unsigned int host_caps2; |
Sangwook Lee | 92df954 | 2011-12-07 22:49:29 -0500 | [diff] [blame] | 68 | unsigned int pm_caps; |
Marek Szyprowski | 19206b17 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 69 | enum cd_types cd_type; |
Jeongbae Seo | 28c80aa | 2010-10-08 18:03:27 +0900 | [diff] [blame] | 70 | enum clk_types clk_type; |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 71 | |
Marek Szyprowski | 19206b17 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 72 | int ext_cd_gpio; |
| 73 | bool ext_cd_gpio_invert; |
| 74 | int (*ext_cd_init)(void (*notify_func)(struct platform_device *, |
| 75 | int state)); |
| 76 | int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *, |
| 77 | int state)); |
| 78 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 79 | void (*cfg_gpio)(struct platform_device *dev, int width); |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 80 | }; |
| 81 | |
Banajit Goswami | 5e8e0a1 | 2011-08-18 20:32:01 +0900 | [diff] [blame] | 82 | /* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data |
| 83 | * @pd: The default platform data for this device. |
| 84 | * @set: Pointer to the platform data to fill in. |
| 85 | */ |
| 86 | extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd, |
| 87 | struct s3c_sdhci_platdata *set); |
| 88 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 89 | /** |
| 90 | * s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device. |
| 91 | * @pd: Platform data to register to device. |
| 92 | * |
| 93 | * Register the given platform data for use withe S3C SDHCI device. |
| 94 | * The call will copy the platform data, so the board definitions can |
| 95 | * make the structure itself __initdata. |
| 96 | */ |
| 97 | extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd); |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 98 | extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd); |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 99 | extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd); |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 100 | extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd); |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 101 | |
| 102 | /* Default platform data, exported so that per-cpu initialisation can |
| 103 | * set the correct one when there are more than one cpu type selected. |
| 104 | */ |
| 105 | |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 106 | extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata; |
| 107 | extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 108 | extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata; |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 109 | extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata; |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 110 | |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 111 | /* Helper function availability */ |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 112 | |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 113 | extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 114 | extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 115 | extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 116 | extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 117 | extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 118 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 119 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 120 | extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 121 | extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 122 | extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 123 | extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 124 | extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w); |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 125 | extern void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 126 | extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 127 | extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
| 128 | extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w); |
Rajeshwari Shinde | ebc433c | 2011-12-26 16:28:54 +0900 | [diff] [blame] | 129 | extern void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 130 | extern void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 131 | extern void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
| 132 | extern void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 133 | |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 134 | /* S3C2416 SDHCI setup */ |
| 135 | |
| 136 | #ifdef CONFIG_S3C2416_SETUP_SDHCI |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 137 | static inline void s3c2416_default_sdhci0(void) |
| 138 | { |
| 139 | #ifdef CONFIG_S3C_DEV_HSMMC |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 140 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio; |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 141 | #endif /* CONFIG_S3C_DEV_HSMMC */ |
| 142 | } |
| 143 | |
| 144 | static inline void s3c2416_default_sdhci1(void) |
| 145 | { |
| 146 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 147 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio; |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 148 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ |
| 149 | } |
| 150 | |
| 151 | #else |
| 152 | static inline void s3c2416_default_sdhci0(void) { } |
| 153 | static inline void s3c2416_default_sdhci1(void) { } |
| 154 | |
| 155 | #endif /* CONFIG_S3C2416_SETUP_SDHCI */ |
Rajeshwari Shinde | ebc433c | 2011-12-26 16:28:54 +0900 | [diff] [blame] | 156 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 157 | /* S3C64XX SDHCI setup */ |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 158 | |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 159 | #ifdef CONFIG_S3C64XX_SETUP_SDHCI |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 160 | static inline void s3c6400_default_sdhci0(void) |
| 161 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 162 | #ifdef CONFIG_S3C_DEV_HSMMC |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 163 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 164 | #endif |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 165 | } |
| 166 | |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 167 | static inline void s3c6400_default_sdhci1(void) |
| 168 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 169 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 170 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 171 | #endif |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 172 | } |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 173 | |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 174 | static inline void s3c6400_default_sdhci2(void) |
| 175 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 176 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 177 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 178 | #endif |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 179 | } |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 180 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 181 | static inline void s3c6410_default_sdhci0(void) |
| 182 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 183 | #ifdef CONFIG_S3C_DEV_HSMMC |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 184 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 185 | #endif |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 186 | } |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 187 | |
| 188 | static inline void s3c6410_default_sdhci1(void) |
| 189 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 190 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 191 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 192 | #endif |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 193 | } |
Ben Dooks | 713e9de | 2008-10-31 16:29:19 +0000 | [diff] [blame] | 194 | |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 195 | static inline void s3c6410_default_sdhci2(void) |
| 196 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 197 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 198 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 199 | #endif |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 200 | } |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 201 | |
Ben Dooks | 713e9de | 2008-10-31 16:29:19 +0000 | [diff] [blame] | 202 | #else |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 203 | static inline void s3c6410_default_sdhci0(void) { } |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 204 | static inline void s3c6410_default_sdhci1(void) { } |
Marek Szyprowski | 6b34f49 | 2010-06-22 15:45:26 +0900 | [diff] [blame] | 205 | static inline void s3c6410_default_sdhci2(void) { } |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 206 | static inline void s3c6400_default_sdhci0(void) { } |
| 207 | static inline void s3c6400_default_sdhci1(void) { } |
Marek Szyprowski | 6b34f49 | 2010-06-22 15:45:26 +0900 | [diff] [blame] | 208 | static inline void s3c6400_default_sdhci2(void) { } |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 209 | |
| 210 | #endif /* CONFIG_S3C64XX_SETUP_SDHCI */ |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 211 | |
Rajeshwari Shinde | ebc433c | 2011-12-26 16:28:54 +0900 | [diff] [blame] | 212 | /* S5P64X0 SDHCI setup */ |
| 213 | |
| 214 | #ifdef CONFIG_S5P64X0_SETUP_SDHCI |
| 215 | static inline void s5p64x0_default_sdhci0(void) |
| 216 | { |
| 217 | #ifdef CONFIG_S3C_DEV_HSMMC |
| 218 | s3c_hsmmc0_def_platdata.cfg_gpio = s5p64x0_setup_sdhci0_cfg_gpio; |
| 219 | #endif |
| 220 | } |
| 221 | |
| 222 | static inline void s5p64x0_default_sdhci1(void) |
| 223 | { |
| 224 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
| 225 | s3c_hsmmc1_def_platdata.cfg_gpio = s5p64x0_setup_sdhci1_cfg_gpio; |
| 226 | #endif |
| 227 | } |
| 228 | |
| 229 | static inline void s5p6440_default_sdhci2(void) |
| 230 | { |
| 231 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
| 232 | s3c_hsmmc2_def_platdata.cfg_gpio = s5p6440_setup_sdhci2_cfg_gpio; |
| 233 | #endif |
| 234 | } |
| 235 | |
| 236 | static inline void s5p6450_default_sdhci2(void) |
| 237 | { |
| 238 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
| 239 | s3c_hsmmc2_def_platdata.cfg_gpio = s5p6450_setup_sdhci2_cfg_gpio; |
| 240 | #endif |
| 241 | } |
| 242 | |
| 243 | #else |
| 244 | static inline void s5p64x0_default_sdhci0(void) { } |
| 245 | static inline void s5p64x0_default_sdhci1(void) { } |
| 246 | static inline void s5p6440_default_sdhci2(void) { } |
| 247 | static inline void s5p6450_default_sdhci2(void) { } |
| 248 | |
| 249 | #endif /* CONFIG_S5P64X0_SETUP_SDHCI */ |
| 250 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 251 | /* S5PC100 SDHCI setup */ |
| 252 | |
| 253 | #ifdef CONFIG_S5PC100_SETUP_SDHCI |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 254 | static inline void s5pc100_default_sdhci0(void) |
| 255 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 256 | #ifdef CONFIG_S3C_DEV_HSMMC |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 257 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 258 | #endif |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 259 | } |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 260 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 261 | static inline void s5pc100_default_sdhci1(void) |
| 262 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 263 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 264 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 265 | #endif |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 266 | } |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 267 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 268 | static inline void s5pc100_default_sdhci2(void) |
| 269 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 270 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 271 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 272 | #endif |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 273 | } |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 274 | |
| 275 | #else |
| 276 | static inline void s5pc100_default_sdhci0(void) { } |
| 277 | static inline void s5pc100_default_sdhci1(void) { } |
| 278 | static inline void s5pc100_default_sdhci2(void) { } |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 279 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 280 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ |
| 281 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 282 | /* S5PV210 SDHCI setup */ |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 283 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 284 | #ifdef CONFIG_S5PV210_SETUP_SDHCI |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 285 | static inline void s5pv210_default_sdhci0(void) |
| 286 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 287 | #ifdef CONFIG_S3C_DEV_HSMMC |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 288 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 289 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 290 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 291 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 292 | static inline void s5pv210_default_sdhci1(void) |
| 293 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 294 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 295 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 296 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 297 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 298 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 299 | static inline void s5pv210_default_sdhci2(void) |
| 300 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 301 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 302 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 303 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 304 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 305 | |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 306 | static inline void s5pv210_default_sdhci3(void) |
| 307 | { |
Kukjin Kim | d61bd77 | 2010-08-06 21:49:18 +0900 | [diff] [blame] | 308 | #ifdef CONFIG_S3C_DEV_HSMMC3 |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 309 | s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio; |
Kukjin Kim | d61bd77 | 2010-08-06 21:49:18 +0900 | [diff] [blame] | 310 | #endif |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 311 | } |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 312 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 313 | #else |
| 314 | static inline void s5pv210_default_sdhci0(void) { } |
| 315 | static inline void s5pv210_default_sdhci1(void) { } |
| 316 | static inline void s5pv210_default_sdhci2(void) { } |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 317 | static inline void s5pv210_default_sdhci3(void) { } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 318 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 319 | #endif /* CONFIG_S5PV210_SETUP_SDHCI */ |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 320 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 321 | /* EXYNOS4 SDHCI setup */ |
| 322 | #ifdef CONFIG_EXYNOS4_SETUP_SDHCI |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 323 | static inline void exynos4_default_sdhci0(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 324 | { |
| 325 | #ifdef CONFIG_S3C_DEV_HSMMC |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 326 | s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 327 | #endif |
| 328 | } |
| 329 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 330 | static inline void exynos4_default_sdhci1(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 331 | { |
| 332 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 333 | s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 334 | #endif |
| 335 | } |
| 336 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 337 | static inline void exynos4_default_sdhci2(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 338 | { |
| 339 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 340 | s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 341 | #endif |
| 342 | } |
| 343 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 344 | static inline void exynos4_default_sdhci3(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 345 | { |
| 346 | #ifdef CONFIG_S3C_DEV_HSMMC3 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 347 | s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 348 | #endif |
| 349 | } |
| 350 | |
| 351 | #else |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 352 | static inline void exynos4_default_sdhci0(void) { } |
| 353 | static inline void exynos4_default_sdhci1(void) { } |
| 354 | static inline void exynos4_default_sdhci2(void) { } |
| 355 | static inline void exynos4_default_sdhci3(void) { } |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 356 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 357 | #endif /* CONFIG_EXYNOS4_SETUP_SDHCI */ |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 358 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 359 | #endif /* __PLAT_S3C_SDHCI_H */ |