All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Holger Dengler <dengler@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Peter Mahler <mahler@xkrug.com>,
	Juergen Bubeck <bubeck@xkrug.com>,
	Benedikt Spranger <b.spranger@linutronix.de>,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH 05/11] mfd: flexcard: add interrupt support
Date: Mon, 30 Mar 2015 09:46:57 +0100	[thread overview]
Message-ID: <20150330084657.GP457@x1> (raw)
In-Reply-To: <1427277120-16924-6-git-send-email-dengler@linutronix.de>

On Wed, 25 Mar 2015, Holger Dengler wrote:

> From: Benedikt Spranger <b.spranger@linutronix.de>
> 
> The Flexcard comprise an interrupt controller for the attached
> tinys, timer, a Flexray related trigger and a second one for DMA.
> Both controllers share a single IRQ line.
> 
> Add an interrupt domain for the non-DMA interrupts.
> 
> Signed-off-by: Holger Dengler <dengler@linutronix.de>
> Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
> cc: Samuel Ortiz <sameo@linux.intel.com>
> cc: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/Kconfig             |   1 +
>  drivers/mfd/flexcard/Makefile   |   2 +-
>  drivers/mfd/flexcard/core.c     |  14 +++-
>  drivers/mfd/flexcard/flexcard.h |   2 +
>  drivers/mfd/flexcard/irq.c      | 167 ++++++++++++++++++++++++++++++++++++++++
>  drivers/mfd/flexcard/irq.h      |  50 ++++++++++++
>  include/linux/mfd/flexcard.h    |   2 +
>  7 files changed, 235 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/mfd/flexcard/irq.c
>  create mode 100644 drivers/mfd/flexcard/irq.h

[...]

> diff --git a/drivers/mfd/flexcard/irq.h b/drivers/mfd/flexcard/irq.h
> new file mode 100644
> index 0000000..b18fb5b
> --- /dev/null
> +++ b/drivers/mfd/flexcard/irq.h
> @@ -0,0 +1,50 @@
> +#ifndef FLEXCARD_IRQ_H
> +#define FLEXCARD_IRQ_H
> +
> +struct flexcard_irq_tab {
> +	u32 enable;
> +	u32 reset;
> +	u32 status;
> +};
> +
> +#define to_irq_tab(e, s) {			\
> +	.enable = (1 << e),			\
> +	.status = (1 << s),			\
> +}
> +
> +#define to_irq_tab_ack(e, r, s) {		\
> +	.enable = (1 << e),			\
> +	.reset  = (1 << r),			\
> +	.status = (1 << s),			\
> +}
> +
> +/*
> + * Interrupt Controller Register S-Box
> + * unlike other irq controllers the FlexCard bits for enable, reset and status
> + * looks more like a cryptographic S-box. Make a const table to have a more
> + * easier access to this bits in the irqchip callback functions.
> + * The table contains the registers for PMC2-cards.
> + */
> +static const struct flexcard_irq_tab flexcard_irq_tab[] = {
> +	to_irq_tab_ack(28, 0, 28),	/* TIMER  */
> +	to_irq_tab_ack(29, 1, 29),	/* CC1CYS */
> +	to_irq_tab_ack(30, 10, 21),	/* CC2CYS */
> +	to_irq_tab_ack(18, 2, 30),	/* CC3CYS */
> +	to_irq_tab_ack(19, 6, 25),	/* CC4CYS */
> +	to_irq_tab_ack(26, 4, 26),	/* WAKE1A */
> +	to_irq_tab_ack(27, 5, 27),	/* WAKE1B */
> +	to_irq_tab_ack(24, 8, 23),	/* WAKE2A */
> +	to_irq_tab_ack(25, 9, 22),	/* WAKE2B */
> +	to_irq_tab_ack(22, 12, 19),	/* WAKE3A */
> +	to_irq_tab_ack(23, 13, 18),	/* WAKE3B */
> +	to_irq_tab_ack(20, 14, 17),	/* WAKE4A */
> +	to_irq_tab_ack(21, 15, 16),	/* WAKE4B */
> +	to_irq_tab(15, 31),		/* CC1T0  */
> +	to_irq_tab(14, 3),		/* CC2T0  */
> +	to_irq_tab(16, 24),		/* CC3T0  */
> +	to_irq_tab(17, 20),		/* CC4T0  */
> +};
> +
> +#define NR_FLEXCARD_IRQ		ARRAY_SIZE(flexcard_irq_tab)

