All of lore.kernel.org
 help / color / mirror / Atom feed
From: cw00.choi@samsung.com (Chanwoo Choi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] extcon: gpio: Add power resume support
Date: Tue, 07 Jan 2014 15:09:26 +0900	[thread overview]
Message-ID: <52CB9A16.9010305@samsung.com> (raw)
In-Reply-To: <1389070590-3139-1-git-send-email-rongjun.ying@csr.com>

Hi RongJun,

On 01/07/2014 01:56 PM, RongJun Ying wrote:
> From: Rongjun Ying <rongjun.ying@csr.com>
> 
> When system on the suspend state, Some SoC can't get gpio interrupt.
> After system resume, need send extcon uevent to userspace.
> 
> Signed-off-by: Rongjun Ying <rongjun.ying@csr.com>
> Reviewed-by: Barry Song <Baohua.Song@csr.com>
> ---
>  -v3:
>  'check_on_resume' instead of 'load_sleep_irq' as Chanwoo Choi's proposal.
> 
>  drivers/extcon/extcon-gpio.c       |   20 ++++++++++++++++++++
>  include/linux/extcon/extcon-gpio.h |    1 +
>  2 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
> index 7e0dff5..fde52c1 100644
> --- a/drivers/extcon/extcon-gpio.c
> +++ b/drivers/extcon/extcon-gpio.c
> @@ -40,6 +40,7 @@ struct gpio_extcon_data {
>  	int irq;
>  	struct delayed_work work;
>  	unsigned long debounce_jiffies;
> +	bool check_on_resume;
>  };
> 
>  static void gpio_extcon_work(struct work_struct *work)
> @@ -103,6 +104,7 @@ static int gpio_extcon_probe(struct platform_device *pdev)
>  	extcon_data->gpio_active_low = pdata->gpio_active_low;
>  	extcon_data->state_on = pdata->state_on;
>  	extcon_data->state_off = pdata->state_off;
> +	extcon_data->check_on_resume = pdata->check_on_resume;
>  	if (pdata->state_on && pdata->state_off)
>  		extcon_data->edev.print_state = extcon_gpio_print_state;
>  	if (pdata->debounce) {
> @@ -159,12 +161,30 @@ static int gpio_extcon_remove(struct platform_device *pdev)
>  	return 0;
>  }
> 
> +#ifdef CONFIG_PM_SLEEP
> +static int gpio_extcon_resume(struct device *dev)
> +{
> +	struct gpio_extcon_data *extcon_data;
> +
> +	extcon_data = dev_get_drvdata(dev);
> +	if (extcon_data->check_on_resume)
> +		queue_delayed_work(system_power_efficient_wq,
> +			&extcon_data->work, extcon_data->debounce_jiffies);
> +	return 0;
> +}
> +#endif
> +
> +static const struct dev_pm_ops gpio_extcon_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(NULL, gpio_extcon_resume)

If CONFIG_PM_SLEEP is undefined, gpio_extcon_pm_ops cannot find gpio_extcon_resume function.
You should define dummy function for gpio_extcon_resume function.

WARNING: multiple messages have this Message-ID (diff)
From: Chanwoo Choi <cw00.choi@samsung.com>
To: RongJun Ying <rjying@gmail.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
	Barry Song <Barry.Song@csr.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Workgroup.linux@csr.com,
	Rongjun Ying <rongjun.ying@csr.com>
Subject: Re: [PATCH v3] extcon: gpio: Add power resume support
Date: Tue, 07 Jan 2014 15:09:26 +0900	[thread overview]
Message-ID: <52CB9A16.9010305@samsung.com> (raw)
In-Reply-To: <1389070590-3139-1-git-send-email-rongjun.ying@csr.com>

Hi RongJun,

On 01/07/2014 01:56 PM, RongJun Ying wrote:
> From: Rongjun Ying <rongjun.ying@csr.com>
> 
> When system on the suspend state, Some SoC can't get gpio interrupt.
> After system resume, need send extcon uevent to userspace.
> 
> Signed-off-by: Rongjun Ying <rongjun.ying@csr.com>
> Reviewed-by: Barry Song <Baohua.Song@csr.com>
> ---
>  -v3:
>  'check_on_resume' instead of 'load_sleep_irq' as Chanwoo Choi's proposal.
> 
>  drivers/extcon/extcon-gpio.c       |   20 ++++++++++++++++++++
>  include/linux/extcon/extcon-gpio.h |    1 +
>  2 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
> index 7e0dff5..fde52c1 100644
> --- a/drivers/extcon/extcon-gpio.c
> +++ b/drivers/extcon/extcon-gpio.c
> @@ -40,6 +40,7 @@ struct gpio_extcon_data {
>  	int irq;
>  	struct delayed_work work;
>  	unsigned long debounce_jiffies;
> +	bool check_on_resume;
>  };
> 
>  static void gpio_extcon_work(struct work_struct *work)
> @@ -103,6 +104,7 @@ static int gpio_extcon_probe(struct platform_device *pdev)
>  	extcon_data->gpio_active_low = pdata->gpio_active_low;
>  	extcon_data->state_on = pdata->state_on;
>  	extcon_data->state_off = pdata->state_off;
> +	extcon_data->check_on_resume = pdata->check_on_resume;
>  	if (pdata->state_on && pdata->state_off)
>  		extcon_data->edev.print_state = extcon_gpio_print_state;
>  	if (pdata->debounce) {
> @@ -159,12 +161,30 @@ static int gpio_extcon_remove(struct platform_device *pdev)
>  	return 0;
>  }
> 
> +#ifdef CONFIG_PM_SLEEP
> +static int gpio_extcon_resume(struct device *dev)
> +{
> +	struct gpio_extcon_data *extcon_data;
> +
> +	extcon_data = dev_get_drvdata(dev);
> +	if (extcon_data->check_on_resume)
> +		queue_delayed_work(system_power_efficient_wq,
> +			&extcon_data->work, extcon_data->debounce_jiffies);
> +	return 0;
> +}
> +#endif
> +
> +static const struct dev_pm_ops gpio_extcon_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(NULL, gpio_extcon_resume)

If CONFIG_PM_SLEEP is undefined, gpio_extcon_pm_ops cannot find gpio_extcon_resume function.
You should define dummy function for gpio_extcon_resume function.



  parent reply	other threads:[~2014-01-07  6:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07  4:56 [PATCH v3] extcon: gpio: Add power resume support RongJun Ying
2014-01-07  4:56 ` RongJun Ying
2014-01-07  6:07 ` Chanwoo Choi
2014-01-07  6:07   ` Chanwoo Choi
2014-01-07  9:48   ` Rongjun Ying
2014-01-07  9:48     ` Rongjun Ying
2014-01-07  6:09 ` Chanwoo Choi [this message]
2014-01-07  6:09   ` Chanwoo Choi
2014-01-07  9:02   ` Rongjun Ying
2014-01-07  9:02     ` Rongjun Ying
2014-01-09  0:54     ` Chanwoo Choi
2014-01-09  0:54       ` Chanwoo Choi
  -- strict thread matches above, loose matches on Subject: below --
2014-01-07  5:51 MyungJoo Ham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52CB9A16.9010305@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.