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 | 19206b1 | 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. |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 43 | * @cd_type: Type of Card Detection method (see cd_types enum above) |
Jeongbae Seo | 28c80aa | 2010-10-08 18:03:27 +0900 | [diff] [blame] | 44 | * @clk_type: Type of clock divider method (see clk_types enum above) |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 45 | * @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 Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 57 | * @cfg_gpio: Configure the GPIO for a specific card bit-width |
| 58 | * @cfg_card: Configure the interface for a specific card and speed. This |
| 59 | * is necessary the controllers and/or GPIO blocks require the |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 60 | * changing of driver-strength and other controls dependent on |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 61 | * the card and speed of operation. |
| 62 | * |
| 63 | * Initialisation data specific to either the machine or the platform |
| 64 | * for the device driver to use or call-back when configuring gpio or |
| 65 | * card speed information. |
| 66 | */ |
| 67 | struct s3c_sdhci_platdata { |
| 68 | unsigned int max_width; |
| 69 | unsigned int host_caps; |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 70 | enum cd_types cd_type; |
Jeongbae Seo | 28c80aa | 2010-10-08 18:03:27 +0900 | [diff] [blame] | 71 | enum clk_types clk_type; |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 72 | |
| 73 | char **clocks; /* set of clock sources */ |
| 74 | |
Marek Szyprowski | 19206b1 | 2010-07-23 09:27:18 +0900 | [diff] [blame] | 75 | int ext_cd_gpio; |
| 76 | bool ext_cd_gpio_invert; |
| 77 | int (*ext_cd_init)(void (*notify_func)(struct platform_device *, |
| 78 | int state)); |
| 79 | int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *, |
| 80 | int state)); |
| 81 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 82 | void (*cfg_gpio)(struct platform_device *dev, int width); |
| 83 | void (*cfg_card)(struct platform_device *dev, |
| 84 | void __iomem *regbase, |
| 85 | struct mmc_ios *ios, |
| 86 | struct mmc_card *card); |
| 87 | }; |
| 88 | |
| 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); |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 129 | |
Yauhen Kharuzhy | c29cfa6 | 2010-12-17 14:42:09 +0900 | [diff] [blame] | 130 | /* S3C2416 SDHCI setup */ |
| 131 | |
| 132 | #ifdef CONFIG_S3C2416_SETUP_SDHCI |
| 133 | extern char *s3c2416_hsmmc_clksrcs[4]; |
| 134 | |
| 135 | extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev, |
| 136 | void __iomem *r, |
| 137 | struct mmc_ios *ios, |
| 138 | struct mmc_card *card); |
| 139 | |
| 140 | static inline void s3c2416_default_sdhci0(void) |
| 141 | { |
| 142 | #ifdef CONFIG_S3C_DEV_HSMMC |
| 143 | s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs; |
| 144 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio; |
| 145 | s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card; |
| 146 | #endif /* CONFIG_S3C_DEV_HSMMC */ |
| 147 | } |
| 148 | |
| 149 | static inline void s3c2416_default_sdhci1(void) |
| 150 | { |
| 151 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
| 152 | s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs; |
| 153 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio; |
| 154 | s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card; |
| 155 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ |
| 156 | } |
| 157 | |
| 158 | #else |
| 159 | static inline void s3c2416_default_sdhci0(void) { } |
| 160 | static inline void s3c2416_default_sdhci1(void) { } |
| 161 | |
| 162 | #endif /* CONFIG_S3C2416_SETUP_SDHCI */ |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 163 | /* S3C64XX SDHCI setup */ |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 164 | |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 165 | #ifdef CONFIG_S3C64XX_SETUP_SDHCI |
| 166 | extern char *s3c64xx_hsmmc_clksrcs[4]; |
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 | extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, |
| 169 | void __iomem *r, |
| 170 | struct mmc_ios *ios, |
| 171 | struct mmc_card *card); |
| 172 | |
| 173 | static inline void s3c6400_default_sdhci0(void) |
| 174 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 175 | #ifdef CONFIG_S3C_DEV_HSMMC |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 176 | s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 177 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
| 178 | s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 179 | #endif |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 180 | } |
| 181 | |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 182 | static inline void s3c6400_default_sdhci1(void) |
| 183 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 184 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 185 | s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 186 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
| 187 | s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 188 | #endif |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 189 | } |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 190 | |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 191 | static inline void s3c6400_default_sdhci2(void) |
| 192 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 193 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 194 | s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 195 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
| 196 | s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 197 | #endif |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 198 | } |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 199 | |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 200 | extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev, |
| 201 | void __iomem *r, |
| 202 | struct mmc_ios *ios, |
| 203 | struct mmc_card *card); |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 204 | |
| 205 | static inline void s3c6410_default_sdhci0(void) |
| 206 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 207 | #ifdef CONFIG_S3C_DEV_HSMMC |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 208 | s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 209 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 210 | s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 211 | #endif |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 212 | } |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 213 | |
| 214 | static inline void s3c6410_default_sdhci1(void) |
| 215 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 216 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 217 | s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
Ben Dooks | 4faf6867 | 2009-03-25 11:01:24 +0000 | [diff] [blame] | 218 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 219 | s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 220 | #endif |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 221 | } |
Ben Dooks | 713e9de | 2008-10-31 16:29:19 +0000 | [diff] [blame] | 222 | |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 223 | static inline void s3c6410_default_sdhci2(void) |
| 224 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 225 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 226 | s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs; |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 227 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 228 | s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 229 | #endif |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 230 | } |
Maurus Cuelenaere | 92b118f | 2009-11-23 13:34:46 +0100 | [diff] [blame] | 231 | |
Ben Dooks | 713e9de | 2008-10-31 16:29:19 +0000 | [diff] [blame] | 232 | #else |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 233 | static inline void s3c6410_default_sdhci0(void) { } |
Ben Dooks | a2205cd | 2008-10-31 16:14:39 +0000 | [diff] [blame] | 234 | static inline void s3c6410_default_sdhci1(void) { } |
Marek Szyprowski | 6b34f49 | 2010-06-22 15:45:26 +0900 | [diff] [blame] | 235 | static inline void s3c6410_default_sdhci2(void) { } |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 236 | static inline void s3c6400_default_sdhci0(void) { } |
| 237 | static inline void s3c6400_default_sdhci1(void) { } |
Marek Szyprowski | 6b34f49 | 2010-06-22 15:45:26 +0900 | [diff] [blame] | 238 | static inline void s3c6400_default_sdhci2(void) { } |
Ben Dooks | 2f6c2ac | 2010-01-26 10:38:52 +0900 | [diff] [blame] | 239 | |
| 240 | #endif /* CONFIG_S3C64XX_SETUP_SDHCI */ |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 241 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 242 | /* S5PC100 SDHCI setup */ |
| 243 | |
| 244 | #ifdef CONFIG_S5PC100_SETUP_SDHCI |
| 245 | extern char *s5pc100_hsmmc_clksrcs[4]; |
| 246 | |
| 247 | extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev, |
| 248 | void __iomem *r, |
| 249 | struct mmc_ios *ios, |
| 250 | struct mmc_card *card); |
| 251 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 252 | static inline void s5pc100_default_sdhci0(void) |
| 253 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 254 | #ifdef CONFIG_S3C_DEV_HSMMC |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 255 | s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
| 256 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio; |
| 257 | s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; |
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.clocks = s5pc100_hsmmc_clksrcs; |
| 265 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio; |
| 266 | s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; |
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 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 270 | static inline void s5pc100_default_sdhci2(void) |
| 271 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 272 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 273 | s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs; |
| 274 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio; |
| 275 | s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 276 | #endif |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 277 | } |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 278 | |
| 279 | #else |
| 280 | static inline void s5pc100_default_sdhci0(void) { } |
| 281 | static inline void s5pc100_default_sdhci1(void) { } |
| 282 | static inline void s5pc100_default_sdhci2(void) { } |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 283 | |
Kyungmin Park | 86cd4f5 | 2009-11-17 08:41:23 +0100 | [diff] [blame] | 284 | #endif /* CONFIG_S5PC100_SETUP_SDHCI */ |
| 285 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 286 | /* S5PV210 SDHCI setup */ |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 287 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 288 | #ifdef CONFIG_S5PV210_SETUP_SDHCI |
| 289 | extern char *s5pv210_hsmmc_clksrcs[4]; |
| 290 | |
| 291 | extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev, |
| 292 | void __iomem *r, |
| 293 | struct mmc_ios *ios, |
| 294 | struct mmc_card *card); |
| 295 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 296 | static inline void s5pv210_default_sdhci0(void) |
| 297 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 298 | #ifdef CONFIG_S3C_DEV_HSMMC |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 299 | s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
| 300 | s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio; |
| 301 | s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 302 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 303 | } |
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 | static inline void s5pv210_default_sdhci1(void) |
| 306 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 307 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 308 | s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
| 309 | s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio; |
| 310 | s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 311 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 312 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 313 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 314 | static inline void s5pv210_default_sdhci2(void) |
| 315 | { |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 316 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 317 | s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
| 318 | s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio; |
| 319 | s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 320 | #endif |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 321 | } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 322 | |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 323 | static inline void s5pv210_default_sdhci3(void) |
| 324 | { |
Kukjin Kim | d61bd77 | 2010-08-06 21:49:18 +0900 | [diff] [blame] | 325 | #ifdef CONFIG_S3C_DEV_HSMMC3 |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 326 | s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs; |
| 327 | s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio; |
| 328 | s3c_hsmmc3_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card; |
Kukjin Kim | d61bd77 | 2010-08-06 21:49:18 +0900 | [diff] [blame] | 329 | #endif |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 330 | } |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 331 | |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 332 | #else |
| 333 | static inline void s5pv210_default_sdhci0(void) { } |
| 334 | static inline void s5pv210_default_sdhci1(void) { } |
| 335 | static inline void s5pv210_default_sdhci2(void) { } |
Hyuk Lee | 976a62f | 2010-06-14 10:18:56 +0900 | [diff] [blame] | 336 | static inline void s5pv210_default_sdhci3(void) { } |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 337 | |
Kukjin Kim | 88eb715 | 2010-07-29 22:18:45 +0900 | [diff] [blame] | 338 | #endif /* CONFIG_S5PV210_SETUP_SDHCI */ |
Marek Szyprowski | e6f66a9 | 2010-05-20 08:13:07 +0200 | [diff] [blame] | 339 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 340 | /* EXYNOS4 SDHCI setup */ |
| 341 | #ifdef CONFIG_EXYNOS4_SETUP_SDHCI |
| 342 | extern char *exynos4_hsmmc_clksrcs[4]; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 343 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 344 | extern void exynos4_setup_sdhci_cfg_card(struct platform_device *dev, |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 345 | void __iomem *r, |
| 346 | struct mmc_ios *ios, |
| 347 | struct mmc_card *card); |
| 348 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 349 | static inline void exynos4_default_sdhci0(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 350 | { |
| 351 | #ifdef CONFIG_S3C_DEV_HSMMC |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 352 | s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs; |
| 353 | s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio; |
| 354 | s3c_hsmmc0_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 355 | #endif |
| 356 | } |
| 357 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 358 | static inline void exynos4_default_sdhci1(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 359 | { |
| 360 | #ifdef CONFIG_S3C_DEV_HSMMC1 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 361 | s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs; |
| 362 | s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio; |
| 363 | s3c_hsmmc1_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 364 | #endif |
| 365 | } |
| 366 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 367 | static inline void exynos4_default_sdhci2(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 368 | { |
| 369 | #ifdef CONFIG_S3C_DEV_HSMMC2 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 370 | s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs; |
| 371 | s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio; |
| 372 | s3c_hsmmc2_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 373 | #endif |
| 374 | } |
| 375 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 376 | static inline void exynos4_default_sdhci3(void) |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 377 | { |
| 378 | #ifdef CONFIG_S3C_DEV_HSMMC3 |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 379 | s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs; |
| 380 | s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio; |
| 381 | s3c_hsmmc3_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card; |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 382 | #endif |
| 383 | } |
| 384 | |
| 385 | #else |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 386 | static inline void exynos4_default_sdhci0(void) { } |
| 387 | static inline void exynos4_default_sdhci1(void) { } |
| 388 | static inline void exynos4_default_sdhci2(void) { } |
| 389 | static inline void exynos4_default_sdhci3(void) { } |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 390 | |
Kukjin Kim | 3db3ae5 | 2011-02-14 16:22:36 +0900 | [diff] [blame] | 391 | #endif /* CONFIG_EXYNOS4_SETUP_SDHCI */ |
Hyuk Lee | 1036c3a | 2010-10-05 19:07:41 +0900 | [diff] [blame] | 392 | |
Ben Dooks | 5cc7fd8 | 2008-10-31 16:14:38 +0000 | [diff] [blame] | 393 | #endif /* __PLAT_S3C_SDHCI_H */ |