All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: 'Ben Dooks' <ben-linux@fluff.org>
Cc: linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kyungmin.park@samsung.com,
	kgene.kim@samsung.com
Subject: RE: [PATCH 10/11] ARM: S5PC100: use common plat-s5p external interrupt code
Date: Wed, 19 May 2010 07:29:24 +0200	[thread overview]
Message-ID: <011d01caf714$40ceed30$c26cc790$%szyprowski@samsung.com> (raw)
In-Reply-To: <20100519040212.GP26401@trinity.fluff.org>

Hello,

On Wednesday, May 19, 2010 6:02 AM Ben Dooks wrote:

> On Tue, May 18, 2010 at 12:38:48PM +0200, Marek Szyprowski wrote:
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > ---
> >  arch/arm/mach-s5pc100/Kconfig                  |    1 +
> >  arch/arm/mach-s5pc100/gpiolib.c                |    3 +-
> >  arch/arm/mach-s5pc100/include/mach/irqs.h      |   15 ++++++++--
> >  arch/arm/mach-s5pc100/include/mach/regs-gpio.h |   36 ++++++++++++++----
> -----
> >  4 files changed, 36 insertions(+), 19 deletions(-)
> >
> > diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-
> s5pc100/Kconfig
> > index fe1216b..2eb9497 100644
> > --- a/arch/arm/mach-s5pc100/Kconfig
> > +++ b/arch/arm/mach-s5pc100/Kconfig
> > @@ -10,6 +10,7 @@ if ARCH_S5PC100
> >  config CPU_S5PC100
> >  	bool
> >  	select PLAT_S5P
> > +	select S5P_EXT_INT
> >  	help
> >  	  Enable S5PC100 CPU support
> >
> > diff --git a/arch/arm/mach-s5pc100/gpiolib.c b/arch/arm/mach-
> s5pc100/gpiolib.c
> > index 88dd913..0fab7f2 100644
> > --- a/arch/arm/mach-s5pc100/gpiolib.c
> > +++ b/arch/arm/mach-s5pc100/gpiolib.c
> > @@ -61,7 +61,6 @@
> >   * L3	8	4Bit	None
> >   */
> >
> > -#if 0
> >  static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int
> offset)
> >  {
> >  	return S3C_IRQ_GPIO(chip->base + offset);
> > @@ -85,7 +84,7 @@ static int s5pc100_gpiolib_to_eint(struct gpio_chip
> *chip, unsigned int offset)
> >  		return IRQ_EINT(24 + offset);
> >  	return -EINVAL;
> >  }
> > -#endif
> > +
> >  static struct s3c_gpio_cfg gpio_cfg = {
> >  	.set_config	= s3c_gpio_setcfg_s3c64xx_4bit,
> >  	.set_pull	= s3c_gpio_setpull_updown,
> > diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-
> s5pc100/include/mach/irqs.h
> > index 84c74ac..f26c4d9 100644
> > --- a/arch/arm/mach-s5pc100/include/mach/irqs.h
> > +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
> > @@ -97,10 +97,19 @@
> >  #define IRQ_SDMFIQ		S5P_IRQ_VIC2(31)
> >  #define IRQ_VIC_END		S5P_IRQ_VIC2(31)
> >
> > -#define S5P_IRQ_EINT_BASE	(IRQ_VIC_END + 1)
> > +#define S5P_EINT_16_31_BASE	(IRQ_VIC_END + 1)
> >
> > -#define IRQ_EINT(x)             ((x) < 16 ? S5P_IRQ_VIC0(x) : \
> > -					(S5P_IRQ_EINT_BASE + (x)-16))
> > +#define S3C_IRQ_EINT_BASE	(IRQ_VIC_END + 1)
> 
> we seem to have this and S5P_EINT_16_31_BASE? Let's use just the one.
> 
> > +#define EINT_MODE		S3C_GPIO_SFN(0x2)
> > +
> > +#define IRQ_EINT(x)		((x) < 16 ? ((x) + S5P_IRQ_VIC0(0)) \
> > +					: ((x) + S5P_EINT_16_31_BASE))
> 
> ok, could we put this in arch/arm/plat-s5p/include/plat/irqs.h and
> just have the per-platform files defining the base?