Is everything in this header used over multiple source files, or only
irq.c?  If the latter, then please move them into irq.c.

> +#endif /* FLEXCARD_IRQ_H */
> diff --git a/include/linux/mfd/flexcard.h b/include/linux/mfd/flexcard.h
> index 84e155c..f5b789f 100644
> --- a/include/linux/mfd/flexcard.h
> +++ b/include/linux/mfd/flexcard.h
> @@ -22,12 +22,14 @@
>  #define FLEXCARD_MAX_NAME	16
>  
>  struct flexcard_device {
> +	raw_spinlock_t irq_lock;
>  	struct pci_dev *pdev;
>  	struct fc_conf_bar __iomem *conf;
>  	struct mfd_cell *cells;
>  	struct resource *res;
>  	struct miscdevice dev;
>  	struct kref ref;
> +	struct irq_domain *irq_domain;
>  	int cardnr;
>  	char name[FLEXCARD_MAX_NAME];
>  };

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2015-03-30  8:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25  9:51 [PATCH 00/11] Eberspaecher Flexcard PMC II base support Holger Dengler
2015-03-25  9:51 ` [PATCH 01/11] mfd: Eberspaecher Flexcard PMC II Carrier Board support Holger Dengler
2015-03-30  7:57   ` Lee Jones
2015-03-25  9:51 ` [PATCH 02/11] mfd: flexcard: add flexcard core device Holger Dengler
2015-03-30  8:06   ` Lee Jones
2015-03-25  9:51 ` [PATCH 03/11] mfd: flexcard: add device attributes Holger Dengler
2015-03-30  8:15   ` Lee Jones
2015-03-25  9:51 ` [PATCH 04/11] mfd: flexcard: add clocksrc device Holger Dengler
2015-03-30  8:30   ` Lee Jones
2015-03-25  9:51 ` [PATCH 05/11] mfd: flexcard: add interrupt support Holger Dengler
2015-03-30  8:46   ` Lee Jones [this message]
2015-03-25  9:51 ` [PATCH 06/11] mfd: flexcard: add DMA interrupt domain Holger Dengler
2015-03-30  8:50   ` Lee Jones
2015-03-25  9:51 ` [PATCH 07/11] mfd: flexcard: add UIO IRQ devices Holger Dengler
2015-03-30  8:57   ` Lee Jones
2015-03-25  9:51 ` [PATCH 08/11] mfd: flexcard: add DMA device Holger Dengler
2015-03-30  8:59   ` Lee Jones
2015-03-25  9:51 ` [PATCH 09/11] mfd: flexcard: add DMA ringbuffer demux driver Holger Dengler
2015-03-30  9:02   ` Lee Jones
2015-03-25  9:51 ` [PATCH 10/11] clocksource: flexcard: Add basic timestamp counter support Holger Dengler
2015-03-26  9:41   ` Daniel Lezcano
2015-03-26 11:01     ` Holger Dengler
2015-03-26 16:34       ` John Stultz
2015-03-27 12:27         ` Holger Dengler
2015-03-25  9:52 ` [PATCH 11/11] clocksource: flexcard: Support timestamp trigger selection Holger Dengler

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=20150330084657.GP457@x1 \
    --to=lee.jones@linaro.org \
    --cc=b.spranger@linutronix.de \
    --cc=bubeck@xkrug.com \
    --cc=dengler@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahler@xkrug.com \
    --cc=sameo@linux.intel.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 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.