static int meson_adc_kp_resume(struct platform_device *pdev)
{
+ struct adc_key *key;
struct meson_adc_kp *kp = platform_get_drvdata(pdev);
if (get_resume_method() == POWER_KEY_WAKEUP) {
- dev_info(&pdev->dev, "adc keypad wakeup\n");
- input_report_key(kp->poll_dev->input, KEY_POWER, 1);
- input_sync(kp->poll_dev->input);
- input_report_key(kp->poll_dev->input, KEY_POWER, 0);
- input_sync(kp->poll_dev->input);
+ list_for_each_entry(key, &kp->adckey_head, list) {
+ if (key->code == KEY_POWER) {
+ dev_info(&pdev->dev, "adc keypad wakeup\n");
+
+ input_report_key(kp->poll_dev->input,
+ KEY_POWER, 1);
+ input_sync(kp->poll_dev->input);
+ input_report_key(kp->poll_dev->input,
+ KEY_POWER, 0);
+ input_sync(kp->poll_dev->input);
+
+ break;
+ }
+ }
}
return 0;
}
#define MOD_NAME "gpio_key"
+#undef pr_fmt
+#define pr_fmt(fmt) "gpio_key: " fmt
+
struct gpio_key {
int code; /* input key code */
const char *name;
{
struct kp *kp_data = (struct kp *)data;
- schedule_work(&(kp_data->work_update));
+ queue_work(system_freezable_wq, &(kp_data->work_update));
/* if (!deep_suspend_flag)
* clr_pwr_key();
{
struct kp *kp_data = (struct kp *)data;
- schedule_work(&(kp_data->work_update));
+ queue_work(system_freezable_wq, &(kp_data->work_update));
mod_timer(&kp_data->timer, jiffies+msecs_to_jiffies(25));
}
#endif
static int gpio_key_resume(struct platform_device *dev)
{
+ int i;
+ struct gpio_platform_data *pdata;
+
+ pdata = (struct gpio_platform_data *)platform_get_drvdata(dev);
+
if (get_resume_method() == POWER_KEY_WAKEUP) {
- pr_info("gpio keypad wakeup\n");
- input_report_key(gp_kp->input, KEY_POWER, 1);
- input_sync(gp_kp->input);
- input_report_key(gp_kp->input, KEY_POWER, 0);
- input_sync(gp_kp->input);
+ for (i = 0; i < pdata->key_num; i++) {
+ if (pdata->key[i].code == KEY_POWER) {
+ pr_info("gpio keypad wakeup\n");
+
+ input_report_key(gp_kp->input, KEY_POWER, 1);
+ input_sync(gp_kp->input);
+ input_report_key(gp_kp->input, KEY_POWER, 0);
+ input_sync(gp_kp->input);
+
+ break;
+ }
+ }
}
return 0;
}