All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: clps711x: Add CLPS711X irqchip driver
Date: Sat, 7 Dec 2013 15:30:07 +0100	[thread overview]
Message-ID: <201312071530.07901.arnd@arndb.de> (raw)
In-Reply-To: <1386008042-6826-1-git-send-email-shc_work@mail.ru>

On Monday 02 December 2013, Alexander Shiyan wrote:
> This adds the irqchip driver for Cirrus Logic CLPS711X series SoCs.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/Kconfig                |   2 -
>  arch/arm/mach-clps711x/common.h |   3 +
>  drivers/irqchip/Kconfig         |   8 ++
>  drivers/irqchip/Makefile        |   1 +
>  drivers/irqchip/irq-clps711x.c  | 246 ++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 258 insertions(+), 2 deletions(-)
> create mode 100644 drivers/irqchip/irq-clps711x.c

It seems you forgot to add the irqchip maintainer to Cc, I've added him in this
reply.

> +static void clps711x_intc_eoi(struct irq_data *d)
> +{
> +	irq_hw_number_t hwirq = irqd_to_hwirq(d);
> +
> +	writel_relaxed(0, clps711x_intc->base + clps711x_irqs[hwirq].eoi);
> +}
> +
> +static void clps711x_intc_mask(struct irq_data *d)
> +{
> +	irq_hw_number_t hwirq = irqd_to_hwirq(d);
> +	void __iomem *intmr = clps711x_intc->intmr[hwirq / 16];
> +	u32 tmp;
> +
> +	tmp = readl_relaxed(intmr);
> +	tmp &= ~(1 << (hwirq % 16));
> +	writel_relaxed(tmp, intmr);
> +}
> +
> +static void clps711x_intc_unmask(struct irq_data *d)
> +{
> +	irq_hw_number_t hwirq = irqd_to_hwirq(d);
> +	void __iomem *intmr = clps711x_intc->intmr[hwirq / 16];
> +	u32 tmp;
> +
> +	tmp = readl_relaxed(intmr);
> +	tmp |= 1 << (hwirq % 16);
> +	writel_relaxed(tmp, intmr);
> +}

These look rather simple, have you checked if you can reuse the generic
irqchip code?

> +	clps711x_intc->domain =
> +		irq_domain_add_legacy(np, ARRAY_SIZE(clps711x_irqs),
> +				      0, 0, &clps711x_intc_ops, NULL);

You should probably use irq_domain_add_simple() here, and pass first_irq = -1
for the DT case, unless you still need a mix of DT with platform devices
that have hardwired IRQ resources.

> +void __init clps711x_intc_init(phys_addr_t base, resource_size_t size)
> +{
> +	BUG_ON(_clps711x_intc_init(NULL, base, size));
> +}
> +EXPORT_SYMBOL(clps711x_intc_init);

No need to export this symbol, because you don't call the function from
loadable modules.

	Arnd

  parent reply	other threads:[~2013-12-07 14:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 18:14 [PATCH 1/3] ARM: clps711x: Add CLPS711X irqchip driver Alexander Shiyan
2013-12-02 18:14 ` [PATCH 3/3] ARM: clps711x: Migrate CLPS711X subarch to the new " Alexander Shiyan
2013-12-07 14:30   ` Arnd Bergmann
2013-12-07 14:30 ` Arnd Bergmann [this message]
2013-12-07 14:40   ` [PATCH 1/3] ARM: clps711x: Add CLPS711X " Alexander Shiyan
2013-12-07 16:14     ` Arnd Bergmann
2013-12-07 16:27       ` Alexander Shiyan
2013-12-14  5:27       ` Alexander Shiyan
2013-12-14 12:31         ` Arnd Bergmann
2013-12-18 16:35           ` Alexander Shiyan

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=201312071530.07901.arnd@arndb.de \
    --to=arnd@arndb.de \
    --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.