All of lore.kernel.org
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCHv4 6/6] irqchip: TI-Nspire irqchip support
Date: Thu, 30 May 2013 22:29:45 +0100	[thread overview]
Message-ID: <20130530212945.C026C3E0A90@localhost> (raw)
In-Reply-To: <1369480087-24786-7-git-send-email-dt.tangr@gmail.com>

On Sat, 25 May 2013 21:08:07 +1000, Daniel Tang <dt.tangr@gmail.com> wrote:
> Add support for the interrupt controller on TI-Nspires.
> 
> Signed-off-by: Daniel Tang <dt.tangr@gmail.com>
[...]
> +static void nspire_irq_ack(struct irq_data *irqd)
> +{
> +	void __iomem *base = irq_io_base;
> +
> +	if (irqd->hwirq < FIQ_START)
> +		base += IO_IRQ_BASE;
> +	else
> +		base += IO_FIQ_BASE;
> +
> +	readl(base + IO_RESET);
> +}
> +
> +static void nspire_irq_unmask(struct irq_data *irqd)
> +{
> +	void __iomem *base = irq_io_base;
> +	int irqnr = irqd->hwirq;
> +
> +	if (irqnr < FIQ_START) {
> +		base += IO_IRQ_BASE;
> +	} else {
> +		irqnr -= MAX_INTRS;
> +		base += IO_FIQ_BASE;
> +	}
> +
> +	writel((1<<irqnr), base + IO_ENABLE);
> +}
> +
> +static void nspire_irq_mask(struct irq_data *irqd)
> +{
> +	void __iomem *base = irq_io_base;
> +	int irqnr = irqd->hwirq;
> +
> +	if (irqnr < FIQ_START) {
> +		base += IO_IRQ_BASE;
> +	} else {
> +		irqnr -= FIQ_START;
> +		base += IO_FIQ_BASE;
> +	}
> +
> +	writel((1<<irqnr), base + IO_DISABLE);
> +}
> +
> +static struct irq_chip nspire_irq_chip = {
> +	.name		= "nspire_irq",
> +	.irq_ack	= nspire_irq_ack,
> +	.irq_mask	= nspire_irq_mask,
> +	.irq_unmask	= nspire_irq_unmask,
> +};

Should be using irq_generic_chip here. There is no need to reimplement
the above ack, mask and unmask functions. You should find the
irq_alloc_domain_generic_chips() patch in the tip tree irq/for-arm
branch. That branch is staged for merging in v3.11

Otherwise the patch looks good.

g.

WARNING: multiple messages have this Message-ID (diff)
From: Grant Likely <grant.likely@secretlab.ca>
To: Daniel Tang <dt.tangr@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	"linux@arm.linux.org.uk ARM Linux" <linux@arm.linux.org.uk>
Cc: Daniel Tang <dt.tangr@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"fabian@ritter-vogt.de Vogt" <fabian@ritter-vogt.de>,
	Lionel Debroux <lionel_debroux@yahoo.fr>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC PATCHv4 6/6] irqchip: TI-Nspire irqchip support
Date: Thu, 30 May 2013 22:29:45 +0100	[thread overview]
Message-ID: <20130530212945.C026C3E0A90@localhost> (raw)
In-Reply-To: <1369480087-24786-7-git-send-email-dt.tangr@gmail.com>

On Sat, 25 May 2013 21:08:07 +1000, Daniel Tang <dt.tangr@gmail.com> wrote:
> Add support for the interrupt controller on TI-Nspires.
> 
> Signed-off-by: Daniel Tang <dt.tangr@gmail.com>
[...]
> +static void nspire_irq_ack(struct irq_data *irqd)
> +{
> +	void __iomem *base = irq_io_base;
> +
> +	if (irqd->hwirq < FIQ_START)
> +		base += IO_IRQ_BASE;
> +	else
> +		base += IO_FIQ_BASE;
> +
> +	readl(base + IO_RESET);
> +}
> +
> +static void nspire_irq_unmask(struct irq_data *irqd)
> +{
> +	void __iomem *base = irq_io_base;
> +	int irqnr = irqd->hwirq;
> +
> +	if (irqnr < FIQ_START) {
> +		base += IO_IRQ_BASE;
> +	} else {
> +		irqnr -= MAX_INTRS;
> +		base += IO_FIQ_BASE;
> +	}
> +
> +	writel((1<<irqnr), base + IO_ENABLE);
> +}
> +
> +static void nspire_irq_mask(struct irq_data *irqd)
> +{
> +	void __iomem *base = irq_io_base;
> +	int irqnr = irqd->hwirq;
> +
> +	if (irqnr < FIQ_START) {
> +		base += IO_IRQ_BASE;
> +	} else {
> +		irqnr -= FIQ_START;
> +		base += IO_FIQ_BASE;
> +	}
> +
> +	writel((1<<irqnr), base + IO_DISABLE);
> +}
> +
> +static struct irq_chip nspire_irq_chip = {
> +	.name		= "nspire_irq",
> +	.irq_ack	= nspire_irq_ack,
> +	.irq_mask	= nspire_irq_mask,
> +	.irq_unmask	= nspire_irq_unmask,
> +};

