Esempio n. 1
0
static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
{
	const struct gpio_keys_button *button = bdata->button;
	struct input_dev *input = bdata->input;
	unsigned int type = button->type ?: EV_KEY;
	int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low;
#ifdef CONFIG_MACH_BOSE_ATT
	if (gpio_powerkey_resume_error) {
		gpio_powerkey_resume_error = false;
		printk(KERN_DEBUG"[KEY] %s excute after gpiokey_resume. do not report\n",
				__func__);
		return;
	}

	if (gpiokey_driver_state == false) {
		if (button->code == KEY_POWER) {
			printk(KERN_DEBUG"[KEY] %s resume powerkey(%s)\n",
				__func__, (state)?"prs":"rel");
			input_event(input, type, button->code, !!state);
			input_sync(input);

			if (!!state)
				gpio_powerkey_resume = 1;
			else
				gpio_powerkey_resume = 2;
		}
	} else {
		printk(KERN_DEBUG"[KEY] %d(%s)\n",
			button->code, (!!state) ? "prs" : "rel");
		input_event(input, type, button->code, !!state);
		input_sync(input);
	}
#else /* CONFIG_MACH_BOSE_ATT */
#if SEC_DEBUG
	printk("key: %s(%s)\n", code_to_str(button->code), (state)?"prs":"rel" );
#endif
	if (type == EV_ABS) {
		if (state)
			input_event(input, type, button->code, button->value);
	} else {
		input_event(input, type, button->code, !!state);
	}
	input_sync(input);
#endif	
}
Esempio n. 2
0
const char*
frenzy::dom::DOMException::what() const throw()
{
  return code_to_str(code);
}