Commit bf0d394e authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Bartosz Golaszewski

gpio/aspeed-sgpio: don't enable all interrupts by default

Currently, the IRQ setup for the SGPIO driver enables all interrupts in
dual-edge trigger mode. Since the default handler is handle_bad_irq, any
state change on input GPIOs will trigger bad IRQ warnings.

This change applies sensible IRQ defaults: single-edge trigger, and all
IRQs disabled.
Signed-off-by: default avatarJeremy Kerr <jk@codeconstruct.com.au>
Fixes: 7db47faa ("gpio: aspeed: Add SGPIO driver")
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Acked-by: default avatarAndrew Jeffery <andrew@aj.id.au>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent ac67b07e
...@@ -452,17 +452,15 @@ static int aspeed_sgpio_setup_irqs(struct aspeed_sgpio *gpio, ...@@ -452,17 +452,15 @@ static int aspeed_sgpio_setup_irqs(struct aspeed_sgpio *gpio,
irq->parents = &gpio->irq; irq->parents = &gpio->irq;
irq->num_parents = 1; irq->num_parents = 1;
/* set IRQ settings and Enable Interrupt */ /* Apply default IRQ settings */
for (i = 0; i < ARRAY_SIZE(aspeed_sgpio_banks); i++) { for (i = 0; i < ARRAY_SIZE(aspeed_sgpio_banks); i++) {
bank = &aspeed_sgpio_banks[i]; bank = &aspeed_sgpio_banks[i];
/* set falling or level-low irq */ /* set falling or level-low irq */
iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type0)); iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type0));
/* trigger type is edge */ /* trigger type is edge */
iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type1)); iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type1));
/* dual edge trigger mode. */ /* single edge trigger */
iowrite32(0xffffffff, bank_reg(gpio, bank, reg_irq_type2)); iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type2));
/* enable irq */
iowrite32(0xffffffff, bank_reg(gpio, bank, reg_irq_enable));
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment