コード例 #1
0
static void aat2862_set_main_current_level(struct i2c_client *client, int level)
{
	struct aat2862_device *dev;
	unsigned char val;
	unsigned char aat2862_muic_mode;
	
	dev = (struct aat2862_device *)i2c_get_clientdata(client);
	cur_main_lcd_level = level; 
	dev->bl_dev->props.brightness = cur_main_lcd_level;
/* 20101124 [email protected] for CP_USB and CP_UART[LGE_START]*/	
	aat2862_muic_mode = get_muic_mode();

	if ((aat2862_muic_mode == 9) && (check_battery_present() == 0)) //20101126 [email protected] to check battery present
		level = 0x00;
/* 20101124 [email protected] for CP_USB and CP_UART[LGE_END]*/
	val = 0xFF - level;
	//val = 0xC0 | (backlight_status<<5) | level;

	aat2862_write_reg(client, 0x03, val);

	if(level > 0x3F){
		val = 0;
	}else{
		val = 0x3F - level;
	}

	aat2862_write_reg(client, 0x04, val);
	aat2862_write_reg(client, 0x05, val);
	aat2862_write_reg(client, 0x06, val);

	mdelay(1);	// 20100526 [email protected]
}
コード例 #2
0
ファイル: hub_aat2862.c プロジェクト: kapoloclubs/diana
static void aat2862_set_main_current_level(struct i2c_client *client, int level)
{
	struct aat2862_device *dev;
	unsigned char val;
	
    dev = (struct aat2862_device *)i2c_get_clientdata(client);
	cur_main_lcd_level = level; 
	dev->bl_dev->props.brightness = cur_main_lcd_level;

	aat2862_write_reg(client, 0x0,0xff); /* LCD channel enable */

	val = 0xFF - level;
	//val = 0xC0 | (backlight_status<<5) | level;

	aat2862_write_reg(client, 0x03, val);

	if(level > 0x3F){
		val = 0;
	}else{
		val = 0x3F - level;
	}

	aat2862_write_reg(client, 0x04, val);
	aat2862_write_reg(client, 0x05, val);
	aat2862_write_reg(client, 0x06, val);

	mdelay(1);	// 20100526 [email protected]
}
コード例 #3
0
static void aat2862_touch_ldo_enable(struct i2c_client *client, int on)
{
#if 0
	aat2862_set_ldo(1, ENLDO_D, VLDO_3_0V);
	msleep(1);
	aat2862_set_ldo(1, ENLDO_C, VLDO_1_8V);	
#endif
	if(on)
	{
		aat2862_write_reg(client, 0x02, 0x0B);
		msleep(10);
		aat2862_write_reg(client, 0x02, 0x0F);
		msleep(10);		

		touch_i2c2_enable(on);
	}
	else
	{
		touch_i2c2_enable(on);

		msleep(10);
		aat2862_write_reg(client, 0x02, 0x0B);
		msleep(10);
		aat2862_write_reg(client, 0x02, 0x03);
	}

//	printk(KERN_WARNING"[!] %s()\n", __func__);
}
コード例 #4
0
ファイル: hub_aat2862.c プロジェクト: kapoloclubs/diana
static int aat2862_bl_suspend(struct i2c_client *client, pm_message_t state)
{
    printk(KERN_INFO"%s: new state: %d\n",__func__, state.event);

    //client->dev.power.power_state = state;
    aat2862_backlight_off();
    aat2862_write_reg(client, 0x03, 0x0F);
    aat2862_write_reg(client, 0x04, 0x0F);
    aat2862_write_reg(client, 0x05, 0x0F);
    aat2862_write_reg(client, 0x06, 0x0F);
    early_bl_timer = 0;
    return 0;
}
コード例 #5
0
ファイル: hub_aat2862.c プロジェクト: kapoloclubs/diana
void aat2862_ldo_enable(unsigned char num, int enable) 
{
	unsigned char org;

	aat2862_read_reg(aat2862_i2c_client, LDO_ABCD_EN_REG, &org);

	if(enable)
	{
		aat2862_write_reg(aat2862_i2c_client, LDO_ABCD_EN_REG, org | (1<< num));
	}
	else
	{
		aat2862_write_reg(aat2862_i2c_client, LDO_ABCD_EN_REG, org & ~(1<<num));
	}
}
コード例 #6
0
static int aat2862_resume(struct i2c_client *client)
{
	aat2862_init(client);
	//printk(KERN_INFO"%s: old state: %d\n",__func__, client->dev.power.power_state.event);
	client->dev.power.power_state = PMSG_ON;
	// 20100525 [email protected] Patch for touch/panel resumption failure [START_LGE]
	aat2862_write_reg(client, 0x00, 0x4C);
	aat2862_write_reg(client, 0x01, 0x49);
	// 20100525 [email protected] Patch for touch/panel resumption failure [END_LGE]
	aat2862_write_reg(client, 0x02, 0x03);
	mdelay(10);

	// 20101016 [email protected] Turn off unnecessary modules upon BL off [START_LGE]
#if 0	// Following reduces around 20uA.
	gpio_direction_output(MY_HDMI_REG_EN, 1);
	gpio_set_value(MY_HDMI_REG_EN, 1);
	gpio_direction_output(MY_CAM_SUBPM_EN, 1);
	gpio_set_value(MY_CAM_SUBPM_EN, 1);
	gpio_direction_output(MY_CAM_VCM_EN, 1);
	gpio_set_value(MY_CAM_VCM_EN, 1);
	gpio_direction_output(MY_DMB_EN, 1);
	gpio_set_value(MY_DMB_EN, 1);
	gpio_direction_input(MY_MOTION_INT);
	gpio_direction_input(MY_COM_INT);
#endif
#if 0	// Followings reduces around 60uA.
	omap_writew(i2c3_scl, 0x480021C2);	// sookyoung.kim	
	omap_writew(i2c3_sda, 0x480021C4);	// sookyoung.kim	
#endif
#if 0	// Followings, coupled with memory refresh rate control, reduces around 600uA.
	omap_writew(i2c4_scl, 0x48002A00);	// sookyoung.kim	
	omap_writew(i2c4_sda, 0x48002A02);	// sookyoung.kim	
#endif
	// 20101016 [email protected] Turn off unnecessary modules upon BL off [END_LGE]

	// 20100630 [email protected] Hub touchscreen power sequence [START_LGE]
	aat2862_touch_ldo_enable(client, 1);
	// 20100630 [email protected] Hub touchscreen power sequence [END_LGE]	

	//aat2862_backlight_on();

	return 0;
}
コード例 #7
0
ファイル: hub_aat2862.c プロジェクト: kapoloclubs/diana
static int aat2862_resume(struct i2c_client *client)
{
	aat2862_init(client);
	printk(KERN_INFO"%s: old state: %d\n",__func__, client->dev.power.power_state.event);
	client->dev.power.power_state = PMSG_ON;
	// 20100525 [email protected] Patch for touch/panel resumption failure [START_LGE]
	aat2862_write_reg(client, LDO_AB_LEVEL_REG, 0x4C);
	aat2862_write_reg(client, LDO_CD_LEVEL_REG, 0x4C);
	// 20100525 [email protected] Patch for touch/panel resumption failure [END_LGE]
	
// 20100717 [email protected] power sequence for touch [START_LGE]
	aat2862_write_reg(client, LDO_ABCD_EN_REG, 0x03);
	mdelay(5);
	aat2862_touch_ldo_enable(client, 1);
// 20100717 [email protected] power sequence for touch [END_LGE]	
//	aat2862_write_reg(client, LDO_ABCD_EN_REG, 0x0F);
//	mdelay(10);
	//aat2862_backlight_on();

	return 0;
}
コード例 #8
0
ファイル: hub_aat2862.c プロジェクト: kapoloclubs/diana
void aat2862_init(struct i2c_client *client) 
{
	//unsigned i;
	gpio_request(LCD_CP_EN, "lcd bl");
	gpio_direction_output(LCD_CP_EN, 1);

	aat2862_hreset();

#if 0	//20100709 [email protected] for resume
	for (i = 0; pwron_seq[i].reg != I2C_NO_REG; i++) {
		aat2862_write_reg(client, pwron_seq[i].reg, pwron_seq[i].val);
		mdelay(10);
	}
	backlight_status = BL_ON;
#endif
}
コード例 #9
0
ファイル: hub_aat2862.c プロジェクト: kapoloclubs/diana
static int aat2862_suspend(struct i2c_client *client, pm_message_t state)
{
	printk(KERN_INFO"%s: new state: %d\n",__func__, state.event);

	client->dev.power.power_state = state;
	
// 20100717 [email protected] power sequence for touch [START_LGE]
	aat2862_touch_ldo_enable(client, 0);
	mdelay(5);
// 20100717 [email protected] power sequence for touch [END_LGE]

	aat2862_write_reg(client, LDO_ABCD_EN_REG, 0x00);

	gpio_direction_output(LCD_CP_EN, 0);

	return 0;
}
コード例 #10
0
static int aat2862_suspend(struct i2c_client *client, pm_message_t state)
{
	//printk(KERN_INFO"%s: new state: %d\n",__func__, state.event);

	// 20100630 [email protected] Hub touchscreen power sequence [START_LGE]
	aat2862_touch_ldo_enable(client, 0);
	// 20100630 [email protected] Hub touchscreen power sequence [END_LGE]

	// 20101016 [email protected] Turn off unnecessary modules upon BL off [START_LGE]
#if 0	// Followings reduces around 20uA.
	gpio_direction_output(MY_HDMI_REG_EN, 0);
	gpio_set_value(MY_HDMI_REG_EN, 0);
	gpio_direction_output(MY_CAM_SUBPM_EN, 0);
	gpio_set_value(MY_CAM_SUBPM_EN, 0);
	gpio_direction_output(MY_CAM_VCM_EN, 0);
	gpio_set_value(MY_CAM_VCM_EN, 0);
	gpio_direction_output(MY_DMB_EN, 0);
	gpio_set_value(MY_DMB_EN, 0);
	gpio_direction_output(MY_MOTION_INT, 0);
	gpio_direction_output(MY_COM_INT, 0);
#endif
#if 0	// Followings reduces around 60uA.
	i2c3_scl = omap_readw(0x480021C2);	// sookyoung.kim	
	i2c3_sda = omap_readw(0x480021C4);	// sookyoung.kim	
	omap_writew(0x0000, 0x480021C2);	// sookyoung.kim	
	omap_writew(0x0000, 0x480021C4);	// sookyoung.kim	
#endif
#if 0	// Followings, coupled with memory refresh rate control, reduces around 600uA.
	i2c4_scl = omap_readw(0x48002A00);	// sookyoung.kim	
	i2c4_sda = omap_readw(0x48002A02);	// sookyoung.kim	
	omap_writew(0x0000, 0x48002A00);	// sookyoung.kim	
	omap_writew(0x0000, 0x48002A02);	// sookyoung.kim	
#endif
	// 20101016 [email protected] Turn off unnecessary modules upon BL off [END_LGE]


	client->dev.power.power_state = state;

	aat2862_write_reg(client, 0x02, 0x00);

	gpio_direction_output(MY_LCD_CP_EN, 0);
	gpio_set_value(MY_LCD_CP_EN, 0);

	return 0;
}