linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] mfd: tps65910: Add wakeup support
@ 2012-01-23  7:46 Laxman Dewangan
       [not found] ` <1327304775-12202-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Laxman Dewangan @ 2012-01-23  7:46 UTC (permalink / raw)
  To: sameo-VuQAYsv1563Yd54FQh9/CA, jedu-kDsPt+C1G03kYMGBc/C6ZA,
	lrg-kDsPt+C1G03kYMGBc/C6ZA,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	gg-kDsPt+C1G03kYMGBc/C6ZA, linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	ldewangan-DDmLM1+adcrQT0dZR+AlfA

Implementing irq_set_wake() so that device should able
to wakeup the system through different interrupt provided
by this device like gpios, onkey, rtc etc.

Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
As discussed on patch V1, the device should call the api 
device_set_wakeup_capable() to expose proper sysfs interface
to userspace to choose the wakeup enable/disable by application.
Then before suspend, driver need to check whether user application
have selected wakeup enabled or not through device_may_wakeup()
and accordingly call the enable_irq_wake().
The above code should be implemented in rtc/onkey or gpio-
client driver to provide proper sysfs interface if require and call
the enable_irq_wake() accordingly.
This patch will just implement the api require to enable the 
wakeup through interrupt from this device.

 drivers/mfd/tps65910-irq.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/tps65910-irq.c b/drivers/mfd/tps65910-irq.c
index a56be93..0c13042 100644
--- a/drivers/mfd/tps65910-irq.c
+++ b/drivers/mfd/tps65910-irq.c
@@ -145,12 +145,23 @@ static void tps65910_irq_disable(struct irq_data *data)
 	tps65910->irq_mask |= ( 1 << irq_to_tps65910_irq(tps65910, data->irq));
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int tps65910_irq_set_wake(struct irq_data *data, unsigned int enable)
+{
+	struct tps65910 *tps65910 = irq_data_get_irq_chip_data(data);
+	return irq_set_irq_wake(tps65910->chip_irq, enable);
+}
+#else
+#define tps65910_irq_set_wake NULL
+#endif
+
 static struct irq_chip tps65910_irq_chip = {
 	.name = "tps65910",
 	.irq_bus_lock = tps65910_irq_lock,
 	.irq_bus_sync_unlock = tps65910_irq_sync_unlock,
 	.irq_disable = tps65910_irq_disable,
 	.irq_enable = tps65910_irq_enable,
+	.irq_set_wake = tps65910_irq_set_wake,
 };
 
 int tps65910_irq_init(struct tps65910 *tps65910, int irq,
-- 
1.7.1.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] mfd: tps65910: Add wakeup support
       [not found] ` <1327304775-12202-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-01-26 10:54   ` Mark Brown
  2012-02-19  7:42     ` Laxman Dewangan
  2012-02-20 16:57   ` Samuel Ortiz
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2012-01-26 10:54 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: sameo-VuQAYsv1563Yd54FQh9/CA, jedu-kDsPt+C1G03kYMGBc/C6ZA,
	lrg-kDsPt+C1G03kYMGBc/C6ZA, gg-kDsPt+C1G03kYMGBc/C6ZA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

On Mon, Jan 23, 2012 at 01:16:15PM +0530, Laxman Dewangan wrote:
> Implementing irq_set_wake() so that device should able
> to wakeup the system through different interrupt provided
> by this device like gpios, onkey, rtc etc.

Reviewed-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

It will have the side effect of making all interrupts on the PMIC wake
if any of them does but I suspect this is actually going to be fine in
practice.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] mfd: tps65910: Add wakeup support
  2012-01-26 10:54   ` Mark Brown
@ 2012-02-19  7:42     ` Laxman Dewangan
  0 siblings, 0 replies; 4+ messages in thread
From: Laxman Dewangan @ 2012-02-19  7:42 UTC (permalink / raw)
  To: Mark Brown
  Cc: sameo@linux.intel.com, jedu@slimlogic.co.uk, lrg@slimlogic.co.uk,
	gg@slimlogic.co.uk, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org

Hi Samuel,
Can you please review this patch? This is require in order of enabling 
the wakeup from sub devices of this pmic device like  rtc/onkey.

Thanks,
Laxman

On Thursday 26 January 2012 04:24 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Mon, Jan 23, 2012 at 01:16:15PM +0530, Laxman Dewangan wrote:
>> Implementing irq_set_wake() so that device should able
>> to wakeup the system through different interrupt provided
>> by this device like gpios, onkey, rtc etc.
> Reviewed-by: Mark Brown<broonie@opensource.wolfsonmicro.com>
>
> It will have the side effect of making all interrupts on the PMIC wake
> if any of them does but I suspect this is actually going to be fine in
> practice.
>
> * Unknown Key
> * 0x6E30FDDD

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] mfd: tps65910: Add wakeup support
       [not found] ` <1327304775-12202-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2012-01-26 10:54   ` Mark Brown
@ 2012-02-20 16:57   ` Samuel Ortiz
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Ortiz @ 2012-02-20 16:57 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: jedu-kDsPt+C1G03kYMGBc/C6ZA, lrg-kDsPt+C1G03kYMGBc/C6ZA,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	gg-kDsPt+C1G03kYMGBc/C6ZA, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

Hi Laxman,

On Mon, Jan 23, 2012 at 01:16:15PM +0530, Laxman Dewangan wrote:
> Implementing irq_set_wake() so that device should able
> to wakeup the system through different interrupt provided
> by this device like gpios, onkey, rtc etc.
Thanks, patch applied. And thanks to Mark for the review.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-20 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23  7:46 [PATCH V2] mfd: tps65910: Add wakeup support Laxman Dewangan
     [not found] ` <1327304775-12202-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-01-26 10:54   ` Mark Brown
2012-02-19  7:42     ` Laxman Dewangan
2012-02-20 16:57   ` Samuel Ortiz

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).