I'm not sure if this is a good idea. Although this code works for s5pc100
and s5pv210, there might be problems with s5p6440, which has external
interrupts designed like s3c6410. But I'm not sure if this would cause
the problems. If so then we can always just move it from plat/irqs.h to
mach/irqs.h again.

> 
> > +#define EINT_GPIO_0(x)		S5PC100_GPH0(x)
> > +#define EINT_GPIO_1(x)		S5PC100_GPH1(x)
> > +#define EINT_GPIO_2(x)		S5PC100_GPH2(x)
> > +#define EINT_GPIO_3(x)		S5PC100_GPH3(x)
> >
> >  #define S3C_IRQ_GPIO_BASE	(IRQ_EINT(31) + 1)
> >  #define S3C_IRQ_GPIO(x)		(S3C_IRQ_GPIO_BASE + (x))

What about moving these to mach/gpio.h? IMHO mach/irqs.h is not the
best place for them.

> ...

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

WARNING: multiple messages have this Message-ID (diff)
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/11] ARM: S5PC100: use common plat-s5p external interrupt code
Date: Wed, 19 May 2010 07:29:24 +0200	[thread overview]
Message-ID: <011d01caf714$40ceed30$c26cc790$%szyprowski@samsung.com> (raw)
In-Reply-To: <20100519040212.GP26401@trinity.fluff.org>

Hello,

On Wednesday, May 19, 2010 6:02 AM Ben Dooks wrote:

> On Tue, May 18, 2010 at 12:38:48PM +0200, Marek Szyprowski wrote:
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > ---
> >  arch/arm/mach-s5pc100/Kconfig                  |    1 +
> >  arch/arm/mach-s5pc100/gpiolib.c                |    3 +-
> >  arch/arm/mach-s5pc100/include/mach/irqs.h      |   15 ++++++++--
> >  arch/arm/mach-s5pc100/include/mach/regs-gpio.h |   36 ++++++++++++++----
> -----
> >  4 files changed, 36 insertions(+), 19 deletions(-)
> >
> > diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-
> s5pc100/Kconfig
> > index fe1216b..2eb9497 100644
> > --- a/arch/arm/mach-s5pc100/Kconfig
> > +++ b/arch/arm/mach-s5pc100/Kconfig
> > @@ -10,6 +10,7 @@ if ARCH_S5PC100
> >  config CPU_S5PC100
> >  	bool
> >  	select PLAT_S5P
> > +	select S5P_EXT_INT
> >  	help
> >  	  Enable S5PC100 CPU support
> >
> > diff --git a/arch/arm/mach-s5pc100/gpiolib.c b/arch/arm/mach-
> s5pc100/gpiolib.c
> > index 88dd913..0fab7f2 100644
> > --- a/arch/arm/mach-s5pc100/gpiolib.c
> > +++ b/arch/arm/mach-s5pc100/gpiolib.c
> > @@ -61,7 +61,6 @@
> >   * L3	8	4Bit	None
> >   */
> >
> > -#if 0
> >  static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int
> offset)
> >  {
> >  	return S3C_IRQ_GPIO(chip->base + offset);
> > @@ -85,7 +84,7 @@ static int s5pc100_gpiolib_to_eint(struct gpio_chip
> *chip, unsigned int offset)
> >  		return IRQ_EINT(24 + offset);
> >  	return -EINVAL;
> >  }
> > -#endif
> > +
> >  static struct s3c_gpio_cfg gpio_cfg = {
> >  	.set_config	= s3c_gpio_setcfg_s3c64xx_4bit,
> >  	.set_pull	= s3c_gpio_setpull_updown,
> > diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-
> s5pc100/include/mach/irqs.h
> > index 84c74ac..f26c4d9 100644
> > --- a/arch/arm/mach-s5pc100/include/mach/irqs.h
> > +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
> > @@ -97,10 +97,19 @@
> >  #define IRQ_SDMFIQ		S5P_IRQ_VIC2(31)
> >  #define IRQ_VIC_END		S5P_IRQ_VIC2(31)
> >
> > -#define S5P_IRQ_EINT_BASE	(IRQ_VIC_END + 1)
> > +#define S5P_EINT_16_31_BASE	(IRQ_VIC_END + 1)
> >
> > -#define IRQ_EINT(x)             ((x) < 16 ? S5P_IRQ_VIC0(x) : \
> > -					(S5P_IRQ_EINT_BASE + (x)-16))
> > +#define S3C_IRQ_EINT_BASE	(IRQ_VIC_END + 1)
> 
> we seem to have this and S5P_EINT_16_31_BASE? Let's use just the one.
> 
> > +#define EINT_MODE		S3C_GPIO_SFN(0x2)
> > +
> > +#define IRQ_EINT(x)		((x) < 16 ? ((x) + S5P_IRQ_VIC0(0)) \
> > +					: ((x) + S5P_EINT_16_31_BASE))
> 
> ok, could we put this in arch/arm/plat-s5p/include/plat/irqs.h and
> just have the per-platform files defining the base?

