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

Commit 479a0c7e authored by Linus Walleij's avatar Linus Walleij Committed by Grant Likely
Browse files

gpio/nomadik: use genirq core to track enablement



Currently the Nomadik GPIO driver tracks enabled/disabled interrupt
status with a local variable, switch to using the interrupt core.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 3c0227d2
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ struct nmk_gpio_chip {
	u32 rwimsc;
	u32 fwimsc;
	u32 slpm;
	u32 enabled;
	u32 pull_up;
};

@@ -605,11 +604,6 @@ static int nmk_gpio_irq_maskunmask(struct irq_data *d, bool enable)
	if (!nmk_chip)
		return -EINVAL;

	if (enable)
		nmk_chip->enabled |= bitmask;
	else
		nmk_chip->enabled &= ~bitmask;

	clk_enable(nmk_chip->clk);
	spin_lock_irqsave(&nmk_gpio_slpm_lock, flags);
	spin_lock(&nmk_chip->lock);
@@ -653,7 +647,7 @@ static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
	spin_lock_irqsave(&nmk_gpio_slpm_lock, flags);
	spin_lock(&nmk_chip->lock);

	if (!(nmk_chip->enabled & bitmask))
	if (irqd_irq_disabled(d))
		__nmk_gpio_set_wake(nmk_chip, gpio, on);

	if (on)
@@ -670,7 +664,7 @@ static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on)

static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{
	bool enabled;
	bool enabled = !irqd_irq_disabled(d);
	bool wake = irqd_is_wakeup_set(d);
	int gpio;
	struct nmk_gpio_chip *nmk_chip;
@@ -691,7 +685,6 @@ static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
	clk_enable(nmk_chip->clk);
	spin_lock_irqsave(&nmk_chip->lock, flags);

	enabled = !!(nmk_chip->enabled & bitmask);
	if (enabled)
		__nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, false);