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

Commit 262f0b30 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi Committed by Gerrit - the friendly Code Review server
Browse files

msm: ep_pcie: Change perst irq from edge to level



Change perst irq from edge to level to prevent unwanted
system wakeups due to probable noise on the perst gpio.
Also modify the trigger level based on the expected
value (level) of the gpio.

Change-Id: I83be49c0a50d08e143caf70ecfbba6dbf94cd6b2
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
parent 26162f7c
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -2299,6 +2299,10 @@ static irqreturn_t ep_pcie_handle_perst_irq(int irq, void *data)
	}

out:
	/* Set trigger type based on the next expected value of perst gpio */
	irq_set_irq_type(gpio_to_irq(dev->gpio[EP_PCIE_GPIO_PERST].num),
		(perst ? IRQF_TRIGGER_LOW : IRQF_TRIGGER_HIGH));

	spin_unlock_irqrestore(&dev->isr_lock, irqsave_flags);

	return IRQ_HANDLED;
@@ -2523,11 +2527,18 @@ int32_t ep_pcie_irq_init(struct ep_pcie_dev_t *dev)
	}

perst_irq:
	/*
	 * Check initial state of perst gpio to set the trigger type
	 * based on the next expected level of the gpio
	 */
	if (gpio_get_value(dev->gpio[EP_PCIE_GPIO_PERST].num) == 1)
		dev->perst_deast = true;

	/* register handler for PERST interrupt */
	perst_irq = gpio_to_irq(dev->gpio[EP_PCIE_GPIO_PERST].num);
	ret = devm_request_irq(pdev, perst_irq,
		ep_pcie_handle_perst_irq,
		IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
		(dev->perst_deast ? IRQF_TRIGGER_LOW : IRQF_TRIGGER_HIGH),
		"ep_pcie_perst", dev);
	if (ret) {
		EP_PCIE_ERR(dev,