Exemplo n.º 1
0
void s3cfb_cfg_gpio(struct platform_device *pdev)
{
	int err;
	
	/* add by cym 20150120 */
#if 1
	err = gpio_request(EXYNOS4_GPC0(2), "VGA_EN");
        if (err) {
                printk(KERN_ERR "failed to request VGA_EN\n");
                return err;
        }

        gpio_direction_output(EXYNOS4_GPC0(2), 0);

        s3c_gpio_cfgpin(EXYNOS4_GPC0(2), S3C_GPIO_OUTPUT);
        gpio_free(EXYNOS4_GPC0(2));
	msleep(250);

        err = gpio_request(EXYNOS4_GPL0(4), "BK_VDD_EN");
        if (err) {
                printk(KERN_ERR "failed to request BK_VDD_EN\n");
                //return err;
        }

        gpio_direction_output(EXYNOS4_GPL0(4), 1);
        s3c_gpio_cfgpin(EXYNOS4_GPL0(4), S3C_GPIO_OUTPUT);
        gpio_free(EXYNOS4_GPL0(4));

        printk("(%s, %d): BK_VDD_ON\n", __FUNCTION__, __LINE__);
	msleep(100);
#endif
	s3cfb_gpio_setup_24bpp(EXYNOS4_GPF0(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
	s3cfb_gpio_setup_24bpp(EXYNOS4_GPF1(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
	s3cfb_gpio_setup_24bpp(EXYNOS4_GPF2(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
	s3cfb_gpio_setup_24bpp(EXYNOS4_GPF3(0), 4, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
#if 1	// TC4
	//LVDS_PWDN
	err = gpio_request(EXYNOS4_GPL1(0), "GPL1_0");
	if (err) {
		printk(KERN_ERR "failed to request GPL1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPL1(0), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPL1(0), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPL1(0));

	printk("(%s, %d): LCD_PWDN ON\n", __FUNCTION__, __LINE__);
#endif
}
Exemplo n.º 2
0
void exynos4_fimd0_gpio_setup_24bpp(void)
{
	unsigned int reg = 0;
	
#if defined(CONFIG_LCD_WA101S) || defined(CONFIG_LCD_LTE480WV)
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF0(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF1(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF2(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF3(0), 4, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
#elif defined(CONFIG_LCD_AMS369FG06)
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF0(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV1);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF1(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV1);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF2(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV1);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF3(0), 4, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV1);
#elif defined(CONFIG_LCD_LMS501KF03)
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF0(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV4);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF1(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV1);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF2(0), 8, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV1);
	exynos4_fimd0_cfg_gpios(EXYNOS4_GPF3(0), 4, S3C_GPIO_SFN(2), S5P_GPIO_DRVSTR_LV1);
#endif
	/*
	 * Set DISPLAY_CONTROL register for Display path selection.
	 *
	 * DISPLAY_CONTROL[1:0]
	 * ---------------------
	 *  00 | MIE
	 *  01 | MDINE
	 *  10 | FIMD : selected
	 *  11 | FIMD
	 */
	reg = __raw_readl(S3C_VA_SYS + 0x0210);
	reg |= (1 << 1);
	__raw_writel(reg, S3C_VA_SYS + 0x0210);

#if 1	// TC4
	//LVDS_PWDN
	err = gpio_request(EXYNOS4_GPL1(0), "GPL1_0");
	if (err) {
		printk(KERN_ERR "failed to request GPL1 for "
			"lcd power control\n");
		return ;
	}
	gpio_direction_output(EXYNOS4_GPL1(0), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPL1(0), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPL1(0));
#endif

	
}
Exemplo n.º 3
0
	{EXYNOS4_GPK3(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPK3(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(4), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(5), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(6), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},

	{EXYNOS4_GPL0(0), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL0(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL0(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL0(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	{EXYNOS4_GPL0(4), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	{EXYNOS4_GPL0(5), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL0(6), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL0(7), S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE},

	{EXYNOS4_GPL1(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL1(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL1(2), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},

	{EXYNOS4_GPL2(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(2), S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL2(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	{EXYNOS4_GPL2(4), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL2(5), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL2(6), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(7), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */

	{EXYNOS4_GPY0(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPY0(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPY0(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
Exemplo n.º 4
0
	{EXYNOS4210_GPJ1(1), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE,
		S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1}, /* NC */
	{EXYNOS4210_GPJ1(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE,
		S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1}, /* NC */
#endif

	{EXYNOS4_GPK1(1), S3C_GPIO_OUTPUT, S3C_GPIO_SETPIN_ZERO,
		S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1},
	{EXYNOS4_GPK2(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE,
		S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* PS_ALS_SDA_2.8V */
#if defined(CONFIG_TARGET_LOCALE_NA)
	/* GPIO_BT_EN */
	{EXYNOS4_GPL0(4), S3C_GPIO_OUTPUT, S3C_GPIO_SETPIN_ZERO,
		S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV4},
	/* GPIO_BT_nRST */
	{EXYNOS4_GPL1(0), S3C_GPIO_OUTPUT, S3C_GPIO_SETPIN_ZERO,
		S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV4},
#endif /*CONFIG_TARGET_LOCALE_NA*/

#if defined(CONFIG_TARGET_LOCALE_NA)
	/* PS_ALS_SCL_2.8V */
	{EXYNOS4_GPK3(2), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE,
		S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1},
	/* NC */
	/*BUCK2_EN for PMIC 8997*/
	{EXYNOS4_GPL0(6), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_ZERO,
		S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1},
	/*WLAN_EN*/
	{EXYNOS4_GPL1(2), S3C_GPIO_OUTPUT, S3C_GPIO_SETPIN_ZERO,
		S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV4},
	/*CHG_ING_N*/
    {EXYNOS4_GPK3(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
    {EXYNOS4_GPK3(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPK3(4), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPK3(5), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPK3(6), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},

    {EXYNOS4_GPL0(0), S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPL0(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
    {EXYNOS4_GPL0(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
    {EXYNOS4_GPL0(3), S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPL0(4), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE}, /* HDMI_EN */
    /*	{EXYNOS4_GPL0(5), S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE}, */
    {EXYNOS4_GPL0(6), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
    /*	{EXYNOS4_GPL0(7), S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE}, */

    {EXYNOS4_GPL1(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPL1(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
    /*	{EXYNOS4_GPL1(2), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE}, */

    {EXYNOS4_GPL2(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
    {EXYNOS4_GPL2(1), S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPL2(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
    {EXYNOS4_GPL2(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
    {EXYNOS4_GPL2(4), S3C_GPIO_SLP_OUT1,  S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPL2(5), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
    {EXYNOS4_GPL2(6), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPL2(7), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},

    {EXYNOS4_GPX0(2), S3C_GPIO_SLP_INPUT,  S3C_GPIO_PULL_UP},/* PS_ALS_INT */
    {EXYNOS4_GPY0(0), S3C_GPIO_SLP_OUT1,  S3C_GPIO_PULL_NONE},
    {EXYNOS4_GPY0(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},/* NC */
Exemplo n.º 6
0
		},
	}, {
		.base   = (S5P_VA_GPIO2 + 0xC0),
		.eint_offset = 0x18,
		.group	= 20,
		.chip	= {
			.base	= EXYNOS4_GPL0(0),
			.ngpio	= EXYNOS4_GPIO_L0_NR,
			.label	= "GPL0",
		},
	}, {
		.base   = (S5P_VA_GPIO2 + 0xE0),
		.eint_offset = 0x1C,
		.group	= 21,
		.chip	= {
			.base	= EXYNOS4_GPL1(0),
			.ngpio	= EXYNOS4_GPIO_L1_NR,
			.label	= "GPL1",
		},
	}, {
		.base   = (S5P_VA_GPIO2 + 0x100),
		.eint_offset = 0x20,
		.group	= 22,
		.chip	= {
			.base	= EXYNOS4_GPL2(0),
			.ngpio	= EXYNOS4_GPIO_L2_NR,
			.label	= "GPL2",
		},
	}, {
		.base   = (S5P_VA_GPIO2 + 0x120),
		.config	= &gpio_cfg_noint,
Exemplo n.º 7
0
	REGULATOR_SUPPLY("vmmc", "dw_mmc"),
};

static struct regulator_init_data emmc_fixed_voltage_init_data = {
	.constraints		= {
		.name		= "VMEM_VDD_2.8V",
		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
	},
	.num_consumer_supplies	= ARRAY_SIZE(emmc_supplies),
	.consumer_supplies	= emmc_supplies,
};

static struct fixed_voltage_config emmc_fixed_voltage_config = {
	.supply_name		= "MASSMEMORY_EN (inverted)",
	.microvolts		= 2800000,
	.gpio			= EXYNOS4_GPL1(1),
	.enable_high		= false,
	.init_data		= &emmc_fixed_voltage_init_data,
};

static struct platform_device emmc_fixed_voltage = {
	.name			= "reg-fixed-voltage",
	.id			= FIXED_REG_ID_MMC,
	.dev			= {
		.platform_data	= &emmc_fixed_voltage_config,
	},
};

/* SD */
static struct s3c_sdhci_platdata nuri_hsmmc2_data __initdata = {
	.max_width		= 4,
Exemplo n.º 8
0
#if defined(CONFIG_SEC_MODEM)
	{EXYNOS4_GPL0(0),  S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* ACTIVE_STATE_HSIC */
#elif defined(CONFIG_QC_MODEM)
	{EXYNOS4_GPL0(0),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE}, /* MDM2AP_HSIC_READY */
#else
	{EXYNOS4_GPL0(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
#endif
#endif
	{EXYNOS4_GPL0(1),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE}, /* PS_ALS_SCL_1.8V */
	{EXYNOS4_GPL0(2),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE}, /* PS_ALS_SDA_1.8V */
	{EXYNOS4_GPL0(3),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC(IRDA_CONTROL) */
	{EXYNOS4_GPL0(4),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL0(6),  S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},

#if defined(CONFIG_TARGET_TAB3_WIFI8) || defined(CONFIG_TARGET_TAB3_LTE8)
	{EXYNOS4_GPL1(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
#else
#if defined(CONFIG_SEC_MODEM)
	{EXYNOS4_GPL1(0),  S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* PDA_ACTIVE */
#elif defined(CONFIG_QC_MODEM)
	{EXYNOS4_GPL1(0), S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE}, /* AP2MDM_STATUS */
#else
	{EXYNOS4_GPL1(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
#endif
#endif
	{EXYNOS4_GPL1(1),  S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* 3M_nRST */

	{EXYNOS4_GPL2(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
#if !defined(CONFIG_QC_MODEM) || defined(CONFIG_TARGET_TAB3_LTE8)
	{EXYNOS4_GPL2(1),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(2),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* GPS_EN */
Exemplo n.º 9
0
	{EXYNOS4_GPK3(0), S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPK3(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(4), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(5), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(6), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},

	{EXYNOS4_GPL0(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL0(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	{EXYNOS4_GPL0(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	{EXYNOS4_GPL0(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL0(4), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL0(6), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},

	{EXYNOS4_GPL1(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL1(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */

	{EXYNOS4_GPL2(0), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	{EXYNOS4_GPL2(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(4), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(5),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL2(6), S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL2(7), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	/* GPX1(0) VDDMIN (pda active) set to low at Sleep */
	{EXYNOS4_GPX1(0),  S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_DOWN},
	/* GPX3(2) T0 LTE HOST PORT PWR, hold previous level */
	{EXYNOS4_GPX3(2),  S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
#ifdef CONFIG_TARGET_LOCALE_EUR
Exemplo n.º 10
0
int s3cfb_backlight_off(struct platform_device *pdev)
{

	int err;

	//err = gpio_request(EXYNOS4_GPD0(1), "GPD0");
	//if (err) {
	//	printk(KERN_ERR "failed to request GPD0 for "
	//		"lcd backlight control\n");
	//	return err;
	//}
	/* modify by cym 20121017 */
#if 0
	gpio_direction_output(EXYNOS4_GPD0(1), 0);
	//gpio_free(EXYNOS4_GPD0(1));

		//LED_EN18
	err = gpio_request(EXYNOS4_GPC1(1), "GPC1_1");
	if (err) {
		printk(KERN_ERR "failed to request GPC1_1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC1(1), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC1(1));

	//VLED_EN
	err = gpio_request(EXYNOS4_GPC1(2), "GPC1_2");
	if (err) {
		printk(KERN_ERR "failed to request GPC1_2 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC1(2), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPC1(2), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC1(2));
	//VLED_ON
	err = gpio_request(EXYNOS4_GPC0(1), "GPC0_1");
	if (err) {
		printk(KERN_ERR "failed to request GPC0_1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC0(1), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPC0(1), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC0(1));
#else
	//gpio_direction_output(EXYNOS4_GPD0(1), 0);
	//gpio_free(EXYNOS4_GPD0(1));
	//printk("(%s, %d): LCD_PWM_OFF\n", __FUNCTION__, __LINE__);
#if 0	
	//TP1_EN
	err = gpio_request(EXYNOS4_GPL0(2), "TP1_EN");
	if (err) {
		printk(KERN_ERR "failed to request TP1_EN for "
			"I2C control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPL0(2), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPL0(2), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPL0(2));

	mdelay(5);
	printk("(%s, %d): TP1_EN_OFF\n", __FUNCTION__, __LINE__);
#endif
	//VLED_ON
#if 0
	err = gpio_request(EXYNOS4_GPC0(1), "GPC0_1");
	if (err) {
		printk(KERN_ERR "failed to request GPC0_1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC0(1), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPC0(1), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC0(1));
	printk("(%s, %d): VLED_OFF\n", __FUNCTION__, __LINE__);
#endif
#endif
	/* end modify */

	/* add by cym 20150120 */
#if 1
        err = gpio_request(EXYNOS4_GPD0(1), "GPD0_1");
        if (err) {
                printk(KERN_ERR "failed to request GPD0 for "
			"lcd backlight control\n");
                //return err;
        }

        gpio_direction_output(EXYNOS4_GPD0(1), 0);
        s3c_gpio_cfgpin(EXYNOS4_GPD0(1), S3C_GPIO_OUTPUT);
        gpio_free(EXYNOS4_GPD0(1));

        printk("(%s, %d): LCD_PWM_OFF\n", __FUNCTION__, __LINE__);
#endif
	
	//LVDS_PWDN
	err = gpio_request(EXYNOS4_GPL1(0), "GPL1_0");
	if (err) {
		printk(KERN_ERR "failed to request GPL1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPL1(0), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPL1(0), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPL1(0));

#if 0
        err = gpio_request_one(EXYNOS4_GPL1(1), 0, "GPL1_1");
        if (err) {
                printk(KERN_ERR "failed to request GPL1_1 for "
                                "4.3 LCD control\n");
                return err;
        }

        s3c_gpio_setpull(EXYNOS4_GPL1(1), S3C_GPIO_PULL_UP);
        gpio_set_value(EXYNOS4_GPL1(1), 1);

        gpio_free(EXYNOS4_GPL1(1));
#endif

	/* add by cym 20141125 */
        err = gpio_request(EXYNOS4_GPC0(2), "VGA_EN");
        if (err) {
                printk(KERN_ERR "failed to request VGA_EN\n");
                      
                return err;
        }

        gpio_direction_output(EXYNOS4_GPC0(2), 0);

        s3c_gpio_cfgpin(EXYNOS4_GPC0(2), S3C_GPIO_OUTPUT);
        gpio_free(EXYNOS4_GPC0(2));

        printk("(%s, %d): VGA_EN_OFF\n", __FUNCTION__, __LINE__);
        /* end add */

	/* add by cym 20150120 */
        err = gpio_request(EXYNOS4_GPL0(4), "BK_VDD_EN");
        if (err) {
                printk(KERN_ERR "failed to request BK_VDD_EN for\n");
                return err;
        }

        gpio_direction_output(EXYNOS4_GPL0(4), 0);

        s3c_gpio_cfgpin(EXYNOS4_GPL0(4), S3C_GPIO_OUTPUT);
        gpio_free(EXYNOS4_GPL0(4));

        printk("(%s, %d): BK_VDD_OFF\n", __FUNCTION__, __LINE__);
        /* end add */

	return 0;
}
Exemplo n.º 11
0
int s3cfb_backlight_on(struct platform_device *pdev)
{
	int err;

#if 0	
	//VLED_EN
	err = gpio_request(EXYNOS4_GPC1(2), "GPC1_2");
	if (err) {
		printk(KERN_ERR "failed to request GPC1_2 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC1(2), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPC1(2), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC1(2));

	mdelay(5);
	printk("(%s, %d): BK_LCD_EN\n", __FUNCTION__, __LINE__);
#endif
	/*modify by cym 20121017 */
#if 0
	//VLED_ON
	err = gpio_request(EXYNOS4_GPC0(1), "GPC0_1");
	if (err) {
		printk(KERN_ERR "failed to request GPC0_1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC0(1), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPC0(1), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC0(1));

	mdelay(5);
	//err = gpio_request(EXYNOS4_GPD0(1), "GPD0_1");
	if (err) {
		printk(KERN_ERR "failed to request GPD0 for "
			"lcd backlight control\n");
		//return err;
	}
#if !defined(CONFIG_BACKLIGHT_PWM)
	gpio_direction_output(EXYNOS4_GPD0(1), 1);
	gpio_free(EXYNOS4_GPD0(1));
#else

	gpio_direction_output(EXYNOS4_GPD0(1), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPD0(1), EXYNOS4_GPD_0_1_TOUT_1);

	//gpio_free(EXYNOS4_GPD0(1));
#endif
	mdelay(5);
	//LED_EN18
	err = gpio_request(EXYNOS4_GPC1(1), "GPC1_1");
	if (err) {
		printk(KERN_ERR "failed to request GPC1_1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC1(1), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC1(1));
	mdelay(5);
#else
	//VLED_ON
#if 0
	err = gpio_request(EXYNOS4_GPC0(1), "GPC0_1");
	if (err) {
		printk(KERN_ERR "failed to request GPC0_1 for "
			"lcd power control\n");
		return err;
	}
	gpio_direction_output(EXYNOS4_GPC0(1), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPC0(1), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPC0(1));
	printk("(%s, %d): VLED_ON\n", __FUNCTION__, __LINE__);
#endif	
	//mdelay(5);
        
	mdelay(250);
	//PWM
	err = gpio_request(EXYNOS4_GPD0(1), "GPD0_1");
	if (err) {
		printk(KERN_ERR "failed to request GPD0 for "
			"lcd backlight control\n");
		//return err;
	}
#if !defined(CONFIG_BACKLIGHT_PWM)
	gpio_direction_output(EXYNOS4_GPD0(1), 1);
	gpio_free(EXYNOS4_GPD0(1));
#else
/* modify by cym 20130417 for TSC2007 TouchScreen */
//#ifdef CONFIG_TOUCHSCREEN_TSC2007
//	gpio_direction_output(EXYNOS4_GPD0(1), 0);
//#else
	gpio_direction_output(EXYNOS4_GPD0(1), 0);

	s3c_gpio_cfgpin(EXYNOS4_GPD0(1), EXYNOS4_GPD_0_1_TOUT_1);

	gpio_free(EXYNOS4_GPD0(1));
	printk("(%s, %d): LCD_PWM_ON\n", __FUNCTION__, __LINE__);
//#endif
/* end modify */
#endif
	mdelay(5);
#if 0
	//TP1_EN
	err = gpio_request(EXYNOS4_GPL0(2), "TP1_EN");
	if (err) {
		printk(KERN_ERR "failed to request TP1_EN for "
			"I2C control\n");
		return err;
	}
	//because in uboot we enable,we want to enable it again we must disable it    20121109
	//gpio_direction_output(EXYNOS4_GPL0(2), 0); 20130508
	//mdelay(100);
	gpio_direction_output(EXYNOS4_GPL0(2), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPL0(2), S3C_GPIO_OUTPUT);
	gpio_free(EXYNOS4_GPL0(2));

	printk("(%s, %d): TP1_EN_ON\n", __FUNCTION__, __LINE__);
	mdelay(5);
#endif
#endif
#if 1
	err = gpio_request_one(EXYNOS4_GPC0(2), 0, "GPC0_2");
        if (err) {
                printk(KERN_ERR "failed to request GPC0_2 for "
                                "4.3 LCD control\n");
                return err;
        }

        s3c_gpio_setpull(EXYNOS4_GPC0(2), S3C_GPIO_PULL_UP);
        //gpio_set_value(EXYNOS4_GPC0(2), 0);

        //mdelay(10);

        gpio_set_value(EXYNOS4_GPC0(2), 1);

        gpio_free(EXYNOS4_GPC0(2));
#endif		
#if 0
	err = gpio_request_one(EXYNOS4_GPL1(1), 0, "GPL1_1");
        if (err) {
                printk(KERN_ERR "failed to request GPL1_1 for "
                                "4.3 LCD control\n");
                return err;
        }

        s3c_gpio_setpull(EXYNOS4_GPL1(1), S3C_GPIO_PULL_UP);
        gpio_set_value(EXYNOS4_GPL1(1), 0);

        gpio_free(EXYNOS4_GPL1(1));
#endif
	/*end modify */

	/* add by cym 20141125 */
	err = gpio_request(EXYNOS4_GPC0(2), "VGA_EN");
        if (err) {
                printk(KERN_ERR "failed to request VGA_EN\n");
                return err;
        }

	gpio_direction_output(EXYNOS4_GPC0(2), 1);

	s3c_gpio_cfgpin(EXYNOS4_GPC0(2), S3C_GPIO_OUTPUT);
        gpio_free(EXYNOS4_GPC0(2));

	printk("(%s, %d): VGA_EN_ON\n", __FUNCTION__, __LINE__);
	/* end add */

	return 0;
}
Exemplo n.º 12
0
	{EXYNOS4_GPK3(2),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPK3(3),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(4),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(5),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPK3(6),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE},

	{EXYNOS4_GPL0(0),  S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* USB_HUB_RST */
	{EXYNOS4_GPL0(1),  S3C_GPIO_SLP_INPUT,	S3C_GPIO_PULL_DOWN}, /* TOUCH_SCL */
	{EXYNOS4_GPL0(2),  S3C_GPIO_SLP_INPUT,	S3C_GPIO_PULL_DOWN}, /* TOUCH_SDA */
	{EXYNOS4_GPL0(3),  S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE}, /* POGO_VBATT_EN */
	{EXYNOS4_GPL0(4),  S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE}, /* POGO_VBUS_EN */
/*	{EXYNOS4_GPL0(5),  S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE}, */
	{EXYNOS4_GPL0(6),  S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE}, /* BT_EN */
/*	{EXYNOS4_GPL0(7),  S3C_GPIO_SLP_OUT0,  S3C_GPIO_PULL_NONE}, */

	{EXYNOS4_GPL1(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE}, /* USB_HUB_SCL */
	{EXYNOS4_GPL1(1),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE}, /* USB_HUB_SDA */
/*	{EXYNOS4_GPL1(2),  S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE}, */

	{EXYNOS4_GPL2(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},
	{EXYNOS4_GPL2(1),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(2),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(3),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(4),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE},  /* CMC221_CPU_RST */
	{EXYNOS4_GPL2(5),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE},  /* CMC_PMIC_PWRON */
	{EXYNOS4_GPL2(6),  S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE},
	{EXYNOS4_GPL2(7),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN},

	{EXYNOS4_GPY0(0),  S3C_GPIO_SLP_OUT1, S3C_GPIO_PULL_NONE},  /* DPRAM_CSN */
	{EXYNOS4_GPY0(1),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPY0(2),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
Exemplo n.º 13
0
#if defined(CONFIG_SEC_MODEM)
	{EXYNOS4_GPL0(0),  S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* ACTIVE_STATE_HSIC */
#elif defined(CONFIG_QC_MODEM)
	{EXYNOS4_GPL0(0),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_UP}, /* AP2MDM_PMIC_RESET_N */
#else
	{EXYNOS4_GPL0(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
#endif
	{EXYNOS4_GPL0(1),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE}, /* PS_ALS_SCL_1.8V */
	{EXYNOS4_GPL0(2),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_NONE}, /* PS_ALS_SDA_1.8V */
	{EXYNOS4_GPL0(3),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC(IRDA_CONTROL) */
	{EXYNOS4_GPL0(4),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE}, /* HDMI_EN */
	{EXYNOS4_GPL0(6),  S3C_GPIO_SLP_PREV,  S3C_GPIO_PULL_NONE}, /* BT_EN */

#if defined(CONFIG_SEC_MODEM)
	{EXYNOS4_GPL1(0),  S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* PDA_ACTIVE */
#else
	{EXYNOS4_GPL1(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
#endif
	{EXYNOS4_GPL1(1),  S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* 5M_nRST */

	{EXYNOS4_GPL2(0),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(1),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE}, /* IRDA_EN */

#if defined(CONFIG_QC_MODEM)
	{EXYNOS4_GPL2(2),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
#else
	{EXYNOS4_GPL2(2),  S3C_GPIO_SLP_PREV, S3C_GPIO_PULL_NONE}, /* GPS_EN */
#endif
	{EXYNOS4_GPL2(3),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */
	{EXYNOS4_GPL2(4),  S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* MOTOR_EN -> NC */