Re: [PATCH 4/5] input: gpio-keys: switch to new dev_pm_ops

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

 



On Wed, Aug 5, 2009 at 8:29 PM, Daniel Mack<daniel@xxxxxxxx> wrote:
> Signed-off-by: Daniel Mack <daniel@xxxxxxxx>
> Cc: Phil Blundell <pb@xxxxxxxxxxxxx>
> Cc: linux-input@xxxxxxxxxxxxxxx
> ---
>  drivers/input/keyboard/gpio_keys.c |   28 ++++++++++++++++++----------
>  1 files changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index efed0c9..bfb6fc3 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -216,12 +216,12 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
>
>
>  #ifdef CONFIG_PM
> -static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state)
> +static int gpio_keys_suspend(struct device *dev)
>  {
> -       struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
> +       struct gpio_keys_platform_data *pdata = dev->platform_data;
>        int i;
>
> -       if (device_may_wakeup(&pdev->dev)) {
> +       if (device_may_wakeup(dev)) {
>                for (i = 0; i < pdata->nbuttons; i++) {
>                        struct gpio_keys_button *button = &pdata->buttons[i];
>                        if (button->wakeup) {
> @@ -234,12 +234,12 @@ static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state)
>        return 0;
>  }
>
> -static int gpio_keys_resume(struct platform_device *pdev)
> +static int gpio_keys_resume(struct device *dev)
>  {
> -       struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
> +       struct gpio_keys_platform_data *pdata = dev->platform_data;
>        int i;
>
> -       if (device_may_wakeup(&pdev->dev)) {
> +       if (device_may_wakeup(dev)) {
>                for (i = 0; i < pdata->nbuttons; i++) {
>                        struct gpio_keys_button *button = &pdata->buttons[i];
>                        if (button->wakeup) {
> @@ -251,19 +251,27 @@ static int gpio_keys_resume(struct platform_device *pdev)
>
>        return 0;
>  }
> +
> +static struct dev_pm_ops gpio_keys_pm_ops = {
> +       .suspend        = gpio_keys_suspend,
> +       .freeze         = gpio_keys_suspend,
> +       .resume         = gpio_keys_resume,
> +       .thaw           = gpio_keys_resume,

I'm not sure I understand hibernation correctly, but isn't
.freeze/.thaw about saving state and halting/resuming the device
operation only?
It seems to me that enabling system wakeup functionality should go
into .poweroff. (See <linux/pm.h>)

regards
Philipp
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux