mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 04:35:27 +07:00
pinctrl: lynxpoint: Implement ->irq_ack() callback
Instead of playing tricks with registers in the interrupt handler, utilize the IRQ chip core for ACKing interrupts properly. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
parent
540bff18da
commit
5931e6edfd
@ -218,9 +218,6 @@ static void lp_gpio_irq_handler(struct irq_desc *desc)
|
|||||||
for_each_set_bit(pin, &pending, 32) {
|
for_each_set_bit(pin, &pending, 32) {
|
||||||
unsigned int irq;
|
unsigned int irq;
|
||||||
|
|
||||||
/* Clear before handling so we don't lose an edge */
|
|
||||||
iowrite32(BIT(pin), reg);
|
|
||||||
|
|
||||||
irq = irq_find_mapping(lg->chip.irq.domain, base + pin);
|
irq = irq_find_mapping(lg->chip.irq.domain, base + pin);
|
||||||
generic_handle_irq(irq);
|
generic_handle_irq(irq);
|
||||||
}
|
}
|
||||||
@ -228,6 +225,19 @@ static void lp_gpio_irq_handler(struct irq_desc *desc)
|
|||||||
chip->irq_eoi(data);
|
chip->irq_eoi(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void lp_irq_ack(struct irq_data *d)
|
||||||
|
{
|
||||||
|
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||||
|
struct lp_gpio *lg = gpiochip_get_data(gc);
|
||||||
|
u32 hwirq = irqd_to_hwirq(d);
|
||||||
|
void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_STAT);
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
raw_spin_lock_irqsave(&lg->lock, flags);
|
||||||
|
iowrite32(BIT(hwirq % 32), reg);
|
||||||
|
raw_spin_unlock_irqrestore(&lg->lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
static void lp_irq_unmask(struct irq_data *d)
|
static void lp_irq_unmask(struct irq_data *d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -313,6 +323,7 @@ static int lp_irq_set_type(struct irq_data *d, unsigned int type)
|
|||||||
|
|
||||||
static struct irq_chip lp_irqchip = {
|
static struct irq_chip lp_irqchip = {
|
||||||
.name = "LP-GPIO",
|
.name = "LP-GPIO",
|
||||||
|
.irq_ack = lp_irq_ack,
|
||||||
.irq_mask = lp_irq_mask,
|
.irq_mask = lp_irq_mask,
|
||||||
.irq_unmask = lp_irq_unmask,
|
.irq_unmask = lp_irq_unmask,
|
||||||
.irq_enable = lp_irq_enable,
|
.irq_enable = lp_irq_enable,
|
||||||
|
Loading…
Reference in New Issue
Block a user