예제 #1
0
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
    unsigned int gpio;

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

    case 0:
    case 1:
    case 4:
        if (machine_is_herring() && herring_is_cdma_wimax_dev())
            break;
        /* Set all the necessary GPIO function and pull up/down */
        for (gpio = S5PV210_GPG2(0); gpio <= S5PV210_GPG2(6); gpio++) {
            if (gpio != S5PV210_GPG2(2)) {
                s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
                s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
            }
            s3c_gpio_set_drvstrength(gpio, DRVSTR);
        }
        break;
    default:
        printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
    }
}
예제 #2
0
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

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

	case 0:
	case 1:
	case 4:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PV210_GPG2(0); gpio <= S5PV210_GPG2(6); gpio++) {
			if (gpio != S5PV210_GPG2(2)) {
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
			}
			s3c_gpio_set_drvstrength(gpio, S3C_GPIO_DRVSTR_2X);
		}
		/* Chip detect pin Pull up -> none*/
		s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_NONE);
		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}
}
예제 #3
0
void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

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

		writel(0x2aaa, S5PV210_GPG3DRV);

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

		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}
}
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

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

		gpio = readl(S5PV210_GPG3DRV);
		writel(gpio | 0x2a80, S5PV210_GPG3DRV);
	case 0:
	case 1:
	case 4:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PV210_GPG2(0); gpio <= S5PV210_GPG2(6); gpio++) {
			if (gpio != S5PV210_GPG2(2)) {
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
			}
		}

		writel(0x2aaa, S5PV210_GPG2DRV);

		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}
}
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

	/* Set all the necessary GPG2[0:1] pins to special-function 2 */
	for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	}

	switch (width) {
	case 8:
		/* Data pin GPG3[3:6] to special-function 3 */
		for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) {
			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
		}
	case 4:
		/* Data pin GPG2[3:6] to special-function 2 */
		for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) {
			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
		}
	default:
		break;
	}

	s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP);
	s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2));
}
예제 #6
0
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

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

		gpio = readl(S5PV210_GPG3DRV);
		writel(gpio | 0x2a80, S5PV210_GPG3DRV);
	case 0:
	case 1:
	case 4:
//[NAGSM_Android_HDLNC_SDcard_Seo jaewoong_20101019 : SD card Gpio pull-up setting
	#if defined(CONFIG_SIDEKICK_VER_B0)
		for (gpio = S5PV210_GPG2(0); gpio <= S5PV210_GPG2(6); gpio++) {
			if(gpio != S5PV210_GPG2(2) && gpio != S5PV210_GPG2(0)) {	
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);			
			}
			else if(gpio == S5PV210_GPG2(0)){							
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
			}
		}
		#else
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PV210_GPG2(0); gpio <= S5PV210_GPG2(6); gpio++) {
			if(gpio != S5PV210_GPG2(2)) {
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
			}
		}
		#endif
//]NAGSM_Android_HDLNC_SDcard_Seo jaewoong_20101019 : SD card Gpio pull-up setting

		writel(0x2aaa, S5PV210_GPG2DRV);

		/* Chip detect pin Pull up -> none*/
		s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_NONE);

		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}
}
void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
{
	struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;

	/* Set all the necessary GPG3[0:1] pins to special-function 2 */
	s3c_gpio_cfgrange_nopull(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2));

	/* Data pin GPG3[3:6] to special-function 2 */
	s3c_gpio_cfgrange_nopull(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2));

	if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
		s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
		s3c_gpio_cfgpin(S5PV210_GPG3(2), S3C_GPIO_SFN(2));
	}
}
예제 #8
0
int hkdkc110_5V_power(int onoff)
{
	/* 5V */
	gpio_request(S5PV210_GPG3(4), "GPG3");
	s3c_gpio_setpull(S5PV210_GPG3(4), S3C_GPIO_PULL_NONE);

	if(onoff)	gpio_direction_output(S5PV210_GPG3(4), 1);
	else		gpio_direction_output(S5PV210_GPG3(4), 0);

	gpio_free(S5PV210_GPG3(4));

	printk("%s: status %d\n",__FUNCTION__,onoff);
	
	return 0;
}
예제 #9
0
void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

	switch (width) {
	/* Channel 3 supports 4-bit bus width */
	case 0:
	case 1:
	case 4:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PV210_GPG3(0); gpio <= S5PV210_GPG3(6); gpio++) {
			if (gpio != S5PV210_GPG3(2)) {
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
			}
			s3c_gpio_set_drvstrength(gpio, S3C_GPIO_DRVSTR_3X);
		}
		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}
}
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;
#if defined(CONFIG_MACH_P1_CDMA)
	unsigned int memory_enable;
	memory_enable = S5PV210_GPJ1(1);
