X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Finput%2Fkeyboard%2Fgpio_keys.c;h=9fd464aa007008e6e04e61bd144f646e8a93f38a;hb=60cbc8c9108be5542b8b7b9e16231fdee062f6d9;hp=0e61019857006a9c69310669e686caaab0674c86;hpb=655402d41742cc8e490f4357745408d361bdd2d4;p=kernel%2Flinux-3.0.git diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 0e61019..9fd464a 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -51,6 +51,9 @@ struct gpio_keys_drvdata { /* WARNING: this area can be expanded. Do NOT add any member! */ }; +#if defined(CONFIG_MACH_GRANDE) || defined(CONFIG_MACH_IRON) +extern int Is_folder_state(void); +#endif /* * SYSFS interface for enabling/disabling keys and switches: * @@ -270,6 +273,9 @@ ATTR_SHOW_FN(switches, EV_SW, false); ATTR_SHOW_FN(disabled_keys, EV_KEY, true); ATTR_SHOW_FN(disabled_switches, EV_SW, true); +#ifdef CONFIG_SLP_WAKEUP_COUNT +static int gpio_key_wakeup_irq; +#endif /* * ATTRIBUTES: * @@ -462,6 +468,15 @@ static void gpio_keys_report_event(struct gpio_button_data *bdata) if (state) input_event(input, type, button->code, button->value); } else { + +#if defined(CONFIG_MACH_GRANDE) || defined(CONFIG_MACH_IRON) + if(Is_folder_state() && (button->code == KEY_END)) + { + printk(KERN_DEBUG"[keys] not report PWR %d : Folder is closed\n", !state); + return; + } +#endif + if (bdata->wakeup && !state) { input_event(input, type, button->code, !state); if (button->code == KEY_POWER) @@ -577,6 +592,9 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev, } irq = gpio_to_irq(button->gpio); +#ifdef CONFIG_SLP_WAKEUP_COUNT + gpio_key_wakeup_irq = irq; +#endif if (irq < 0) { error = irq; dev_err(dev, "Unable to get irq number for GPIO %d, error %d\n", @@ -716,8 +734,11 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) for (i = 0; i < pdata->nbuttons; i++) gpio_keys_report_event(&ddata->data[i]); input_sync(input); - +#ifdef CONFIG_SLP_WAKEUP_COUNT + device_init_wakeup_setirq(&pdev->dev, gpio_key_wakeup_irq); +#else device_init_wakeup(&pdev->dev, wakeup); +#endif return 0;