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

Commit 6806db5d authored by Lina Iyer's avatar Lina Iyer
Browse files

drivers: pinctrl: msm: fix GIC warning for IRQ_TYPE_NONE



When drivers request GPIO as IRQ, we would not know the trigger type of
the IRQ. Assumption of any one particular type could cause failure if
the driver requests a different trigger type in request_irq.

Use IRQ_TYPE_NONE when creating the mapping for the IRQ, but assume a
trigger type when setting up the parents to avoid GIC from complaining
about incorrect type.

Change-Id: I0443713099b15a11691ae1f7f5dd17b7879577c0
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 2fd9b6ce
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1017,11 +1017,12 @@ static int msm_gpio_domain_alloc(struct irq_domain *domain, unsigned int virq,

	parent.fwspec.param_count = 2;
	parent.fwspec.param[0] = GPIO_NO_WAKE_IRQ;
	parent.fwspec.param[1] = type;
	ret = of_irq_domain_map(fwspec, &parent.fwspec);
	if (ret == -ENOMEM)
		return ret;

	/* Set something other than IRQ_TYPE_NONE to avoid GIC complaint. */
	parent.fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
	parent.fwspec.fwnode = domain->parent->fwnode;

	ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &parent);
@@ -1043,6 +1044,10 @@ static int msm_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)

	fwspec.fwnode = of_node_to_fwnode(chip->of_node);
	fwspec.param[0] = offset;
	/*
	 * Since we don't know the trigger type, let's create it with
	 * IRQ_TYPE_NONE and let the driver override it in request_irq.
	 */
	fwspec.param[1] = IRQ_TYPE_NONE;
	fwspec.param_count = 2;