#endif

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

	case 0:
	case 1:
	case 4:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PV210_GPG2(0); gpio <= S5PV210_GPG2(6); gpio++) {
			if (gpio != S5PV210_GPG2(2)) {
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
			}
			s3c_gpio_set_drvstrength(gpio, S3C_GPIO_DRVSTR_2X);
		}
		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}
#if defined(CONFIG_MACH_P1_CDMA)
	s3c_gpio_cfgpin(memory_enable, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(memory_enable, S3C_GPIO_PULL_NONE);
	gpio_set_value(memory_enable, 1);
#endif
}
예제 #11
0
int s3cfb_lcd_on(struct platform_device *pdev)
{
	int err;
	
	printk("LCD.....on\n");

	//GPC1_0 -->LCD 3.3V enable
	err = gpio_request(S5PV210_GPC1(0), "GPC1");
	if (err) {
		printk(KERN_ERR "failed to request GPH0 for "
			"LVDS chip enable\n");
		return err;
	}

	gpio_direction_output(S5PV210_GPC1(0), 1);
	gpio_set_value(S5PV210_GPC1(0), 1);
	gpio_free(S5PV210_GPC1(0));
	
#ifdef CONFIG_FB_BYD_8688
	//GPG3_6 -->PINCTL
	err = gpio_request(S5PV210_GPG3(6), "GPG3");
	if (err) {
		printk(KERN_ERR "failed to request GPH0 for "
			"LVDS chip enable\n");
		return err;
	}

	gpio_direction_output(S5PV210_GPG3(6), 1);
	gpio_set_value(S5PV210_GPG3(6), 1);
	gpio_free(S5PV210_GPG3(6));
	
	//GPG3_4 -->VCOM enable
	err = gpio_request(S5PV210_GPG3(4), "GPG3");
	if (err) {
		printk(KERN_ERR "failed to request GPH0 for "
			"LVDS chip enable\n");
		return err;
	}
	gpio_direction_input(S5PV210_GPG3(4));

	//gpio_direction_output(S5PV210_GPG3(4), 0);
	//gpio_set_value(S5PV210_GPG3(4), 0);
	gpio_free(S5PV210_GPG3(4));
#endif



	return 0;
}
static void init_hw(void)
{
	if (gpio_is_valid(_3_GPIO_TOUCH_EN)) {
		if (gpio_request(_3_GPIO_TOUCH_EN, "MP03"))
			printk(KERN_ERR "Filed to request _3_GPIO_TOUCH_EN!\n");
		gpio_direction_output(_3_GPIO_TOUCH_EN, GPIO_LEVEL_HIGH);
	}

	if (gpio_is_valid(_3_GPIO_TOUCH_CE)) {
		if (gpio_request(_3_GPIO_TOUCH_CE, "MP03"))
			printk(KERN_ERR "Filed to request _3_GPIO_TOUCH_CE!\n");
		gpio_direction_output(_3_GPIO_TOUCH_CE, GPIO_LEVEL_HIGH);
	}

	msleep(200);
	s3c_gpio_setpull(_3_GPIO_TOUCH_INT, S3C_GPIO_PULL_NONE);
	s3c_gpio_cfgpin(S5PV210_GPG3(2), S3C_GPIO_SFN(0xf));
	irq_set_irq_type(IRQ_TOUCH_INT, IRQ_TYPE_LEVEL_LOW);
}
예제 #13
0
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
	struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;

	/* Set all the necessary GPG2[0:1] pins to special-function 2 */
	s5pv210_cfg_gpios(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2));

	switch (width) {
	case 8:
		/* Data pin GPG3[3:6] to special-function 3 */
		s5pv210_cfg_gpios(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3));
	case 4:
		/* Data pin GPG2[3:6] to special-function 2 */
		s5pv210_cfg_gpios(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2));
	default:
		break;
	}

	if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
		s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP);
		s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2));
	}
}
예제 #14
0
			.ngpio	= S5PV210_GPIO_G1_NR,
			.label	= "GPG1",
		},
	}, {
		.base	= S5PV210_GPG2_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PV210_GPG2(0),
			.ngpio	= S5PV210_GPIO_G2_NR,
			.label	= "GPG2",
		},
	}, {
		.base	= S5PV210_GPG3_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PV210_GPG3(0),
			.ngpio	= S5PV210_GPIO_G3_NR,
			.label	= "GPG3",
		},
	}, {
		.base	= S5PV210_GPH0_BASE,
		.config	= &gpio_cfg_noint,
		.chip	= {
			.base	= S5PV210_GPH0(0),
			.ngpio	= S5PV210_GPIO_H0_NR,
			.label	= "GPH0",
		},
	}, {
		.base	= S5PV210_GPH1_BASE,
		.config	= &gpio_cfg_noint,
		.chip	= {
void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;
#if defined (CONFIG_TARGET_LOCALE_EUR) || defined(CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined(CONFIG_TARGET_LOCALE_VZW) || defined(CONFIG_TARGET_LOCALE_USAGSM)
	if (HWREV >= 12) {
#else /* CONFIG_TARGET_LOCALE_KOR */
	if (HWREV >= 10 && HWREV != 17) {
#endif /* CONFIG_TARGET_LOCALE */
		switch (width) {
		/* Channel 3 supports 4-bit bus width */
		case 0:
		case 1:
		case 4:
			/* Set all the necessary GPIO function and pull up/down */
			for (gpio = S5PV210_GPG3(0); gpio <= S5PV210_GPG3(6); gpio++) {
				if (gpio != S5PV210_GPG3(2)) {
					s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
					s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
				}
			}

			writel(0x2aaa, S5PV210_GPG3DRV);

			/* Chip detect pin Pull up*/
			/* S5PV210_GPG3(2) is WLAN_reset, Chip detect pin is not required. */
//			s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);

			break;
		default:
			printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
		}
	}
}

#define S3C_SDHCI_CTRL3_FCSELTX_INVERT  (0)
#define S3C_SDHCI_CTRL3_FCSELTX_BASIC   (S3C_SDHCI_CTRL3_FCSEL3 | S3C_SDHCI_CTRL3_FCSEL2)
#define S3C_SDHCI_CTRL3_FCSELRX_INVERT  (0)
#define S3C_SDHCI_CTRL3_FCSELRX_BASIC   (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0)

void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
				    void __iomem *r,
				    struct mmc_ios *ios,
				    struct mmc_card *card)
{
	u32 ctrl2;
	u32 ctrl3;

	ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
	ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
	ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
		  S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
		  S3C_SDHCI_CTRL2_DFCNT_NONE |
		  S3C_SDHCI_CTRL2_ENCLKOUTHOLD);

	if (ios->clock <= (400 * 1000)) {
		ctrl2 &= ~(S3C_SDHCI_CTRL2_ENFBCLKTX | S3C_SDHCI_CTRL2_ENFBCLKRX);
		ctrl3 = 0;
	} else {
		u32 range_start;
		u32 range_end;

		ctrl2 |= S3C_SDHCI_CTRL2_ENFBCLKTX | S3C_SDHCI_CTRL2_ENFBCLKRX;

		if (card->type == MMC_TYPE_MMC)  /* MMC */
			range_start = 20 * 1000 * 1000;
		else    /* SD, SDIO */
			range_start = 25 * 1000 * 1000;

		range_end = 37 * 1000 * 1000;

		if ((ios->clock > range_start) && (ios->clock < range_end)) {
			ctrl3 = S3C_SDHCI_CTRL3_FCSELTX_BASIC |
				S3C_SDHCI_CTRL3_FCSELRX_BASIC;
		} else {
#if defined (CONFIG_TARGET_LOCALE_EUR) || defined (CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined (CONFIG_TARGET_LOCALE_USAGSM)
			if (card->type == MMC_TYPE_SD)
				ctrl3 = S3C_SDHCI_CTRL3_FCSELTX_BASIC |
					S3C_SDHCI_CTRL3_FCSELRX_BASIC;
			else
#endif /* CONFIG_TARGET_LOCALE_EUR */
				ctrl3 = S3C_SDHCI_CTRL3_FCSELTX_BASIC |
					S3C_SDHCI_CTRL3_FCSELRX_INVERT;
		}
	}

	writel(ctrl2, r + S3C_SDHCI_CONTROL2);
	writel(ctrl3, r + S3C_SDHCI_CONTROL3);
}