Should be using irq_generic_chip here. There is no need to reimplement
the above ack, mask and unmask functions. You should find the
irq_alloc_domain_generic_chips() patch in the tip tree irq/for-arm
branch. That branch is staged for merging in v3.11

Otherwise the patch looks good.

g.


  reply	other threads:[~2013-05-30 21:29 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 11:08 [RFC PATCHv4 0/6] arm: Initial TI-Nspire support Daniel Tang
2013-05-25 11:08 ` Daniel Tang
2013-05-25 11:08 ` [RFC PATCHv4 1/6] arm: TI-Nspire platform code Daniel Tang
2013-05-25 11:08   ` Daniel Tang
2013-05-26 20:46   ` Arnd Bergmann
2013-05-26 20:46     ` Arnd Bergmann
2013-05-27  4:07     ` Daniel Tang
2013-05-27  4:07       ` Daniel Tang
2013-05-27  6:56       ` Arnd Bergmann
2013-05-27  6:56         ` Arnd Bergmann
     [not found]         ` <CAPnH9dnA22C3ZS9jgJNytnmKM_8Vfk7OxNRB1Mg03=q7KhHZBA@mail.gmail.com>
     [not found]           ` <201305271715.02385.arnd@arndb.de>
2013-05-29  5:14             ` Daniel Tang
2013-05-29  5:14               ` Daniel Tang
2013-05-29  7:58               ` Arnd Bergmann
2013-05-29  7:58                 ` Arnd Bergmann
2013-05-25 11:08 ` [RFC PATCHv4 2/6] arm: TI-Nspire device trees Daniel Tang
2013-05-25 11:08   ` Daniel Tang
2013-05-25 11:08 ` [RFC PATCHv4 3/6] clk: TI-Nspire clock drivers Daniel Tang
2013-05-25 11:08   ` Daniel Tang
2013-05-31  1:16   ` Mike Turquette
2013-05-31  1:16     ` Mike Turquette
2013-05-25 11:08 ` [RFC PATCHv4 4/6] clocksource: TI-Nspire timer support Daniel Tang
2013-05-25 11:08   ` Daniel Tang
2013-05-27 10:53   ` Linus Walleij
2013-05-27 10:53     ` Linus Walleij
2013-05-27 10:56     ` Daniel Tang
2013-05-27 10:56       ` Daniel Tang
2013-05-27 12:28     ` Thomas Gleixner
2013-05-27 12:28       ` Thomas Gleixner
2013-05-25 11:08 ` [RFC PATCHv4 5/6] input: TI-Nspire keypad support Daniel Tang
2013-05-25 11:08   ` Daniel Tang
2013-05-25 11:08 ` [RFC PATCHv4 6/6] irqchip: TI-Nspire irqchip support Daniel Tang
2013-05-25 11:08   ` Daniel Tang
2013-05-30 21:29   ` Grant Likely [this message]
2013-05-30 21:29     ` Grant Likely
2013-05-26 21:23 ` [RFC PATCHv4 0/6] arm: Initial TI-Nspire support Arnd Bergmann
2013-05-26 21:23   ` Arnd Bergmann
2013-05-27  2:23   ` Daniel Tang
2013-05-27  2:23     ` Daniel Tang
2013-05-27 10:31     ` Arnd Bergmann
2013-05-27 10:31       ` Arnd Bergmann
2013-05-28 10:52       ` Pawel Moll
2013-05-28 10:52         ` Pawel Moll
2013-05-31  7:43         ` Laurent Pinchart
2013-05-31  7:43           ` Laurent Pinchart
2013-05-29  5:18       ` Daniel Tang
2013-05-29  5:18         ` Daniel Tang
2013-05-29 12:46         ` Arnd Bergmann
2013-05-29 12:46           ` Arnd Bergmann
2013-05-27 10:32     ` Arnd Bergmann
2013-05-27 10:32       ` Arnd Bergmann
2013-05-28 10:54       ` Pawel Moll
2013-05-28 10:54         ` Pawel Moll
2013-05-28 14:16         ` Linus Walleij
2013-05-28 14:16           ` Linus Walleij
2013-05-28 14:21           ` Pawel Moll
2013-05-28 14:21             ` Pawel Moll
2013-05-28 14:52             ` Arnd Bergmann
2013-05-28 14:52               ` Arnd Bergmann
2013-05-28 15:10               ` Andy Shevchenko
2013-05-28 15:10                 ` Andy Shevchenko

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=20130530212945.C026C3E0A90@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.