Skip to contentSkip to conversation

mfd: tps65910: Add wakeup support

PATCH In review Laxman Dewangan 3 participants 4 messages Jan 23, 2012 – Feb 20, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mfd: tps65910: Add wakeup support

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.

---
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(-)
drivers/mfd/tps65910-irq.c +11 -0
index a56be93..0c13042 100644
@@ -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,
Signature · 1 line
1.7.1.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · Laxman Dewangan

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.

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.

#2 lore raw

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

Quoted 14 lines · Mark Brown

* PGP Signed by an unknown key

Quoted 3 lines · Laxman Dewangan

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.

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

#3 lore raw
In reply to Laxman Dewangan

Hi Laxman,

Quoted 3 lines · Laxman Dewangan

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.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/