示例#1
0
void touchkey_pressed(enum key_leds id)
{
	struct bd2802_led *led = i2c_get_clientdata(bd2802_i2c_client);
	DBG("led->led_state=%d\n",led->led_state);
	if (led->led_state==BD2802_SEQ ||
			led->led_state==BD2802_SYNC)
		return;

	hrtimer_cancel(&led->touchkey_timer);
	hrtimer_cancel(&led->ledmin_timer);

	if (led->led_state == BD2802_DIMMING) {
		led->white_current = BD2802_CURRENT_WHITE_MAX;
		led->blue_current = BD2802_CURRENT_000;	
		bd2802_on(led);
		led->led_state = BD2802_ON;
	}

	if (led->key_led != id)
		bd2802_turn_white(led,led->key_led);

	led->key_led=id;
	DBG("led->key_led =%d\n",led->key_led);

	led->blue_current = BD2802_CURRENT_BLUE_MAX;
	bd2802_turn_blue(led, led->key_led);
	bd2802_turn_blue(led, HIDDEN1);
	bd2802_turn_blue(led, HIDDEN2);

	hrtimer_start(&led->touchkey_timer, ktime_set(0, 500000000), HRTIMER_MODE_REL); /*5 sec */
}
示例#2
0
static void bd2802_touchkey_work_func(struct work_struct *work)
{
	struct bd2802_led *led = container_of(work, struct bd2802_led, touchkey_work);
	led->white_current = BD2802_CURRENT_WHITE_MAX;
	led->blue_current = BD2802_CURRENT_000;
	bd2802_turn_white(led,led->key_led);
	bd2802_turn_blue(led,HIDDEN1);
	bd2802_turn_blue(led,HIDDEN2);
	hrtimer_start(&led->ledmin_timer, ktime_set(5, 0), HRTIMER_MODE_REL);
}
示例#3
0
void touchkey_pressed(enum key_leds id)
{
	struct bd2802_led *led = i2c_get_clientdata(bd2802_i2c_client);
	DBG("led->led_state=%d\n",led->led_state);
	if (led->led_state==BD2802_SEQ ||
			led->led_state==BD2802_SYNC)
		return;

	hrtimer_cancel(&led->touchkey_timer);
	hrtimer_cancel(&led->ledmin_timer);

	if (led->led_state == BD2802_DIMMING) {
		led->white_current = BD2802_CURRENT_WHITE_MAX;
		led->blue_current = BD2802_CURRENT_000;	
		bd2802_on(led);
		led->led_state = BD2802_ON;
	}
	/* LGE_UPDATE_S 2011-10-26 [[email protected]] : Turn off LED backlight for power consumption */
	else if (led->led_state == BD2802_OFF) {
		led->white_current = BD2802_CURRENT_WHITE_MAX;
		led->blue_current = BD2802_CURRENT_000;	
		led->led_state = BD2802_ON;
		bd2802_on(led);
		bd2802_enable(led);
	}
	/* LGE_UPDATE_E 2011-10-26 [[email protected]] : Turn off LED backlight for power consumption */

	if (led->key_led != id)
		bd2802_turn_white(led,led->key_led);

	led->key_led=id;
	DBG("led->key_led =%d\n",led->key_led);

	led->blue_current = BD2802_CURRENT_BLUE_MAX;
	bd2802_turn_blue(led, led->key_led);
	bd2802_turn_blue(led, HIDDEN1);
	bd2802_turn_blue(led, HIDDEN2);

	hrtimer_start(&led->touchkey_timer, ktime_set(0, 500000000), HRTIMER_MODE_REL); /*5 sec */
}
示例#4
0
static void bd2802_work_func(struct work_struct *work)
{
	struct bd2802_led *led = container_of(work, struct bd2802_led, work);

	DBG("led->led_state=%d\n",led->led_state);

	if (led->led_state == BD2802_SEQ_END) {	
		bd2802_turn_white(led,MENU);
		bd2802_turn_white(led,HOME);
		bd2802_turn_white(led,BACK);
		bd2802_turn_white(led,SEARCH);
		led->key_led = ALL;
		led->key_direction = FORWARD;
		led->led_state = BD2802_ON;	
		return;
	}

	if (led->led_state!=BD2802_SEQ)
		return;

	switch(led->key_led) {
		case ALL:
			bd2802_turn_blue(led,MENU);
			led->key_led=MENU;
			break;
		case MENU:
			bd2802_turn_white(led, MENU);
			bd2802_turn_blue(led,HOME);
			led->key_led=HOME;
			led->key_direction=FORWARD;
			break;
		case HOME:
			bd2802_turn_white(led, HOME);
			if (led->key_direction==FORWARD) {
				bd2802_turn_blue(led,BACK);
				led->key_led=BACK;
			}
			else
			{
				bd2802_turn_blue(led,MENU);
				led->key_led=MENU;						
			}
			break;
		case BACK:
			bd2802_turn_white(led, BACK);
			if (led->key_direction==FORWARD)
			{
				bd2802_turn_blue(led,SEARCH);
				led->key_led=SEARCH;
			}
			else
			{
				bd2802_turn_blue(led,HOME);
				led->key_led=HOME;					
			}
			break;
		case SEARCH:
			bd2802_turn_white(led, SEARCH);
			bd2802_turn_blue(led,BACK);
			led->key_led=BACK;
			led->key_direction=BACKWARD;
			break;
		case HIDDEN1:
		case HIDDEN2:
			break;
	}
		led->led_counter++;
}