void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) { struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; /* */ if (soc_is_s5p6450()) s3c_gpio_cfgrange_nopull(S5P6450_GPH(0), 2, S3C_GPIO_SFN(2)); else s3c_gpio_cfgrange_nopull(S5P6440_GPH(0), 2 , S3C_GPIO_SFN(2)); switch (width) { case 8: /* */ if (soc_is_s5p6450()) s3c_gpio_cfgrange_nopull(S5P6450_GPH(6), 4, S3C_GPIO_SFN(2)); else s3c_gpio_cfgrange_nopull(S5P6440_GPH(6), 4, S3C_GPIO_SFN(2)); case 4: /* */ if (soc_is_s5p6450()) s3c_gpio_cfgrange_nopull(S5P6450_GPH(2), 4, S3C_GPIO_SFN(2)); else s3c_gpio_cfgrange_nopull(S5P6440_GPH(2), 4, S3C_GPIO_SFN(2)); default: break; } /* */ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { if (soc_is_s5p6450()) { s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(3)); } else { s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(3)); } } }
void s5p6450_setup_mshci_cfg_gpio(struct platform_device *dev, int width) { unsigned int gpio; /* Set all the necessary GPG[7:8] pins to special-function 2 */ for (gpio = S5P6450_GPG(7); gpio < S5P6450_GPG(9); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } switch(width) { case 8: /* Data pin GPQ[6:9] to special-function 3 */ for (gpio = S5P6450_GPQ(6); gpio <= S5P6450_GPQ(9); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } case 4: /* Data pin GPG[9:12] to special-function 2 */ for (gpio = S5P6450_GPG(9); gpio <= S5P6450_GPG(12); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } } /* GPG[13] special-funtion 2 : MMC3 CDn */ s3c_gpio_cfgpin(S5P6450_GPG(13), S3C_GPIO_SFN(2)); s3c_gpio_setpull(S5P6450_GPG(13), S3C_GPIO_PULL_UP); }
void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) { struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; /* */ if (soc_is_s5p6450()) s3c_gpio_cfgrange_nopull(S5P6450_GPG(0), 2 + width, S3C_GPIO_SFN(2)); else s3c_gpio_cfgrange_nopull(S5P6440_GPG(0), 2 + width, S3C_GPIO_SFN(2)); /* */ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { if (soc_is_s5p6450()) { s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(2)); } else { s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(2)); } } }
.base = S5P6450_GPK_BASE, .config = &s5p64x0_gpio_cfgs[1], .chip = { .base = S5P6450_GPK(0), .ngpio = S5P6450_GPIO_K_NR, .label = "GPK", }, }, }; static struct s3c_gpio_chip s5p6450_gpio_4bit2[] = { { .base = S5P64X0_GPG_BASE + 0x4, .config = &s5p64x0_gpio_cfgs[1], .chip = { .base = S5P6450_GPG(0), .ngpio = S5P6450_GPIO_G_NR, .label = "GPG", }, }, { .base = S5P64X0_GPH_BASE + 0x4, .config = &s5p64x0_gpio_cfgs[1], .chip = { .base = S5P6450_GPH(0), .ngpio = S5P6450_GPIO_H_NR, .label = "GPH", }, }, }; static struct s3c_gpio_chip s5p6450_gpio_rbank_4bit2[] = {
void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) { /* */ s3c_gpio_cfgrange_nopull(S5P6450_GPG(7), 2 + width, S3C_GPIO_SFN(3)); }