linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "René van Dorst"
	<opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org>,
	"Linus Walleij"
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Bartosz Golaszewski"
	<bgolaszewski-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	"Matthias Brugger"
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCHv2] gpio: MT7621: use a per instance irq_chip structure
Date: Thu, 31 Jan 2019 10:55:22 +1000	[thread overview]
Message-ID: <ecccbc5f-bfca-f452-3c3b-14b4655eb00c@kernel.org> (raw)
In-Reply-To: <20190130161048.9852-1-opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org>

Hi René,

On 31/1/19 2:10 am, René van Dorst wrote:
> 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.
> 
> Fixes: 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621")
> 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
> Cc: stable@vger.kernel.org

Works great on my MT7621 hardware.

Tested-by: Greg Ungerer <gerg@kernel.org>

Regards
Greg


> ---
>   drivers/gpio/gpio-mt7621.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> v2: Remove an empty line
>      Add Cc stable
> 
> diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
> index 00e954f22bc9..74401e0adb29 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,13 +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,
>   		    const struct of_phandle_args *spec, u32 *flags)
> @@ -254,6 +248,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 +271,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 +311,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);
> 

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

  parent reply	other threads:[~2019-01-31  0:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 16:10 [PATCHv2] gpio: MT7621: use a per instance irq_chip structure René van Dorst
     [not found] ` <20190130161048.9852-1-opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org>
2019-01-31  0:55   ` Greg Ungerer [this message]
2019-02-08 11:30 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecccbc5f-bfca-f452-3c3b-14b4655eb00c@kernel.org \
    --to=gerg-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=bgolaszewski-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=opensource-91nzXlUTePbQT0dZR+AlfA@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).