Exemplo n.º 1
0
void s3c6410_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

	switch (width) {
	/* Channel 0 supports 4 and 8-bit bus width */
	case 8:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PC11X_GPG1(3); gpio <= S5PC11X_GPG1(6); gpio++) {
			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
		}

		writel(0x3fc0, S5PC11X_GPG1DRV);

	case 0:
	case 1:
	case 4:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PC11X_GPG0(0); gpio <= S5PC11X_GPG0(6); gpio++) {
			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
		}

		writel(0x3fff, S5PC11X_GPG0DRV);

		/* Chip detect pin Pull up*/
		s3c_gpio_setpull(S5PC11X_GPG0(2), S3C_GPIO_PULL_UP);

		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}
}
Exemplo n.º 2
0
			.ngpio	= S5PC11X_GPIO_F2_NR,
			.label	= "GPF2",
		},
	}, {
		.base	= S5PC11X_GPF3_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PC11X_GPF3(0),
			.ngpio	= S5PC11X_GPIO_F3_NR,
			.label	= "GPF3",
		},
	}, {
		.base	= S5PC11X_GPG0_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PC11X_GPG0(0),
			.ngpio	= S5PC11X_GPIO_G0_NR,
			.label	= "GPG0",
		},
	}, {
		.base	= S5PC11X_GPG1_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PC11X_GPG1(0),
			.ngpio	= S5PC11X_GPIO_G1_NR,
			.label	= "GPG1",
		},
	}, {
		.base	= S5PC11X_GPG2_BASE,
		.config	= &gpio_cfg,
		.chip	= {