linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: VIC: use the domain mapping function to assign handlers
Date: Fri, 27 Apr 2012 13:00:20 -0600	[thread overview]
Message-ID: <20120427190020.EDB813E0B4D@localhost> (raw)
In-Reply-To: <1334763054-19340-1-git-send-email-linus.walleij@stericsson.com>

On Wed, 18 Apr 2012 17:30:54 +0200, Linus Walleij <linus.walleij@stericsson.com> wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> This removes the internal functions for assigning IRQ
> handlers to each interrupt in favor of using the internal
> map iterator in the irq domain code.
> 
> Cc: Jamie Iles <jamie@jamieiles.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/common/vic.c |   44 ++++++++++++++++++++++++--------------------
>  1 file changed, 24 insertions(+), 20 deletions(-)
> 
> diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
> index c558a3e..e0d5388 100644
> --- a/arch/arm/common/vic.c
> +++ b/arch/arm/common/vic.c
> @@ -39,6 +39,7 @@
>   * struct vic_device - VIC PM device
>   * @irq: The IRQ number for the base of the VIC.
>   * @base: The register base for the VIC.
> + * @valid_sources: A bitmask of valid interrupts
>   * @resume_sources: A bitmask of interrupts for resume.
>   * @resume_irqs: The IRQs enabled for resume.
>   * @int_select: Save for VIC_INT_SELECT.
> @@ -50,6 +51,7 @@
>  struct vic_device {
>  	void __iomem	*base;
>  	int		irq;
> +	u32		valid_sources;
>  	u32		resume_sources;
>  	u32		resume_irqs;
>  	u32		int_select;
> @@ -164,6 +166,27 @@ static int __init vic_pm_init(void)
>  late_initcall(vic_pm_init);
>  #endif /* CONFIG_PM */
>  
> +static struct irq_chip vic_chip;
> +
> +static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
> +			     irq_hw_number_t hwirq)
> +{
> +	struct vic_device *v = d->host_data;
> +
> +	/* Skip invalid IRQs, only register handlers for the real ones */
> +	if (!(v->valid_sources & (1 << hwirq)))
> +		return -ENOTSUPP;
> +	irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
> +	irq_set_chip_data(irq, v->base);
> +	set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
> +	return 0;
> +}
> +
> +static struct irq_domain_ops vic_irqdomain_ops = {
> +	.map = vic_irqdomain_map,
> +	.xlate = irq_domain_xlate_onetwocell,
> +};

It looks like this patch also needs to update the
irq_domain_add_legacy() call to use this ops structure instead of
irq_domain_simple_ops.

g.

  parent reply	other threads:[~2012-04-27 19:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 15:30 [PATCH 2/2] ARM: VIC: use the domain mapping function to assign handlers Linus Walleij
2012-04-19 15:46 ` Jamie Iles
2012-04-27 19:00 ` Grant Likely [this message]
2012-04-27 20:29   ` Linus Walleij
2012-04-27 20:46     ` Grant Likely

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=20120427190020.EDB813E0B4D@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.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).