public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Cixi Geng <cixi.geng@linux.dev>,
	linus.walleij@linaro.org, brgl@bgdev.pl, orsonzhai@gmail.com,
	zhang.lyra@gmail.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	cixi.geng1@unisoc.com
Subject: Re: [PATCH V3 1/3] gpio: eic-sprd: Make the irqchip immutable
Date: Thu, 29 Dec 2022 10:52:33 +0800	[thread overview]
Message-ID: <c8c5472f-68ca-0b53-e8ba-56f296fb2624@linux.alibaba.com> (raw)
In-Reply-To: <20221228122442.392504-2-cixi.geng@linux.dev>



On 12/28/2022 8:24 PM, Cixi Geng wrote:
> From: Cixi Geng <cixi.geng1@unisoc.com>
> 
> Remove the irq_chip from pmic_eic structure,
> use the various calls by defining the statically
> irq_chip structure.
> 
> Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
> ---
>   drivers/gpio/gpio-eic-sprd.c | 23 ++++++++++++++---------
>   1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
> index 8d722e026e9c..86563c0604e8 100644
> --- a/drivers/gpio/gpio-eic-sprd.c
> +++ b/drivers/gpio/gpio-eic-sprd.c
> @@ -91,7 +91,6 @@ enum sprd_eic_type {
>   
>   struct sprd_eic {
>   	struct gpio_chip chip;
> -	struct irq_chip intc;
>   	void __iomem *base[SPRD_EIC_MAX_BANK];
>   	enum sprd_eic_type type;
>   	spinlock_t lock;
> @@ -255,6 +254,8 @@ static void sprd_eic_irq_mask(struct irq_data *data)
>   	default:
>   		dev_err(chip->parent, "Unsupported EIC type.\n");
>   	}
> +
> +	gpiochip_disable_irq(chip, offset);
>   }
>   
>   static void sprd_eic_irq_unmask(struct irq_data *data)
> @@ -263,6 +264,8 @@ static void sprd_eic_irq_unmask(struct irq_data *data)
>   	struct sprd_eic *sprd_eic = gpiochip_get_data(chip);
>   	u32 offset = irqd_to_hwirq(data);
>   
> +	gpiochip_enable_irq(chip, offset);
> +
>   	switch (sprd_eic->type) {
>   	case SPRD_EIC_DEBOUNCE:
>   		sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IE, 1);
> @@ -564,6 +567,15 @@ static void sprd_eic_irq_handler(struct irq_desc *desc)
>   	chained_irq_exit(ic, desc);
>   }
>   
> +static const struct irq_chip sprd_eic_irq = {
> +	.name		= "sprd-eic-gpio",

Should be "sprd-eic". Otherwise looks good to me.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> +	.irq_ack	= sprd_eic_irq_ack,
> +	.irq_mask	= sprd_eic_irq_mask,
> +	.irq_unmask	= sprd_eic_irq_unmask,
> +	.irq_set_type	= sprd_eic_irq_set_type,
> +	.flags		= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_IMMUTABLE,
> +	GPIOCHIP_IRQ_RESOURCE_HELPERS,
> +};
>   static int sprd_eic_probe(struct platform_device *pdev)
>   {
>   	const struct sprd_eic_variant_data *pdata;
> @@ -626,15 +638,8 @@ static int sprd_eic_probe(struct platform_device *pdev)
>   		break;
>   	}
>   
> -	sprd_eic->intc.name = dev_name(&pdev->dev);
> -	sprd_eic->intc.irq_ack = sprd_eic_irq_ack;
> -	sprd_eic->intc.irq_mask = sprd_eic_irq_mask;
> -	sprd_eic->intc.irq_unmask = sprd_eic_irq_unmask;
> -	sprd_eic->intc.irq_set_type = sprd_eic_irq_set_type;
> -	sprd_eic->intc.flags = IRQCHIP_SKIP_SET_WAKE;
> -
>   	irq = &sprd_eic->chip.irq;
> -	irq->chip = &sprd_eic->intc;
> +	gpio_irq_chip_set_chip(irq, &sprd_eic_irq);
>   	irq->handler = handle_bad_irq;
>   	irq->default_type = IRQ_TYPE_NONE;
>   	irq->parent_handler = sprd_eic_irq_handler;

  reply	other threads:[~2022-12-29  2:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 12:24 [PATCH V3 0/3] Make the irqchip immutable Cixi Geng
2022-12-28 12:24 ` [PATCH V3 1/3] gpio: eic-sprd: " Cixi Geng
2022-12-29  2:52   ` Baolin Wang [this message]
2022-12-28 12:24 ` [PATCH V3 2/3] gpio: gpio-pmic-eic-sprd: " Cixi Geng
2022-12-29  2:57   ` Baolin Wang
2022-12-28 12:24 ` [PATCH V3 3/3] gpio: gpio-sprd: " Cixi Geng
2022-12-29  3:00   ` Baolin Wang

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=c8c5472f-68ca-0b53-e8ba-56f296fb2624@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=brgl@bgdev.pl \
    --cc=cixi.geng1@unisoc.com \
    --cc=cixi.geng@linux.dev \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=zhang.lyra@gmail.com \
    /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