1
2
3
4
5
6
7
8
9
10
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/platform_device.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18#include <linux/mmc/host.h>
19#include <linux/mmc/card.h>
20
21#include <plat/gpio-cfg.h>
22#include <plat/regs-sdhci.h>
23#include <plat/sdhci.h>
24
25void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
26{
27 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
28 unsigned int num;
29
30 num = width;
31
32 if (width == 8)
33 num = width - 2;
34
35
36 s3c_gpio_cfgrange_nopull(S5PC100_GPG0(0), 2 + num, S3C_GPIO_SFN(2));
37
38 if (width == 8)
39 s3c_gpio_cfgrange_nopull(S5PC100_GPG1(0), 2, S3C_GPIO_SFN(2));
40
41 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
42 s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
43 s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
44 }
45}
46
47void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
48{
49 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
50
51
52 s3c_gpio_cfgrange_nopull(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2));
53
54 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
55 s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
56 s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
57 }
58}
59
60void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
61{
62 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
63
64
65 s3c_gpio_cfgrange_nopull(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2));
66
67 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
68 s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
69 s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
70 }
71}
72