* [PATCH] gpio: MT7621: use a per instance irq_chip structure
@ 2019-01-30 15:17 René van Dorst
[not found] ` <20190130151744.11145-1-opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: René van Dorst @ 2019-01-30 15:17 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Matthias Brugger
Cc: René van Dorst, gerg-DgEjT+Ai2ygdnm+yROfE0A,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-gpio-u79uwXL29TY76Z2rM5mHXA
This fixes the kernel complains:
gpio gpiochip1: (1e000600.gpio-bank1): detected irqchip that is shared
with multiple gpiochips: please fix the driver.
gpio gpiochip2: (1e000600.gpio-bank2): detected irqchip that is shared
with multiple gpiochips: please fix the driver.
Signed-off-by: René van Dorst <opensource@vdorst.com>
Cc: linux-gpio@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: gerg@kernel.org
---
drivers/gpio/gpio-mt7621.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index 00e954f22bc9..89fb000480dc 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -30,6 +30,7 @@
#define GPIO_REG_EDGE 0xA0
struct mtk_gc {
+ struct irq_chip irq_chip;
struct gpio_chip chip;
spinlock_t lock;
int bank;
@@ -189,12 +190,6 @@ mediatek_gpio_irq_type(struct irq_data *d, unsigned int type)
return 0;
}
-static struct irq_chip mediatek_gpio_irq_chip = {
- .irq_unmask = mediatek_gpio_irq_unmask,
- .irq_mask = mediatek_gpio_irq_mask,
- .irq_mask_ack = mediatek_gpio_irq_mask,
- .irq_set_type = mediatek_gpio_irq_type,
-};
static int
mediatek_gpio_xlate(struct gpio_chip *chip,
@@ -254,6 +249,13 @@ mediatek_gpio_bank_probe(struct device *dev,
return ret;
}
+ rg->irq_chip.name = dev_name(dev);
+ rg->irq_chip.parent_device = 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) {
/*
* Manually request the irq here instead of passing
@@ -270,14 +272,14 @@ mediatek_gpio_bank_probe(struct device *dev,
return ret;
}
- ret = gpiochip_irqchip_add(&rg->chip, &mediatek_gpio_irq_chip,
+ ret = gpiochip_irqchip_add(&rg->chip, &rg->irq_chip,
0, handle_simple_irq, IRQ_TYPE_NONE);
if (ret) {
dev_err(dev, "failed to add gpiochip_irqchip\n");
return ret;
}
- gpiochip_set_chained_irqchip(&rg->chip, &mediatek_gpio_irq_chip,
+ gpiochip_set_chained_irqchip(&rg->chip, &rg->irq_chip,
mtk->gpio_irq, NULL);
}
@@ -310,7 +312,6 @@ mediatek_gpio_probe(struct platform_device *pdev)
mtk->gpio_irq = irq_of_parse_and_map(np, 0);
mtk->dev = dev;
platform_set_drvdata(pdev, mtk);
- mediatek_gpio_irq_chip.name = dev_name(dev);
for (i = 0; i < MTK_BANK_CNT; i++) {
ret = mediatek_gpio_bank_probe(dev, np, i);
--
2.19.1
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <20190130151744.11145-1-opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] gpio: MT7621: use a per instance irq_chip structure [not found] ` <20190130151744.11145-1-opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org> @ 2019-01-30 15:49 ` Bartosz Golaszewski [not found] ` <CAMpxmJVj_ZrwjHbfmXQ+SANHU+m+4r6OzyhqXA33aR+z4H33Fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Bartosz Golaszewski @ 2019-01-30 15:49 UTC (permalink / raw) To: René van Dorst Cc: Matthias Brugger, linux-gpio, Linus Walleij, gerg-DgEjT+Ai2ygdnm+yROfE0A, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r śr., 30 sty 2019 o 16:22 René van Dorst <opensource@vdorst.com> napisał(a): > > This fixes the kernel complains: > gpio gpiochip1: (1e000600.gpio-bank1): detected irqchip that is shared > with multiple gpiochips: please fix the driver. > gpio gpiochip2: (1e000600.gpio-bank2): detected irqchip that is shared > with multiple gpiochips: please fix the driver. > > Signed-off-by: René van Dorst <opensource@vdorst.com> > Cc: linux-gpio@vger.kernel.org > Cc: linux-mediatek@lists.infradead.org > Cc: gerg@kernel.org Please add the Fixes: tag and Cc stable while you're at it. Bart > --- > drivers/gpio/gpio-mt7621.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c > index 00e954f22bc9..89fb000480dc 100644 > --- a/drivers/gpio/gpio-mt7621.c > +++ b/drivers/gpio/gpio-mt7621.c > @@ -30,6 +30,7 @@ > #define GPIO_REG_EDGE 0xA0 > > struct mtk_gc { > + struct irq_chip irq_chip; > struct gpio_chip chip; > spinlock_t lock; > int bank; > @@ -189,12 +190,6 @@ mediatek_gpio_irq_type(struct irq_data *d, unsigned int type) > return 0; > } > > -static struct irq_chip mediatek_gpio_irq_chip = { > - .irq_unmask = mediatek_gpio_irq_unmask, > - .irq_mask = mediatek_gpio_irq_mask, > - .irq_mask_ack = mediatek_gpio_irq_mask, > - .irq_set_type = mediatek_gpio_irq_type, > -}; > > static int > mediatek_gpio_xlate(struct gpio_chip *chip, > @@ -254,6 +249,13 @@ mediatek_gpio_bank_probe(struct device *dev, > return ret; > } > > + rg->irq_chip.name = dev_name(dev); > + rg->irq_chip.parent_device = 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) { > /* > * Manually request the irq here instead of passing > @@ -270,14 +272,14 @@ mediatek_gpio_bank_probe(struct device *dev, > return ret; > } > > - ret = gpiochip_irqchip_add(&rg->chip, &mediatek_gpio_irq_chip, > + ret = gpiochip_irqchip_add(&rg->chip, &rg->irq_chip, > 0, handle_simple_irq, IRQ_TYPE_NONE); > if (ret) { > dev_err(dev, "failed to add gpiochip_irqchip\n"); > return ret; > } > > - gpiochip_set_chained_irqchip(&rg->chip, &mediatek_gpio_irq_chip, > + gpiochip_set_chained_irqchip(&rg->chip, &rg->irq_chip, > mtk->gpio_irq, NULL); > } > > @@ -310,7 +312,6 @@ mediatek_gpio_probe(struct platform_device *pdev) > mtk->gpio_irq = irq_of_parse_and_map(np, 0); > mtk->dev = dev; > platform_set_drvdata(pdev, mtk); > - mediatek_gpio_irq_chip.name = dev_name(dev); > > for (i = 0; i < MTK_BANK_CNT; i++) { > ret = mediatek_gpio_bank_probe(dev, np, i); > -- > 2.19.1 > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <CAMpxmJVj_ZrwjHbfmXQ+SANHU+m+4r6OzyhqXA33aR+z4H33Fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] gpio: MT7621: use a per instance irq_chip structure [not found] ` <CAMpxmJVj_ZrwjHbfmXQ+SANHU+m+4r6OzyhqXA33aR+z4H33Fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2019-01-30 16:22 ` René van Dorst 0 siblings, 0 replies; 3+ messages in thread From: René van Dorst @ 2019-01-30 16:22 UTC (permalink / raw) To: Bartosz Golaszewski Cc: Matthias Brugger, linux-gpio, Linus Walleij, gerg-DgEjT+Ai2ygdnm+yROfE0A, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Quoting Bartosz Golaszewski <bgolaszewski@baylibre.com>: > śr., 30 sty 2019 o 16:22 René van Dorst <opensource@vdorst.com> napisał(a): >> >> This fixes the kernel complains: >> gpio gpiochip1: (1e000600.gpio-bank1): detected irqchip that is shared >> with multiple gpiochips: please fix the driver. >> gpio gpiochip2: (1e000600.gpio-bank2): detected irqchip that is shared >> with multiple gpiochips: please fix the driver. >> >> Signed-off-by: René van Dorst <opensource@vdorst.com> >> Cc: linux-gpio@vger.kernel.org >> Cc: linux-mediatek@lists.infradead.org >> Cc: gerg@kernel.org > Hi Bart, > Please add the Fixes: tag and Cc stable while you're at it. Fixed in v2. Greats, René > Bart > >> --- >> drivers/gpio/gpio-mt7621.c | 19 ++++++++++--------- >> 1 file changed, 10 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c >> index 00e954f22bc9..89fb000480dc 100644 >> --- a/drivers/gpio/gpio-mt7621.c >> +++ b/drivers/gpio/gpio-mt7621.c >> @@ -30,6 +30,7 @@ >> #define GPIO_REG_EDGE 0xA0 >> >> struct mtk_gc { >> + struct irq_chip irq_chip; >> struct gpio_chip chip; >> spinlock_t lock; >> int bank; >> @@ -189,12 +190,6 @@ mediatek_gpio_irq_type(struct irq_data *d, >> unsigned int type) >> return 0; >> } >> >> -static struct irq_chip mediatek_gpio_irq_chip = { >> - .irq_unmask = mediatek_gpio_irq_unmask, >> - .irq_mask = mediatek_gpio_irq_mask, >> - .irq_mask_ack = mediatek_gpio_irq_mask, >> - .irq_set_type = mediatek_gpio_irq_type, >> -}; >> >> static int >> mediatek_gpio_xlate(struct gpio_chip *chip, >> @@ -254,6 +249,13 @@ mediatek_gpio_bank_probe(struct device *dev, >> return ret; >> } >> >> + rg->irq_chip.name = dev_name(dev); >> + rg->irq_chip.parent_device = 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) { >> /* >> * Manually request the irq here instead of passing >> @@ -270,14 +272,14 @@ mediatek_gpio_bank_probe(struct device *dev, >> return ret; >> } >> >> - ret = gpiochip_irqchip_add(&rg->chip, >> &mediatek_gpio_irq_chip, >> + ret = gpiochip_irqchip_add(&rg->chip, &rg->irq_chip, >> 0, handle_simple_irq, >> IRQ_TYPE_NONE); >> if (ret) { >> dev_err(dev, "failed to add gpiochip_irqchip\n"); >> return ret; >> } >> >> - gpiochip_set_chained_irqchip(&rg->chip, >> &mediatek_gpio_irq_chip, >> + gpiochip_set_chained_irqchip(&rg->chip, &rg->irq_chip, >> mtk->gpio_irq, NULL); >> } >> >> @@ -310,7 +312,6 @@ mediatek_gpio_probe(struct platform_device *pdev) >> mtk->gpio_irq = irq_of_parse_and_map(np, 0); >> mtk->dev = dev; >> platform_set_drvdata(pdev, mtk); >> - mediatek_gpio_irq_chip.name = dev_name(dev); >> >> for (i = 0; i < MTK_BANK_CNT; i++) { >> ret = mediatek_gpio_bank_probe(dev, np, i); >> -- >> 2.19.1 >> _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-30 16:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-30 15:17 [PATCH] gpio: MT7621: use a per instance irq_chip structure René van Dorst
[not found] ` <20190130151744.11145-1-opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org>
2019-01-30 15:49 ` Bartosz Golaszewski
[not found] ` <CAMpxmJVj_ZrwjHbfmXQ+SANHU+m+4r6OzyhqXA33aR+z4H33Fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-01-30 16:22 ` René van Dorst
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).