I'm not sure if this is a good idea. Although this code works for s5pc100
and s5pv210, there might be problems with s5p6440, which has external
interrupts designed like s3c6410. But I'm not sure if this would cause
the problems. If so then we can always just move it from plat/irqs.h to
mach/irqs.h again.

> 
> > +#define EINT_GPIO_0(x)		S5PC100_GPH0(x)
> > +#define EINT_GPIO_1(x)		S5PC100_GPH1(x)
> > +#define EINT_GPIO_2(x)		S5PC100_GPH2(x)
> > +#define EINT_GPIO_3(x)		S5PC100_GPH3(x)
> >
> >  #define S3C_IRQ_GPIO_BASE	(IRQ_EINT(31) + 1)
> >  #define S3C_IRQ_GPIO(x)		(S3C_IRQ_GPIO_BASE + (x))

What about moving these to mach/gpio.h? IMHO mach/irqs.h is not the
best place for them.

> ...

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

  reply	other threads:[~2010-05-19  5:30 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 10:38 (unknown), Marek Szyprowski
2010-05-18 10:38 ` No subject Marek Szyprowski
2010-05-18 10:38 ` [PATCH 01/11] drivers: serial: S5PC100 serial driver cleanup Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 02/11] ARM: S5PC100: Use common functions for gpiolib implementation Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 03/11] ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100 Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 04/11] ARM: S5PC100: gpio.h cleanup Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 05/11] ARM: S5PC100: Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100 Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 06/11] ARM: S5PC100: Move i2c " Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 07/11] ARM: S5PC100: Move sdhci " Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 08/11] ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 09/11] ARM: S5PC100: Add support for gpio interrupt Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-18 10:38 ` [PATCH 10/11] ARM: S5PC100: use common plat-s5p external interrupt code Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-19  4:02   ` Ben Dooks
2010-05-19  4:02     ` Ben Dooks
2010-05-19  5:29     ` Marek Szyprowski [this message]
2010-05-19  5:29       ` Marek Szyprowski
2010-05-19  5:58       ` Ben Dooks
2010-05-19  5:58         ` Ben Dooks
2010-05-19  6:46       ` Ben Dooks
2010-05-19  6:46         ` Ben Dooks
2010-05-18 10:38 ` [PATCH 11/11] ARM: remove obsolete plat-s5pc1xx directory Marek Szyprowski
2010-05-18 10:38   ` Marek Szyprowski
2010-05-19  1:02 ` Kukjin Kim
2010-05-19  1:02   ` Kukjin Kim
2010-05-19  2:24 ` your mail Ben Dooks
2010-05-19  2:24   ` Ben Dooks

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='011d01caf714$40ceed30$c26cc790$%szyprowski@samsung.com' \
    --to=m.szyprowski@samsung.com \
    --cc=ben-linux@fluff.org \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@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 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.