static void gpio_keys_close(struct input_dev *input) { struct gpio_keys_drvdata *ddata = input_get_drvdata(input); #if defined (KEY_BOOSTER) || defined (CONFIG_INPUT_BOOSTER) int i = 0; #endif if (ddata->disable) ddata->disable(input->dev.parent); #ifdef CONFIG_SENSORS_HALL // cancel_delayed_work_sync(&ddata->flip_cover_dwork); #endif #if defined (KEY_BOOSTER) || defined (CONFIG_INPUT_BOOSTER) for (i = 0; i < ddata->n_buttons; i++) { struct gpio_button_data *bdata = &ddata->data[i]; if (bdata->button->code == KEY_HOMEPAGE) { #ifdef CONFIG_INPUT_BOOSTER INPUT_BOOSTER_SEND_EVENT(KEY_HOMEPAGE, BOOSTER_MODE_FORCE_OFF); #else gpio_key_set_dvfs_lock(bdata, 2); #endif } } #endif }
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; struct irq_desc *desc = irq_to_desc(gpio_to_irq(button->gpio)); int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low; pr_info("gpio-keys : code[%d], type[%d], state[%d]\n", button->code, button->type, state); if (type == EV_ABS) { if (state) { input_event(input, type, button->code, button->value); input_sync(input); } } else { int report_state; static int prev_state; if (bdata->wakeup && !state) { input_event(input, type, button->code, !state); input_sync(input); #if !defined(CONFIG_SAMSUNG_PRODUCT_SHIP) printk(KERN_DEBUG"keys:f code %d, state %d\n", button->code, !state); #else if (button->code == KEY_POWER) printk(KERN_DEBUG "keys:f PWR %d\n", !state); #endif } bdata->key_state = !!state; bdata->wakeup = false; report_state = irqd_is_wakeup_set(&desc->irq_data) ? 1 : !!state; #if !defined(CONFIG_SAMSUNG_PRODUCT_SHIP) printk(KERN_DEBUG"keys:code %d, state %d\n", button->code, report_state); #endif input_event(input, type, button->code, report_state); input_sync(input); if (button->code == KEY_POWER && prev_state != report_state) { printk(KERN_DEBUG "keys:PWR %d\n", report_state); prev_state = report_state; } #ifdef KEY_BOOSTER if (button->code == KEY_HOMEPAGE) gpio_key_set_dvfs_lock(bdata, !!state); #endif #ifdef CONFIG_INPUT_BOOSTER if (button->code == KEY_HOMEPAGE) INPUT_BOOSTER_SEND_EVENT(KEY_HOMEPAGE, !!state); #endif } }
static void gpio_keys_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; struct irq_desc *desc = irq_to_desc(gpio_to_irq(button->gpio)); int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low; #ifdef CONFIG_FAST_BOOT /*Fake pwr off control*/ if (fake_shut_down || fake_pressed) { if (button->code == KEY_POWER) { if (!!state) { printk(KERN_DEBUG"keys: start fake check\n"); fake_pressed = true; if (!wake_lock_active(&fake_lock)) wake_lock(&fake_lock); mod_timer(&fake_timer, jiffies + msecs_to_jiffies(500)); } else { printk(KERN_DEBUG"keys: end fake checkPwr 0\n"); fake_pressed = false; if (wake_lock_active(&fake_lock)) wake_unlock(&fake_lock); } } bdata->wakeup = false; return ; } #endif if (type == EV_ABS) { if (state) { input_event(input, type, button->code, button->value); input_sync(input); } } else { int report_state; static int prev_state; if (bdata->wakeup && !state) { input_event(input, type, button->code, !state); input_sync(input); #if !defined(CONFIG_SAMSUNG_PRODUCT_SHIP) printk(KERN_DEBUG"keys:f code %d, state %d\n", button->code, !state); #else if (button->code == KEY_POWER) printk(KERN_DEBUG "keys:f PWR %d\n", !state); #endif } bdata->key_state = !!state; bdata->wakeup = false; report_state = irqd_is_wakeup_set(&desc->irq_data) ? 1 : !!state; #if !defined(CONFIG_SAMSUNG_PRODUCT_SHIP) printk(KERN_DEBUG"keys:code %d, state %d\n", button->code, report_state); #endif input_event(input, type, button->code, report_state); input_sync(input); if (button->code == KEY_POWER && prev_state != report_state) { printk(KERN_DEBUG "keys:PWR %d\n", report_state); prev_state = report_state; } #ifdef KEY_BOOSTER if (button->code == KEY_HOMEPAGE) gpio_key_set_dvfs_lock(bdata, !!state); #endif #ifdef CONFIG_INPUT_BOOSTER if (button->code == KEY_HOMEPAGE) INPUT_BOOSTER_SEND_EVENT(KEY_HOMEPAGE, !!state); #endif } }