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

Commit a60239e3 authored by Laxminath Kasam's avatar Laxminath Kasam Committed by Meng Wang
Browse files

soc: soundwire: Add support for GPIO interrupt path



In trinket target, interrupt for wakeup is provided via
chip TLMM. Add required support to handle wakeup
interrupt on SWR data line triggered over this TLMM line.

Change-Id: I7fb6d7009a6271d54d0f11f99930b0d039f57129
Signed-off-by: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent 452772ab
Loading
Loading
Loading
Loading
+21 −8
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
#include <linux/kthread.h>
#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
#include <linux/debugfs.h>
@@ -2168,17 +2170,28 @@ static int swrm_device_down(struct device *dev)
int swrm_register_wake_irq(struct swr_mstr_ctrl *swrm)
{
	int ret = 0;
	int irq, dir_apps_irq;

	if (!swrm->ipc_wakeup) {
		swrm->wake_irq = platform_get_irq_byname(swrm->pdev,
					"swr_wake_irq");
		irq = of_get_named_gpio(swrm->dev->of_node,
					"qcom,swr-wakeup-irq", 0);
		if (gpio_is_valid(irq)) {
			swrm->wake_irq = gpio_to_irq(irq);
			if (swrm->wake_irq < 0) {
				dev_err(swrm->dev,
				"%s() error getting wake irq handle: %d\n",
				__func__, swrm->wake_irq);
					"Unable to configure irq\n");
				return swrm->wake_irq;
			}
		} else {
			dir_apps_irq = platform_get_irq_byname(swrm->pdev,
							"swr_wake_irq");
			if (dir_apps_irq < 0) {
				dev_err(swrm->dev,
					"TLMM connect gpio not found\n");
				return -EINVAL;
			}

			swrm->wake_irq = dir_apps_irq;
		}
		ret = request_threaded_irq(swrm->wake_irq, NULL,
					   swrm_wakeup_interrupt,
					   IRQF_TRIGGER_HIGH | IRQF_ONESHOT,