Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 445f77d0 authored by Pavankumar Vijapur's avatar Pavankumar Vijapur Committed by Karthick Shanmugham
Browse files

drivers: qcom: sdx_ext_ipc: keep wakeup irq always on



When suspend is in progress on local processor, if
remote processor toggles GPIO to indicate a resume
event to local processor, this event may get lost.
This commit addresses this situation.

1. Add IRQF_NO_SUSPEND flag so that wakeup_irq is
not disabled during suspend on local processor.

2. Install primary handler that inform pm core
that a system wakeup event has happened. The pm
core can then abort a suspend in progress.

Change-Id: I8d84f15a118c4630bde7b9db35ffadddeb937cb9
Signed-off-by: default avatarPavankumar Vijapur <pvijapur@codeaurora.org>
Signed-off-by: default avatarYogesh Lal <ylal@codeaurora.org>
parent 15614d33
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/suspend.h>
#include <soc/qcom/sb_notification.h>

#define STATUS_UP 1
@@ -304,6 +305,12 @@ static int sdx_ext_ipc_panic(struct notifier_block *this,
	return NOTIFY_DONE;
}

static irqreturn_t hw_irq_handler(int irq, void *p)
{
	pm_system_wakeup();
	return IRQ_WAKE_THREAD;
}

static int sdx_ext_ipc_probe(struct platform_device *pdev)
{
	int ret;
@@ -371,9 +378,9 @@ static int sdx_ext_ipc_probe(struct platform_device *pdev)

	if (mdm->gpios[WAKEUP_IN] >= 0) {
		ret = devm_request_threaded_irq(mdm->dev, mdm->wakeup_irq,
				sdx_ext_ipc_wakeup_irq, NULL,
				IRQF_TRIGGER_FALLING, "sdx_ext_ipc_wakeup",
				mdm);
				hw_irq_handler, sdx_ext_ipc_wakeup_irq,
				IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
				IRQF_NO_SUSPEND, "sdx_ext_ipc_wakeup", mdm);
		if (ret < 0) {
			dev_err(mdm->dev,
				"%s: WAKEUP_IN IRQ#%d request failed,\n",