diff options
Diffstat (limited to 'arch/arm/mach-s5pv210/setup-sdhci-gpio.c')
| -rw-r--r-- | arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c index 143bfec1e05f..9f0f63ddd66a 100644 --- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c +++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |||
| @@ -15,15 +15,17 @@ | |||
| 15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
| 18 | #include <linux/gpio.h> | ||
| 18 | #include <linux/mmc/host.h> | 19 | #include <linux/mmc/host.h> |
| 19 | #include <linux/mmc/card.h> | 20 | #include <linux/mmc/card.h> |
| 20 | 21 | ||
| 21 | #include <mach/gpio.h> | ||
| 22 | #include <plat/gpio-cfg.h> | 22 | #include <plat/gpio-cfg.h> |
| 23 | #include <plat/regs-sdhci.h> | 23 | #include <plat/regs-sdhci.h> |
| 24 | #include <plat/sdhci.h> | ||
| 24 | 25 | ||
| 25 | void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | 26 | void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) |
| 26 | { | 27 | { |
| 28 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | ||
| 27 | unsigned int gpio; | 29 | unsigned int gpio; |
| 28 | 30 | ||
| 29 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ | 31 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ |
| @@ -48,12 +50,15 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | |||
| 48 | break; | 50 | break; |
| 49 | } | 51 | } |
| 50 | 52 | ||
| 51 | s3c_gpio_setpull(S5PV210_GPG0(2), S3C_GPIO_PULL_UP); | 53 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
| 52 | s3c_gpio_cfgpin(S5PV210_GPG0(2), S3C_GPIO_SFN(2)); | 54 | s3c_gpio_setpull(S5PV210_GPG0(2), S3C_GPIO_PULL_UP); |
| 55 | s3c_gpio_cfgpin(S5PV210_GPG0(2), S3C_GPIO_SFN(2)); | ||
| 56 | } | ||
| 53 | } | 57 | } |
| 54 | 58 | ||
| 55 | void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | 59 | void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) |
| 56 | { | 60 | { |
| 61 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | ||
| 57 | unsigned int gpio; | 62 | unsigned int gpio; |
| 58 | 63 | ||
| 59 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ | 64 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ |
| @@ -68,12 +73,15 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | |||
| 68 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 73 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
| 69 | } | 74 | } |
| 70 | 75 | ||
| 71 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); | 76 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
| 72 | s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2)); | 77 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); |
| 78 | s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2)); | ||
| 79 | } | ||
| 73 | } | 80 | } |
| 74 | 81 | ||
| 75 | void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | 82 | void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) |
| 76 | { | 83 | { |
| 84 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | ||
| 77 | unsigned int gpio; | 85 | unsigned int gpio; |
| 78 | 86 | ||
| 79 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ | 87 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ |
| @@ -99,8 +107,10 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | |||
| 99 | break; | 107 | break; |
| 100 | } | 108 | } |
| 101 | 109 | ||
| 102 | s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP); | 110 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
| 103 | s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2)); | 111 | s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP); |
| 112 | s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2)); | ||
| 113 | } | ||
| 104 | } | 114 | } |
| 105 | 115 | ||
| 106 | void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) | 116 | void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) |
