linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "sameo@linux.intel.com" <sameo@linux.intel.com>,
	"jedu@slimlogic.co.uk" <jedu@slimlogic.co.uk>,
	"lrg@slimlogic.co.uk" <lrg@slimlogic.co.uk>,
	"gg@slimlogic.co.uk" <gg@slimlogic.co.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH V1] mfd: tps65910: Add wakeup support
Date: Sat, 21 Jan 2012 13:40:00 +0530	[thread overview]
Message-ID: <4F1A72D8.90202@nvidia.com> (raw)
In-Reply-To: <20120120131355.GG18297@opensource.wolfsonmicro.com>

On Friday 20 January 2012 06:43 PM, Mark Brown wrote:
> On Fri, Jan 20, 2012 at 06:37:42PM +0530, Laxman Dewangan wrote:
>
>>> No, that's it - when you call those userspace will get control via sysfs
>>> for turning on and off the wakeup support.
>> So should I call them in driver by default without taking parameter
>> from platform data?
> That's the normal behaviour for drivers unless there's some specific
> reason for doing something different.  The choice may well depend on the
> application software running on the system rather than the kernel.
Ok, going through the details of documentation under 
/sys/devices/.../power/wakeup files of
power/device.txt, i think following should be the change if we want to 
control the wakeup control
through user sapce:
During initialization of device, we need to tell that device is wakeup 
capable and hence we need to
call the: device_wakeup_init() and device_set_wakeup_capable(dev, true).

Then it exposes the required sysfs to userspace to select the wakeup 
enable or not i.e. power/wakeup
to be written as enabled or disabled.

Based on user selection, the function device_may_wakeup() will return 
true/false based on
power/wakeup enabled/disabled.
So before entering into the suspend, we need to check this function and 
call enable_irq_wakeup() to
have the wakeup enabled actually in the soc. In resume we need to call 
disable_irq_wake() again.

If this is correct approach then I can push the another patch.


  reply	other threads:[~2012-01-21  8:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 11:09 [PATCH V1] mfd: tps65910: Add wakeup support Laxman Dewangan
2012-01-20 12:51 ` Mark Brown
2012-01-20 13:00   ` Laxman Dewangan
2012-01-20 13:02     ` Mark Brown
2012-01-20 13:07       ` Laxman Dewangan
2012-01-20 13:13         ` Mark Brown
2012-01-21  8:10           ` Laxman Dewangan [this message]
2012-01-21 11:24           ` Laxman Dewangan
2012-01-21 12:51             ` Mark Brown
2012-01-21 12:57               ` Laxman Dewangan

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=4F1A72D8.90202@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gg@slimlogic.co.uk \
    --cc=jedu@slimlogic.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=sameo@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).