Re: [PATCH] input: add support for generic GPIO-based matrix keypad

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday, 7. May 2009, Eric Miao wrote:
>+static int matrix_keypad_suspend(struct platform_device *pdev,
>pm_message_t state)
>+{
>+       struct matrix_keypad *keypad = platform_get_drvdata(pdev);
>+       struct matrix_keypad_platform_data *pdata = keypad->pdata;
>+       int i;
>+
>+       if (device_may_wakeup(&pdev->dev))
>+               for (i = 0; i < pdata->num_row_gpios; i++)
>+                       enable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
>+
>+       return 0;
>+}
>+
Hi Eric,
what about the workqueue and interrupts? Shouldn't the interrupts be disabled and then the wq flushed?

> +static int matrix_keypad_resume(struct platform_device *pdev)
> +{
> +	struct matrix_keypad *keypad = platform_get_drvdata(pdev);
> +	struct matrix_keypad_platform_data *pdata = keypad->pdata;
> +	int i;
> +
> +	if (device_may_wakeup(&pdev->dev))
> +		for (i = 0; i < pdata->num_row_gpios; i++)
> +			disable_irq_wake(gpio_to_irq(pdata->row_gpios[i]));
> +
> +	return 0;
> +}
>+
You should probably schedule an imediate key scan as all key state changes where lost while the device was suspended.

Uli

-- 

------- ROAD ...the handyPC Company - - -  ) ) )

Uli Luckas
Head of Software Development

ROAD GmbH
Bennigsenstr. 14 | 12159 Berlin | Germany
fon: +49 (30) 230069 - 62 | fax: +49 (30) 230069 - 69
url: www.road.de

Amtsgericht Charlottenburg: HRB 96688 B
Managing director: Hans-Peter Constien
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux