Commit a335366b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'gpio-fixes-for-v6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - fix the level-low interrupt type support in gpio-mpc8xxx

 - convert another two drivers to using immutable irq chips

 - MAINTAINERS update

* tag 'gpio-fixes-for-v6.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: mt7621: Make the irqchip immutable
  gpio: ixp4xx: Make irqchip immutable
  MAINTAINERS: Update HiSilicon GPIO Driver maintainer
  gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx
parents 6879c2d3 09eed5a1
...@@ -9122,7 +9122,7 @@ S: Maintained ...@@ -9122,7 +9122,7 @@ S: Maintained
F: drivers/dma/hisi_dma.c F: drivers/dma/hisi_dma.c
HISILICON GPIO DRIVER HISILICON GPIO DRIVER
M: Luo Jiaxing <luojiaxing@huawei.com> M: Jay Fang <f.fangjian@huawei.com>
L: linux-gpio@vger.kernel.org L: linux-gpio@vger.kernel.org
S: Maintained S: Maintained
F: drivers/gpio/gpio-hisi.c F: drivers/gpio/gpio-hisi.c
......
...@@ -63,6 +63,14 @@ static void ixp4xx_gpio_irq_ack(struct irq_data *d) ...@@ -63,6 +63,14 @@ static void ixp4xx_gpio_irq_ack(struct irq_data *d)
__raw_writel(BIT(d->hwirq), g->base + IXP4XX_REG_GPIS); __raw_writel(BIT(d->hwirq), g->base + IXP4XX_REG_GPIS);
} }
static void ixp4xx_gpio_mask_irq(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_chip_mask_parent(d);
gpiochip_disable_irq(gc, d->hwirq);
}
static void ixp4xx_gpio_irq_unmask(struct irq_data *d) static void ixp4xx_gpio_irq_unmask(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
...@@ -72,6 +80,7 @@ static void ixp4xx_gpio_irq_unmask(struct irq_data *d) ...@@ -72,6 +80,7 @@ static void ixp4xx_gpio_irq_unmask(struct irq_data *d)
if (!(g->irq_edge & BIT(d->hwirq))) if (!(g->irq_edge & BIT(d->hwirq)))
ixp4xx_gpio_irq_ack(d); ixp4xx_gpio_irq_ack(d);
gpiochip_enable_irq(gc, d->hwirq);
irq_chip_unmask_parent(d); irq_chip_unmask_parent(d);
} }
...@@ -149,12 +158,14 @@ static int ixp4xx_gpio_irq_set_type(struct irq_data *d, unsigned int type) ...@@ -149,12 +158,14 @@ static int ixp4xx_gpio_irq_set_type(struct irq_data *d, unsigned int type)
return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH);
} }
static struct irq_chip ixp4xx_gpio_irqchip = { static const struct irq_chip ixp4xx_gpio_irqchip = {
.name = "IXP4GPIO", .name = "IXP4GPIO",
.irq_ack = ixp4xx_gpio_irq_ack, .irq_ack = ixp4xx_gpio_irq_ack,
.irq_mask = irq_chip_mask_parent, .irq_mask = ixp4xx_gpio_mask_irq,
.irq_unmask = ixp4xx_gpio_irq_unmask, .irq_unmask = ixp4xx_gpio_irq_unmask,
.irq_set_type = ixp4xx_gpio_irq_set_type, .irq_set_type = ixp4xx_gpio_irq_set_type,
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
}; };
static int ixp4xx_gpio_child_to_parent_hwirq(struct gpio_chip *gc, static int ixp4xx_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
...@@ -263,7 +274,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev) ...@@ -263,7 +274,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
g->gc.owner = THIS_MODULE; g->gc.owner = THIS_MODULE;
girq = &g->gc.irq; girq = &g->gc.irq;
girq->chip = &ixp4xx_gpio_irqchip; gpio_irq_chip_set_chip(girq, &ixp4xx_gpio_irqchip);
girq->fwnode = g->fwnode; girq->fwnode = g->fwnode;
girq->parent_domain = parent; girq->parent_domain = parent;
girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq; girq->child_to_parent_hwirq = ixp4xx_gpio_child_to_parent_hwirq;
......
...@@ -169,6 +169,7 @@ static int mpc8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type) ...@@ -169,6 +169,7 @@ static int mpc8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type)
switch (flow_type) { switch (flow_type) {
case IRQ_TYPE_EDGE_FALLING: case IRQ_TYPE_EDGE_FALLING:
case IRQ_TYPE_LEVEL_LOW:
raw_spin_lock_irqsave(&mpc8xxx_gc->lock, flags); raw_spin_lock_irqsave(&mpc8xxx_gc->lock, flags);
gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR,
gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR)
......
...@@ -112,6 +112,8 @@ mediatek_gpio_irq_unmask(struct irq_data *d) ...@@ -112,6 +112,8 @@ mediatek_gpio_irq_unmask(struct irq_data *d)
unsigned long flags; unsigned long flags;
u32 rise, fall, high, low; u32 rise, fall, high, low;
gpiochip_enable_irq(gc, d->hwirq);
spin_lock_irqsave(&rg->lock, flags); spin_lock_irqsave(&rg->lock, flags);
rise = mtk_gpio_r32(rg, GPIO_REG_REDGE); rise = mtk_gpio_r32(rg, GPIO_REG_REDGE);
fall = mtk_gpio_r32(rg, GPIO_REG_FEDGE); fall = mtk_gpio_r32(rg, GPIO_REG_FEDGE);
...@@ -143,6 +145,8 @@ mediatek_gpio_irq_mask(struct irq_data *d) ...@@ -143,6 +145,8 @@ mediatek_gpio_irq_mask(struct irq_data *d)
mtk_gpio_w32(rg, GPIO_REG_HLVL, high & ~BIT(pin)); mtk_gpio_w32(rg, GPIO_REG_HLVL, high & ~BIT(pin));
mtk_gpio_w32(rg, GPIO_REG_LLVL, low & ~BIT(pin)); mtk_gpio_w32(rg, GPIO_REG_LLVL, low & ~BIT(pin));
spin_unlock_irqrestore(&rg->lock, flags); spin_unlock_irqrestore(&rg->lock, flags);
gpiochip_disable_irq(gc, d->hwirq);
} }
static int static int
...@@ -204,6 +208,16 @@ mediatek_gpio_xlate(struct gpio_chip *chip, ...@@ -204,6 +208,16 @@ mediatek_gpio_xlate(struct gpio_chip *chip,
return gpio % MTK_BANK_WIDTH; return gpio % MTK_BANK_WIDTH;
} }
static const struct irq_chip mt7621_irq_chip = {
.name = "mt7621-gpio",
.irq_mask_ack = mediatek_gpio_irq_mask,
.irq_mask = mediatek_gpio_irq_mask,
.irq_unmask = mediatek_gpio_irq_unmask,
.irq_set_type = mediatek_gpio_irq_type,
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static int static int
mediatek_gpio_bank_probe(struct device *dev, int bank) mediatek_gpio_bank_probe(struct device *dev, int bank)
{ {
...@@ -238,11 +252,6 @@ mediatek_gpio_bank_probe(struct device *dev, int bank) ...@@ -238,11 +252,6 @@ mediatek_gpio_bank_probe(struct device *dev, int bank)
return -ENOMEM; return -ENOMEM;
rg->chip.offset = bank * MTK_BANK_WIDTH; rg->chip.offset = bank * MTK_BANK_WIDTH;
rg->irq_chip.name = dev_name(dev);
rg->irq_chip.irq_unmask = mediatek_gpio_irq_unmask;
rg->irq_chip.irq_mask = mediatek_gpio_irq_mask;
rg->irq_chip.irq_mask_ack = mediatek_gpio_irq_mask;
rg->irq_chip.irq_set_type = mediatek_gpio_irq_type;
if (mtk->gpio_irq) { if (mtk->gpio_irq) {
struct gpio_irq_chip *girq; struct gpio_irq_chip *girq;
...@@ -262,7 +271,7 @@ mediatek_gpio_bank_probe(struct device *dev, int bank) ...@@ -262,7 +271,7 @@ mediatek_gpio_bank_probe(struct device *dev, int bank)
} }
girq = &rg->chip.irq; girq = &rg->chip.irq;
girq->chip = &rg->irq_chip; gpio_irq_chip_set_chip(girq, &mt7621_irq_chip);
/* This will let us handle the parent IRQ in the driver */ /* This will let us handle the parent IRQ in the driver */
girq->parent_handler = NULL; girq->parent_handler = NULL;
girq->num_parents = 0; girq->num_parents = 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