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 | |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 21 | #include <plat/devs.h> |
| 22 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 23 | struct platform_device; |
| 24 | struct mmc_host; |
| 25 | struct mmc_card; |
| 26 | struct mmc_ios; |
| 27 | |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 28 | enum 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 Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 36 | /** |
| 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 Chung | 2541901 | 2012-02-07 15:59:01 +0900 | [diff] [blame] | 40 | * @host_caps2: The second standard MMC host capabilities bit field. |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 41 | * @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 Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 54 | * @cfg_gpio: Configure the GPIO for a specific card bit-width |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 55 | * |
| 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 | */ |
| 60 | struct s3c_sdhci_platdata { |
| 61 | unsigned int max_width; |
| 62 | unsigned int host_caps; |
Jaehoon Chung | 2541901 | 2012-02-07 15:59:01 +0900 | [diff] [blame] | 63 | unsigned int host_caps2; |
Sangwook Lee | 92df954 | 2011-12-07 22:49:29 -0500 | [diff] [blame] | 64 | unsigned int pm_caps; |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 65 | enum cd_types cd_type; |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 66 | |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 67 | 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 Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 74 | void (*cfg_gpio)(struct platform_device *dev, int width); |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 75 | }; |
| 76 | |
Banajit Goswami | 5e8e0a1 | 2011-08-18 20:32:01 +0900 | [diff] [blame] | 77 | /* 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 | */ |
| 81 | extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd, |
| 82 | struct s3c_sdhci_platdata *set); |
| 83 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 84 | /** |
| 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 | */ |
| 92 | extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd); |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 93 | extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd); |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 94 | extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd); |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 95 | extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd); |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 96 | |
| 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 Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 101 | extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata; |
| 102 | extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 103 | extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata; |
Hyuk Lee | b3c674b | 2010-06-10 15:22:16 +0900 | [diff] [blame] | 104 | extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata; |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 105 | |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 106 | /* Helper function availability */ |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 107 | |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 108 | extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 109 | extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 110 | extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 111 | extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 112 | extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 113 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 114 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 115 | extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 116 | extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 117 | extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 118 | extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 119 | extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w); |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 120 | extern void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 121 | extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 122 | extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
| 123 | extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w); |
Rajeshwari Shinde | ebc433c | 2011-12-26 16:28:54 +0900 | [diff] [blame] | 124 | extern void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 125 | extern void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 126 | extern void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
| 127 | extern void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 128 | |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 129 | /* S3C2416 SDHCI setup */ |
| 130 | |
| 131 | #ifdef CONFIG_S3C2416_SETUP_SDHCI |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 132 | static inline void s3c2416_default_sdhci0(void) |
| 133 | { |
| 134 | #ifdef CONFIG_S3C_DEV_HSMMC |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 135 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio; |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 136 | #endif /* CONFIG_S3C_DEV_HSMMC */ |
| 137 | } |
| 138 | |
| 139 | static inline void s3c2416_default_sdhci1(void) |
| 140 | { |
| 141 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 142 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio; |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 143 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ |
| 144 | } |
| 145 | |
| 146 | #else |
| 147 | static inline void s3c2416_default_sdhci0(void) { } |
| 148 | static inline void s3c2416_default_sdhci1(void) { } |
| 149 | |
| 150 | #endif /* CONFIG_S3C2416_SETUP_SDHCI */ |
Rajeshwari Shinde | ebc433c | 2011-12-26 16:28:54 +0900 | [diff] [blame] | 151 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 152 | /* S3C64XX SDHCI setup */ |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 153 | |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 154 | #ifdef CONFIG_S3C64XX_SETUP_SDHCI |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 155 | static inline void s3c6400_default_sdhci0(void) |
| 156 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 157 | #ifdef CONFIG_S3C_DEV_HSMMC |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 158 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 159 | #endif |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 160 | } |
| 161 | |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 162 | static inline void s3c6400_default_sdhci1(void) |
| 163 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 164 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 165 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 166 | #endif |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 167 | } |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 168 | |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 169 | static inline void s3c6400_default_sdhci2(void) |
| 170 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 171 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 172 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 173 | #endif |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 174 | } |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 175 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 176 | static inline void s3c6410_default_sdhci0(void) |
| 177 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 178 | #ifdef CONFIG_S3C_DEV_HSMMC |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 179 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 180 | #endif |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 181 | } |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 182 | |
| 183 | static inline void s3c6410_default_sdhci1(void) |
| 184 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 185 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 186 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 187 | #endif |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 188 | } |
Ben Dooks | 713e9de | 2008-10-31 16:29:19 +0000 | [diff] [blame] | 189 | |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 190 | static inline void s3c6410_default_sdhci2(void) |
| 191 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 192 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 193 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 194 | #endif |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 195 | } |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 196 | |
Ben Dooks | 713e9de | 2008-10-31 16:29:19 +0000 | [diff] [blame] | 197 | #else |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 198 | static inline void s3c6410_default_sdhci0(void) { } |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 199 | static inline void s3c6410_default_sdhci1(void) { } |
Marek Szyprowski | 6b34f49 | 2010-06-22 15:45:26 +0900 | [diff] [blame] | 200 | static inline void s3c6410_default_sdhci2(void) { } |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 201 | static inline void s3c6400_default_sdhci0(void) { } |
| 202 | static inline void s3c6400_default_sdhci1(void) { } |
Marek Szyprowski | 6b34f49 | 2010-06-22 15:45:26 +0900 | [diff] [blame] | 203 | static inline void s3c6400_default_sdhci2(void) { } |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 204 | |
| 205 | #endif /* CONFIG_S3C64XX_SETUP_SDHCI */ |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 206 | |
Rajeshwari Shinde | ebc433c | 2011-12-26 16:28:54 +0900 | [diff] [blame] | 207 | /* S5P64X0 SDHCI setup */ |
| 208 | |
| 209 | #ifdef CONFIG_S5P64X0_SETUP_SDHCI |
| 210 | static 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 | |
| 217 | static 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 | |
| 224 | static 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 | |
| 231 | static 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 |
| 239 | static inline void s5p64x0_default_sdhci0(void) { } |
| 240 | static inline void s5p64x0_default_sdhci1(void) { } |
| 241 | static inline void s5p6440_default_sdhci2(void) { } |
| 242 | static inline void s5p6450_default_sdhci2(void) { } |
| 243 | |
| 244 | #endif /* CONFIG_S5P64X0_SETUP_SDHCI */ |
| 245 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 246 | /* S5PC100 SDHCI setup */ |
| 247 | |
| 248 | #ifdef CONFIG_S5PC100_SETUP_SDHCI |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 249 | static inline void s5pc100_default_sdhci0(void) |
| 250 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 251 | #ifdef CONFIG_S3C_DEV_HSMMC |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 252 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 253 | #endif |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 254 | } |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 255 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 256 | static inline void s5pc100_default_sdhci1(void) |
| 257 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 258 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 259 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 260 | #endif |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 261 | } |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 262 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 263 | static inline void s5pc100_default_sdhci2(void) |
| 264 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 265 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 266 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 267 | #endif |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 268 | } |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 269 | |
| 270 | #else |
| 271 | static inline void s5pc100_default_sdhci0(void) { } |
| 272 | static inline void s5pc100_default_sdhci1(void) { } |
| 273 | static inline void s5pc100_default_sdhci2(void) { } |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 274 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 275 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ |
| 276 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 277 | /* S5PV210 SDHCI setup */ |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 278 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 279 | #ifdef CONFIG_S5PV210_SETUP_SDHCI |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 280 | static inline void s5pv210_default_sdhci0(void) |
| 281 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 282 | #ifdef CONFIG_S3C_DEV_HSMMC |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 283 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 284 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 285 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 286 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 287 | static inline void s5pv210_default_sdhci1(void) |
| 288 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 289 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 290 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 291 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 292 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 293 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 294 | static inline void s5pv210_default_sdhci2(void) |
| 295 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 296 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 297 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 298 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 299 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 300 | |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 301 | static inline void s5pv210_default_sdhci3(void) |
| 302 | { |
Kukjin Kim | d61bd77 | 2010-08-06 21:49:18 +0900 | [diff] [blame] | 303 | #ifdef CONFIG_S3C_DEV_HSMMC3 |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 304 | s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio; |
Kukjin Kim | d61bd77 | 2010-08-06 21:49:18 +0900 | [diff] [blame] | 305 | #endif |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 306 | } |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 307 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 308 | #else |
| 309 | static inline void s5pv210_default_sdhci0(void) { } |
| 310 | static inline void s5pv210_default_sdhci1(void) { } |
| 311 | static inline void s5pv210_default_sdhci2(void) { } |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 312 | static inline void s5pv210_default_sdhci3(void) { } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 313 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 314 | #endif /* CONFIG_S5PV210_SETUP_SDHCI */ |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 315 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 316 | /* EXYNOS4 SDHCI setup */ |
| 317 | #ifdef CONFIG_EXYNOS4_SETUP_SDHCI |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 318 | static inline void exynos4_default_sdhci0(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 319 | { |
| 320 | #ifdef CONFIG_S3C_DEV_HSMMC |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 321 | s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 322 | #endif |
| 323 | } |
| 324 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 325 | static inline void exynos4_default_sdhci1(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 326 | { |
| 327 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 328 | s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 329 | #endif |
| 330 | } |
| 331 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 332 | static inline void exynos4_default_sdhci2(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 333 | { |
| 334 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 335 | s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 336 | #endif |
| 337 | } |
| 338 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 339 | static inline void exynos4_default_sdhci3(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 340 | { |
| 341 | #ifdef CONFIG_S3C_DEV_HSMMC3 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 342 | s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 343 | #endif |
| 344 | } |
| 345 | |
| 346 | #else |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 347 | static inline void exynos4_default_sdhci0(void) { } |
| 348 | static inline void exynos4_default_sdhci1(void) { } |
| 349 | static inline void exynos4_default_sdhci2(void) { } |
| 350 | static inline void exynos4_default_sdhci3(void) { } |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 351 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 352 | #endif /* CONFIG_EXYNOS4_SETUP_SDHCI */ |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 353 | |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 354 | static 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 Kamat | 8d67ec8 | 2013-02-12 10:27:52 -0800 | [diff] [blame^] | 377 | default: |
| 378 | break; |
Thomas Abraham | 8482c81 | 2012-04-14 08:04:46 -0700 | [diff] [blame] | 379 | } |
| 380 | } |
| 381 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 382 | #endif /* __PLAT_S3C_SDHCI_H */ |