From: Rashmica Gupta <rashmica.g@gmail.com>
To: linus.walleij@linaro.org, linux-gpio@vger.kernel.org,
bgolaszewski@baylibre.com
Cc: linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org,
joel@jms.id.au, andrew@aj.id.au,
Rashmica Gupta <rashmica.g@gmail.com>
Subject: [PATCH 2/4] gpio/aspeed: Setup irqchip dynamically
Date: Wed, 4 Sep 2019 16:12:43 +1000 [thread overview]
Message-ID: <20190904061245.30770-2-rashmica.g@gmail.com> (raw)
In-Reply-To: <20190904061245.30770-1-rashmica.g@gmail.com>
This is in preparation for ast2600 as we will have two gpio drivers
which need their own irqchip.
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
---
drivers/gpio/gpio-aspeed.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index 77752b2624e8..60ab042c9129 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -52,6 +52,7 @@ struct aspeed_gpio_config {
*/
struct aspeed_gpio {
struct gpio_chip chip;
+ struct irq_chip irqc;
spinlock_t lock;
void __iomem *base;
int irq;
@@ -681,14 +682,6 @@ static void aspeed_gpio_irq_handler(struct irq_desc *desc)
chained_irq_exit(ic, desc);
}
-static struct irq_chip aspeed_gpio_irqchip = {
- .name = "aspeed-gpio",
- .irq_ack = aspeed_gpio_irq_ack,
- .irq_mask = aspeed_gpio_irq_mask,
- .irq_unmask = aspeed_gpio_irq_unmask,
- .irq_set_type = aspeed_gpio_set_type,
-};
-
static void set_irq_valid_mask(struct aspeed_gpio *gpio)
{
const struct aspeed_bank_props *props = gpio->config->props;
@@ -1192,7 +1185,12 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
gpio->irq = rc;
girq = &gpio->chip.irq;
- girq->chip = &aspeed_gpio_irqchip;
+ girq->chip = &gpio->irqc;
+ girq->chip->name = dev_name(&pdev->dev);
+ girq->chip->irq_ack = aspeed_gpio_irq_ack;
+ girq->chip->irq_mask = aspeed_gpio_irq_mask;
+ girq->chip->irq_unmask = aspeed_gpio_irq_unmask;
+ girq->chip->irq_set_type = aspeed_gpio_set_type;
girq->parent_handler = aspeed_gpio_irq_handler;
girq->num_parents = 1;
girq->parents = devm_kcalloc(&pdev->dev, 1,
--
2.20.1
next prev parent reply other threads:[~2019-09-04 6:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 6:12 [PATCH 1/4] gpio/aspeed: Fix incorrect number of banks Rashmica Gupta
2019-09-04 6:12 ` Rashmica Gupta [this message]
2019-09-04 6:12 ` [PATCH 3/4] gpio: Add in ast2600 details to Aspeed driver Rashmica Gupta
2019-09-04 16:30 ` Andy Shevchenko
2019-09-04 23:34 ` Rashmica Gupta
2019-09-05 8:10 ` Andy Shevchenko
2019-09-04 6:12 ` [PATCH 4/4] gpio: Update documentation with ast2600 controllers Rashmica Gupta
2019-09-04 7:02 ` Bartosz Golaszewski
2019-09-04 23:22 ` Rashmica Gupta
2019-09-04 6:57 ` [PATCH 1/4] gpio/aspeed: Fix incorrect number of banks Bartosz Golaszewski
2019-09-04 16:27 ` Andy Shevchenko
2019-09-04 23:17 ` Rashmica Gupta
2019-09-05 8:08 ` Andy Shevchenko
2019-09-11 17:48 ` Vijay Khemka
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=20190904061245.30770-2-rashmica.g@gmail.com \
--to=rashmica.g@gmail.com \
--cc=andrew@aj.id.au \
--cc=bgolaszewski@baylibre.com \
--cc=joel@jms.id.au \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).