示例#1
0
void auo_board_lcd_enable(void)
{
	/* Make sure dev is created and initialized properly */
	dev = qup_i2c_init(GSBI_ID_8, 100000, 24000000);
	if (!dev) {
		dprintf(CRITICAL, "Error in qup_i2c_init\n");
		while (1) ;
	}

	/* Setup RESX_N */
	uint8_t open_drain_a = expander_read(GPIO_EXPANDER_REG_OPEN_DRAIN_A);
	uint8_t dir_a = expander_read(GPIO_EXPANDER_REG_DIR_A);
	uint8_t data_a = expander_read(GPIO_EXPANDER_REG_DATA_A);

	expander_write(GPIO_EXPANDER_REG_DIR_A, ~0x04 & dir_a);
	expander_write(GPIO_EXPANDER_REG_DATA_A, ~0x04 & data_a);

    /* Power on the appropiate PMIC LDO power rails */
	if (lcd_power_on())
		return;

	/* Toggle RESX_N */
	mdelay(20);
	expander_write(GPIO_EXPANDER_REG_DATA_A, 0x04 | data_a);
	mdelay(1);
	expander_write(GPIO_EXPANDER_REG_DATA_A, ~0x04 & data_a);
	mdelay(1);
	expander_write(GPIO_EXPANDER_REG_DATA_A, 0x04 | data_a);
	mdelay(25);

	/* Enable the gpios for  LCD */
	lcd_gpio_cfg(1);

	auo_lcdc_init();
}
示例#2
0
void board_lcd_enable(void)
{
    int rc = -1;
    dev = qup_i2c_init(GSBI_ID_8, 100000, 24000000);

    /* Make sure dev is created and initialized properly */
    if (!dev) {
        while (1) ;
        return;
    }

    /* Store current value of these registers as to not destroy their previous
       state. */
    uint8_t open_drain_a = expander_read(GPIO_EXPANDER_REG_OPEN_DRAIN_A);
    uint8_t dir_b = expander_read(GPIO_EXPANDER_REG_DIR_B);
    uint8_t dir_a = expander_read(GPIO_EXPANDER_REG_DIR_A);
    uint8_t data_b = expander_read(GPIO_EXPANDER_REG_DATA_B);
    uint8_t data_a = expander_read(GPIO_EXPANDER_REG_DATA_A);

    /* Set the LVDS_SHUTDOWN_N to open drain and output low. */
    dprintf(INFO, "Enable lvds_shutdown_n line for Open Drain.\n");
    expander_write(GPIO_EXPANDER_REG_OPEN_DRAIN_A, 0x04 | open_drain_a);

    dprintf(INFO, "Enable lvds_shutdown_n line for output.\n");
    expander_write(GPIO_EXPANDER_REG_DIR_A, ~0x04 & dir_a);

    dprintf(INFO, "Drive the LVDS_SHUTDOWN_N pin high here.\n");
    expander_write(GPIO_EXPANDER_REG_DATA_A, 0x04 | data_a);

    /* Turn on the VREG_L2B to 3.3V. */

    /* Power on the appropiate PMIC LDO power rails */
    if (lcd_power_on())
        return;

    /* Enable the GPIO as LCDC mode LCD. */
    lcd_gpio_cfg(1);

    /* Arbitrary delay */
    udelay(20000);

    /* Set the GPIOs needed for backlight */
    bl_gpio_init();
    /* Set backlight level with API (to 8 by default) */
    rc = panel_set_backlight(8);
    if(rc)
        dprintf(CRITICAL,"Error in setting panel backlight\n");

    dprintf(INFO, "Enable BACKLIGHT_EN line for output.\n");
    expander_write(GPIO_EXPANDER_REG_DIR_B, ~0x10 & dir_b);

    dprintf(INFO, "Drive BACKLIGHT_EN to high\n");
    expander_write(GPIO_EXPANDER_REG_DATA_B, 0x10 | data_b);

}
示例#3
0
void board_lcd_enable(void)
{
    dev = qup_i2c_init(GSBI8_BASE, 100000, 24000000);

    /* Make sure dev is created and initialized properly */
    if (!dev) {
        while (1) ;
        return;
    }

    /* Store current value of these registers as to not destroy their previous
       state. */
    uint8_t open_drain_a = expander_read(GPIO_EXPANDER_REG_OPEN_DRAIN_A);
    uint8_t dir_b = expander_read(GPIO_EXPANDER_REG_DIR_B);
    uint8_t dir_a = expander_read(GPIO_EXPANDER_REG_DIR_A);
    uint8_t data_b = expander_read(GPIO_EXPANDER_REG_DATA_B);
    uint8_t data_a = expander_read(GPIO_EXPANDER_REG_DATA_A);

    /* Set the LVDS_SHUTDOWN_N to open drain and output low. */
    dprintf(INFO, "Enable lvds_shutdown_n line for Open Drain.\n");
    expander_write(GPIO_EXPANDER_REG_OPEN_DRAIN_A, 0x04 | open_drain_a);

    dprintf(INFO, "Enable lvds_shutdown_n line for output.\n");
    expander_write(GPIO_EXPANDER_REG_DIR_A, ~0x04 & dir_a);

    dprintf(INFO, "Drive the LVDS_SHUTDOWN_N pin high here.\n");
    expander_write(GPIO_EXPANDER_REG_DATA_A, 0x04 | data_a);

    /* Turn on the VREG_L2B to 3.3V. */

    /* Power on the appropiate PMIC LDO power rails */
    if (lcd_power_on())
        return;

    /* Enable the GPIO as LCDC mode LCD. */
    lcd_gpio_cfg(1);

    /* Arbitrary delay */
    udelay(20000);

    /* Set the backlight duty cycle via the PM8058 LPG_DRV1 and LPG_DRV2 */
    bl_duty_cycle_init();

    dprintf(INFO, "Enable BACKLIGHT_EN line for output.\n");
    expander_write(GPIO_EXPANDER_REG_DIR_B, ~0x10 & dir_b);

    dprintf(INFO, "Drive BACKLIGHT_EN to high\n");
    expander_write(GPIO_EXPANDER_REG_DATA_B, 0x10 | data_b);

}
static int lcd_gpio_cfg_earlysuspend(struct lcd_device *ld)
{
	/* MLCD_RST */
	s3c_gpio_cfgpin(GPIO_EVF_RESET, S3C_GPIO_OUTPUT);
	gpio_set_value(GPIO_EVF_RESET, GPIO_LEVEL_LOW);
	/* LCD_nCS */
	s3c_gpio_cfgpin(GPIO_LCD_nCS, S3C_GPIO_OUTPUT);
	gpio_set_value(GPIO_LCD_nCS, GPIO_LEVEL_LOW);
	/* LCD_SCLK */
	s3c_gpio_cfgpin(GPIO_LCD_SCLK, S3C_GPIO_OUTPUT);
	gpio_set_value(GPIO_LCD_SCLK, GPIO_LEVEL_LOW);
	/* LCD_SDI */
	s3c_gpio_cfgpin(GPIO_LCD_SDI, S3C_GPIO_OUTPUT);
	gpio_set_value(GPIO_LCD_SDI, GPIO_LEVEL_LOW);

	lcd_gpio_cfg(0);

	return 0;
}
static int lcd_gpio_cfg_lateresume(struct lcd_device *ld)
{
	lcd_gpio_cfg(1);

	/* MLCD_RST */
	s3c_gpio_cfgpin(GPIO_EVF_RESET, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_EVF_RESET, S3C_GPIO_PULL_NONE);
	gpio_set_value(GPIO_EVF_RESET, GPIO_LEVEL_HIGH);
	/* LCD_nCS */
	s3c_gpio_cfgpin(GPIO_LCD_nCS, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_LCD_nCS, S3C_GPIO_PULL_NONE);
	/* LCD_SCLK */
	s3c_gpio_cfgpin(GPIO_LCD_SCLK, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_LCD_SCLK, S3C_GPIO_PULL_NONE);
	/* LCD_SDI */
	s3c_gpio_cfgpin(GPIO_LCD_SDI, S3C_GPIO_OUTPUT);
	s3c_gpio_setpull(GPIO_LCD_SDI, S3C_GPIO_PULL_NONE);

	return 0;
}