* RE: [PATCH 13/13] ARM: gpio: make trivial GPIOLIB implementation the
From: Kukjin Kim @ 2011-08-11 12:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhMg-0003an-GW@rmk-PC.arm.linux.org.uk>
Russell King - ARM Linux wrote:
>
> Rather than marking the mach/gpio.h header files which want to use the
> trivial GPIOLIB implementation, mark those which do not want to use it
> instead. This means that by default, you get the trivial implementation
> and only have to do something extra if you need to. This should
> encourage the use of the trivial default implementation.
>
> As an additional bonus, several gpio.h header files become empty.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Looks good to me :)
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
on following Samsung stuff...
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
> ---
> arch/arm/include/asm/gpio.h | 2 +-
> arch/arm/mach-exynos4/include/mach/gpio.h | 2 --
> arch/arm/mach-s3c2410/include/mach/gpio.h | 2 --
> arch/arm/mach-s3c64xx/include/mach/gpio.h | 2 --
> arch/arm/mach-s5p64x0/include/mach/gpio.h | 2 --
> arch/arm/mach-s5pc100/include/mach/gpio.h | 2 --
> arch/arm/mach-s5pv210/include/mach/gpio.h | 2 --
>
> diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
> index 5032224..11ad0bf 100644
> --- a/arch/arm/include/asm/gpio.h
> +++ b/arch/arm/include/asm/gpio.h
> @@ -4,7 +4,7 @@
> /* not all ARM platforms necessarily support this API ... */
> #include <mach/gpio.h>
>
> -#ifdef __ARM_GPIOLIB_TRIVIAL
> +#ifndef __ARM_GPIOLIB_COMPLEX
> /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h
*/
> #include <asm-generic/gpio.h>
>
> diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-
> exynos4/include/mach/gpio.h
> index b91e8b2..80523ca 100644
> --- a/arch/arm/mach-exynos4/include/mach/gpio.h
> +++ b/arch/arm/mach-exynos4/include/mach/gpio.h
> @@ -146,6 +146,4 @@ enum s5p_gpio_number {
> #define ARCH_NR_GPIOS
> (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \
> CONFIG_SAMSUNG_GPIO_EXTRA + 1)
>
> -#define __ARM_GPIOLIB_TRIVIAL
> -
> #endif /* __ASM_ARCH_GPIO_H */
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-
> s3c2410/include/mach/gpio.h
> index d502d17..6fac70f 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
> @@ -11,8 +11,6 @@
> * published by the Free Software Foundation.
> */
>
> -#define __ARM_GPIOLIB_TRIVIAL
> -
> /* some boards require extra gpio capacity to support external
> * devices that need GPIO.
> */
> diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-
> s3c64xx/include/mach/gpio.h
> index 3a8857c..6e34c2f 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
> @@ -12,8 +12,6 @@
> * published by the Free Software Foundation.
> */
>
> -#define __ARM_GPIOLIB_TRIVIAL
> -
> /* GPIO bank sizes */
> #define S3C64XX_GPIO_A_NR (8)
> #define S3C64XX_GPIO_B_NR (7)
> diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-
> s5p64x0/include/mach/gpio.h
> index c3a6aa0..06cd3c9 100644
> --- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
> +++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
> @@ -13,8 +13,6 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define __ARM_GPIOLIB_TRIVIAL
> -
> /* GPIO bank sizes */
>
> #define S5P6440_GPIO_A_NR (6)
> diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-
> s5pc100/include/mach/gpio.h
> index 0e75641..5e1a924 100644
> --- a/arch/arm/mach-s5pc100/include/mach/gpio.h
> +++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
> @@ -15,8 +15,6 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define __ARM_GPIOLIB_TRIVIAL
> -
> /* GPIO bank sizes */
> #define S5PC100_GPIO_A0_NR (8)
> #define S5PC100_GPIO_A1_NR (5)
> diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-
> s5pv210/include/mach/gpio.h
> index d348ee2..6c8b903 100644
> --- a/arch/arm/mach-s5pv210/include/mach/gpio.h
> +++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
> @@ -13,8 +13,6 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define __ARM_GPIOLIB_TRIVIAL
> -
> /* Practically, GPIO banks up to MP03 are the configurable gpio banks */
>
> /* GPIO bank sizes */
^ permalink raw reply
* RE: [PATCH 12/13] ARM: gpio: consolidate gpio_to_irq
From: Kukjin Kim @ 2011-08-11 11:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhMM-0003aj-C7@rmk-PC.arm.linux.org.uk>
Russell King - ARM Linux wrote:
>
> Many of the gpio_to_irq implementations use the gpiolib version of this
> function. Provide the standard gpiolib gpio_to_irq() for everyone, but
> allow platforms to override it if they wish. Add the neccessary
> overrides for those platforms which do not use the standard definition.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
on following Samsung stuff :)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
> ---
> arch/arm/include/asm/gpio.h | 9 +++++++++
> arch/arm/mach-exynos4/include/mach/gpio.h | 2 --
> arch/arm/mach-s3c2410/include/mach/gpio.h | 1 -
> arch/arm/mach-s3c64xx/include/mach/gpio.h | 1 -
> arch/arm/mach-s5p64x0/include/mach/gpio.h | 1 -
> arch/arm/mach-s5pc100/include/mach/gpio.h | 1 -
> arch/arm/mach-s5pv210/include/mach/gpio.h | 1 -
>
> diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
> index 15e8970..5032224 100644
> --- a/arch/arm/include/asm/gpio.h
> +++ b/arch/arm/include/asm/gpio.h
> @@ -14,4 +14,13 @@
> #define gpio_cansleep __gpio_cansleep
> #endif
>
> +/*
> + * Provide a default gpio_to_irq() which should satisfy every case.
> + * However, some platforms want to do this differently, so allow them
> + * to override it.
> + */
> +#ifndef gpio_to_irq
> +#define gpio_to_irq __gpio_to_irq
> +#endif
> +
> #endif /* _ARCH_ARM_GPIO_H */
> diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-
> exynos4/include/mach/gpio.h
> index b2e3595..b91e8b2 100644
> --- a/arch/arm/mach-exynos4/include/mach/gpio.h
> +++ b/arch/arm/mach-exynos4/include/mach/gpio.h
> @@ -13,8 +13,6 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define gpio_to_irq __gpio_to_irq
> -
> /* Practically, GPIO banks up to GPZ are the configurable gpio banks */
>
> /* GPIO bank sizes */
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-
> s3c2410/include/mach/gpio.h
> index 998ef4c..d502d17 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
> @@ -12,7 +12,6 @@
> */
>
> #define __ARM_GPIOLIB_TRIVIAL
> -#define gpio_to_irq __gpio_to_irq
>
> /* some boards require extra gpio capacity to support external
> * devices that need GPIO.
> diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-
> s3c64xx/include/mach/gpio.h
> index 6958b3f..3a8857c 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
> @@ -13,7 +13,6 @@
> */
>
> #define __ARM_GPIOLIB_TRIVIAL
> -#define gpio_to_irq __gpio_to_irq
>
> /* GPIO bank sizes */
> #define S3C64XX_GPIO_A_NR (8)
> diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-
> s5p64x0/include/mach/gpio.h
> index a25160b..c3a6aa0 100644
> --- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
> +++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
> @@ -14,7 +14,6 @@
> #define __ASM_ARCH_GPIO_H __FILE__
>
> #define __ARM_GPIOLIB_TRIVIAL
> -#define gpio_to_irq __gpio_to_irq
>
> /* GPIO bank sizes */
>
> diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-
> s5pc100/include/mach/gpio.h
> index f515bfb..0e75641 100644
> --- a/arch/arm/mach-s5pc100/include/mach/gpio.h
> +++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
> @@ -16,7 +16,6 @@
> #define __ASM_ARCH_GPIO_H __FILE__
>
> #define __ARM_GPIOLIB_TRIVIAL
> -#define gpio_to_irq __gpio_to_irq
>
> /* GPIO bank sizes */
> #define S5PC100_GPIO_A0_NR (8)
> diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-
> s5pv210/include/mach/gpio.h
> index 27f2139..d348ee2 100644
> --- a/arch/arm/mach-s5pv210/include/mach/gpio.h
> +++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
> @@ -14,7 +14,6 @@
> #define __ASM_ARCH_GPIO_H __FILE__
>
> #define __ARM_GPIOLIB_TRIVIAL
> -#define gpio_to_irq __gpio_to_irq
>
> /* Practically, GPIO banks up to MP03 are the configurable gpio banks */
>
^ permalink raw reply
* RE: [PATCH 11/13] ARM: gpio: consolidate trivial gpiolib
From: Kukjin Kim @ 2011-08-11 11:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhM1-0003af-U5@rmk-PC.arm.linux.org.uk>
Russell King - ARM Linux wrote:
>
> Consolidate 24 trivial gpiolib implementions out of mach/gpio.h
> into asm/gpio.h. This is basically the include of asm-generic/gpio.h
> and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep
> as described in Documentation/gpio.txt
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
on following Samsung stuff...
As a note, there were duplicated e-mail address Grant and Nicolas in Cc ;)
I just pushed 'reply all' :)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
> ---
> arch/arm/include/asm/gpio.h | 10 ++++++++++
...
> arch/arm/mach-exynos4/include/mach/gpio.h | 5 +----
...
> arch/arm/mach-s3c2410/include/mach/gpio.h | 5 +----
> arch/arm/mach-s3c64xx/include/mach/gpio.h | 6 +-----
> arch/arm/mach-s5p64x0/include/mach/gpio.h | 6 +-----
> arch/arm/mach-s5pc100/include/mach/gpio.h | 6 +-----
> arch/arm/mach-s5pv210/include/mach/gpio.h | 6 +-----
>
> diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
> index 166a7a3..15e8970 100644
> --- a/arch/arm/include/asm/gpio.h
> +++ b/arch/arm/include/asm/gpio.h
> @@ -4,4 +4,14 @@
> /* not all ARM platforms necessarily support this API ... */
> #include <mach/gpio.h>
>
> +#ifdef __ARM_GPIOLIB_TRIVIAL
> +/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h
*/
> +#include <asm-generic/gpio.h>
> +
> +/* The trivial gpiolib dispatchers */
> +#define gpio_get_value __gpio_get_value
> +#define gpio_set_value __gpio_set_value
> +#define gpio_cansleep __gpio_cansleep
> +#endif
> +
> #endif /* _ARCH_ARM_GPIO_H */
> diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-
> exynos4/include/mach/gpio.h
> index be9266b..b2e3595 100644
> --- a/arch/arm/mach-exynos4/include/mach/gpio.h
> +++ b/arch/arm/mach-exynos4/include/mach/gpio.h
> @@ -13,9 +13,6 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define gpio_get_value __gpio_get_value
> -#define gpio_set_value __gpio_set_value
> -#define gpio_cansleep __gpio_cansleep
> #define gpio_to_irq __gpio_to_irq
>
> /* Practically, GPIO banks up to GPZ are the configurable gpio banks */
> @@ -151,6 +148,6 @@ enum s5p_gpio_number {
> #define ARCH_NR_GPIOS
> (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \
> CONFIG_SAMSUNG_GPIO_EXTRA + 1)
>
> -#include <asm-generic/gpio.h>
> +#define __ARM_GPIOLIB_TRIVIAL
>
> #endif /* __ASM_ARCH_GPIO_H */
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-
> s3c2410/include/mach/gpio.h
> index f7f6b07..998ef4c 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
> @@ -11,9 +11,7 @@
> * published by the Free Software Foundation.
> */
>
> -#define gpio_get_value __gpio_get_value
> -#define gpio_set_value __gpio_set_value
> -#define gpio_cansleep __gpio_cansleep
> +#define __ARM_GPIOLIB_TRIVIAL
> #define gpio_to_irq __gpio_to_irq
>
> /* some boards require extra gpio capacity to support external
> @@ -28,7 +26,6 @@
> #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
> #endif
>
> -#include <asm-generic/gpio.h>
> #include <mach/gpio-nrs.h>
> #include <mach/gpio-fns.h>
>
> diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-
> s3c64xx/include/mach/gpio.h
> index 0d46e99..6958b3f 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
> @@ -12,9 +12,7 @@
> * published by the Free Software Foundation.
> */
>
> -#define gpio_get_value __gpio_get_value
> -#define gpio_set_value __gpio_set_value
> -#define gpio_cansleep __gpio_cansleep
> +#define __ARM_GPIOLIB_TRIVIAL
> #define gpio_to_irq __gpio_to_irq
>
> /* GPIO bank sizes */
> @@ -96,5 +94,3 @@ enum s3c_gpio_number {
> #define BOARD_NR_GPIOS 16
>
> #define ARCH_NR_GPIOS (GPIO_BOARD_START + BOARD_NR_GPIOS)
> -
> -#include <asm-generic/gpio.h>
> diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-
> s5p64x0/include/mach/gpio.h
> index adb5f29..a25160b 100644
> --- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
> +++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
> @@ -13,9 +13,7 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define gpio_get_value __gpio_get_value
> -#define gpio_set_value __gpio_set_value
> -#define gpio_cansleep __gpio_cansleep
> +#define __ARM_GPIOLIB_TRIVIAL
> #define gpio_to_irq __gpio_to_irq
>
> /* GPIO bank sizes */
> @@ -134,6 +132,4 @@ enum s5p6450_gpio_number {
>
> #define ARCH_NR_GPIOS (S5P64X0_GPIO_END +
> CONFIG_SAMSUNG_GPIO_EXTRA)
>
> -#include <asm-generic/gpio.h>
> -
> #endif /* __ASM_ARCH_GPIO_H */
> diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-
> s5pc100/include/mach/gpio.h
> index 29a8a12..f515bfb 100644
> --- a/arch/arm/mach-s5pc100/include/mach/gpio.h
> +++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
> @@ -15,9 +15,7 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define gpio_get_value __gpio_get_value
> -#define gpio_set_value __gpio_set_value
> -#define gpio_cansleep __gpio_cansleep
> +#define __ARM_GPIOLIB_TRIVIAL
> #define gpio_to_irq __gpio_to_irq
>
> /* GPIO bank sizes */
> @@ -146,6 +144,4 @@ enum s5p_gpio_number {
> /* define the number of gpios we need to the one after the MP04() range
*/
> #define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)
>
> -#include <asm-generic/gpio.h>
> -
> #endif /* __ASM_ARCH_GPIO_H */
> diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-
> s5pv210/include/mach/gpio.h
> index a5a1e33..27f2139 100644
> --- a/arch/arm/mach-s5pv210/include/mach/gpio.h
> +++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
> @@ -13,9 +13,7 @@
> #ifndef __ASM_ARCH_GPIO_H
> #define __ASM_ARCH_GPIO_H __FILE__
>
> -#define gpio_get_value __gpio_get_value
> -#define gpio_set_value __gpio_set_value
> -#define gpio_cansleep __gpio_cansleep
> +#define __ARM_GPIOLIB_TRIVIAL
> #define gpio_to_irq __gpio_to_irq
>
> /* Practically, GPIO banks up to MP03 are the configurable gpio banks */
> @@ -142,6 +140,4 @@ enum s5p_gpio_number {
> #define ARCH_NR_GPIOS
> (S5PV210_MP05(S5PV210_GPIO_MP05_NR) + \
> CONFIG_SAMSUNG_GPIO_EXTRA + 1)
>
> -#include <asm-generic/gpio.h>
> -
> #endif /* __ASM_ARCH_GPIO_H */
^ permalink raw reply
* Re: LCDC problem after commit 794d78fea51504bad3880d14f354a9847f318f25
From: Laurent Pinchart @ 2011-08-11 0:10 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <201108080125.34329.rjw@sisk.pl>
Hi Magnus,
Sorry for the late reply.
On Tuesday 09 August 2011 12:48:44 Magnus Damm wrote:
> On Mon, Aug 8, 2011 at 10:46 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> > On Mon, Aug 8, 2011 at 8:25 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> >> Unfortunately, after commit 794d78fea51504bad3880d14f354a9847f318f25
> >> (drivers: sh: late disabling of clocks V2) the LCDC screen on my
> >> Mackerel board goes off (late) during boot and cannot be turned on
> >> by any way AFAICS (the backlight remains on, though).
> >>
> >> It looks like the late disabling of clocks interacts badly with the
> >> clock management done by PM domains.
> >
> > This is most likely showing a so-far-not-handled clock dependency for
> > the LCDC hardware. I'll have a look.
>
> Further investigation shows that this only triggers when the MERAM is
> enabled in the kernel configuration using CONFIG_FB_SH_MOBILE_MERAM=y.
> So this seems more related to MERAM power management than LCDC.
>
> Digging a bit deeper makes it clear that the sh_mobile_meram.c driver
> in upstream doesn't seem to include any Runtime PM code. I recall
> seeing various versions posted to the mailing list.
>
> Laurent [CC], can you please provide us with a list of outstanding
> LCDC/MERAM patches to make this work as expected? I realize there are
> quite a few outstanding LCDC patches, but if possible please provide a
> list of the bare minimum to make this work with 3.1-rc.
I've pushed my pending patches to http://git.linuxtv.org/pinchartl/fbdev.git
in the pm-domains branch. The first 19 patches have been picked from mailing
lists. Hopefully they're the latest versions that have been posted. The next
11 patches shouldn't be required to enable runtime PM with the MERAM, but they
provide code cleanup and bug fixes.
Are Rafael' and Damian's patches ready for mainline ? If so, when will they be
pulled ? They're more than one month old, I was expecting them to hit v3.1-
rc1. The backlog is growing, which makes collaboration more difficult.
> I suspect that Damian [CC] is busy, but if time allows perhaps he can
> share his ideas as well.
>
> When looking into this I noticed that the MERAM parent clock
> assignment seems broken:
>
> static struct clk mstp_clks[MSTP_NR] = {
> ...
> [MSTP113] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 13, 0), /* MERAM */
>
> Judging by the "Clock Assignment to Modules" table in the CPGA chapter
> of the sh7372 data sheet, this should probably be &div4_clks[DIV4_S]
> or &div4_clks[DIV4_B]. But before dealing with the parent accounting
> we need to have Runtime PM support included in the MERAM driver.
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH 11/13] ARM: gpio: consolidate trivial gpiolib implementations
From: Linus Walleij @ 2011-08-10 7:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhM1-0003af-U5@rmk-PC.arm.linux.org.uk>
2011/8/9 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> Consolidate 24 trivial gpiolib implementions out of mach/gpio.h
> into asm/gpio.h. This is basically the include of asm-generic/gpio.h
> and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep
> as described in Documentation/gpio.txt
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
reaks compile of plat-nomadik due to missing u32, feel free to fold in
the below fix. With that it's
Tested-by: Linus Walleij <linus.walleij@linaro.org>
for Nomadik, U300 and Ux500.
From 2e4496fc7643d804ccf50a8efe1a0304210176d1 Mon Sep 17 00:00:00 2001
From: Linus Walleij <linus.walleij@linaro.org>
Date: Wed, 10 Aug 2011 09:51:16 +0200
Subject: [PATCH] plat-nomadik: small fixup for gpio.h
Removing the generic gpio.h broke compilation of the Nomadik
GPIO driver since it implicitly got u32 from it. Explicitly
include <linux/kernel.h> so we get u32 defined.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/plat-nomadik/include/plat/gpio.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h
b/arch/arm/plat-nomadik/include/plat/gpio.h
index cf0b78b..b894a53 100644
--- a/arch/arm/plat-nomadik/include/plat/gpio.h
+++ b/arch/arm/plat-nomadik/include/plat/gpio.h
@@ -12,6 +12,8 @@
#ifndef __ASM_PLAT_GPIO_H
#define __ASM_PLAT_GPIO_H
+#include <linux/kernel.h>
+
/*
* "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
* the "gpio" namespace for generic and cross-machine functions
--
1.7.3.2
Thanks,
Linus Walleij
^ permalink raw reply related
* [PATCH] ARM: mach-shmobile: Remove 3DG/SGX from sh7372 INTCS
From: Magnus Damm @ 2011-08-10 5:45 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@opensource.se>
This patch removes support for the SGX interrupt source in
the sh7372 INTCS controller.
The SGX hardware block included in sh7372 is already hooked
up to the ARM Cortex-A8 core using the INTCA controller,
so SGX users are encouraged to make use of that interrupt
source instead.
Removing support for the SGX interrupt source in INTCS
simplifies the sh7372 power management code by allowing
us to assume that only INTCA needs to be powered on to
operate the SGX hardware.
If the INTCS interrupt source would be kept then the kernel
would be forced to deal with additional dependencies that does
not follow the regular power domain hiearachy. With this
patch in place we can safely power down INTCS while the
SGX is operating.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/intc-sh7372.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- 0001/arch/arm/mach-shmobile/intc-sh7372.c
+++ work/arch/arm/mach-shmobile/intc-sh7372.c 2011-08-10 13:01:41.000000000 +0900
@@ -379,7 +379,7 @@ enum {
/* BBIF2 */
VPU,
TSIF1,
- _3DG_SGX530,
+ /* 3DG */
_2DDMAC,
IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
IPMMU_IPMMUR, IPMMU_IPMMUR2,
@@ -436,7 +436,7 @@ static struct intc_vect intcs_vectors[]
/* BBIF2 */
INTCS_VECT(VPU, 0x980),
INTCS_VECT(TSIF1, 0x9a0),
- INTCS_VECT(_3DG_SGX530, 0x9e0),
+ /* 3DG */
INTCS_VECT(_2DDMAC, 0xa00),
INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0),
INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0),
@@ -521,7 +521,7 @@ static struct intc_mask_reg intcs_mask_r
RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } },
{ 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */
{ 0, 0, MSIOF, 0,
- _3DG_SGX530, 0, 0, 0 } },
+ 0, 0, 0, 0 } },
{ 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */
{ 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
0, 0, 0, 0 } },
@@ -561,7 +561,6 @@ static struct intc_prio_reg intcs_prio_r
TMU_TUNI2, TSIF1 } },
{ 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } },
{ 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } },
- { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX530, 0, 0 } },
{ 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } },
{ 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } },
{ 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } },
^ permalink raw reply
* Re: LCDC problem after commit 794d78fea51504bad3880d14f354a9847f318f25
From: Damian Hobson-Garcia @ 2011-08-10 4:58 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <201108080125.34329.rjw@sisk.pl>
Hi Magnus,
> Hi Rafael,
>
> [Dropped Linux-PM list, added Laurent and Damian]
>
> Laurent [CC], can you please provide us with a list of outstanding
> LCDC/MERAM patches to make this work as expected? I realize there are
> quite a few outstanding LCDC patches, but if possible please provide a
> list of the bare minimum to make this work with 3.1-rc.
>
> I suspect that Damian [CC] is busy, but if time allows perhaps he can
> share his ideas as well.
I don't really know about the LCDC patches, but for the MERAM side the
top 5 commits from the common/fbdev-meram branch (fbdev:
sh_mobile_meram: Enable runtime PM .. fbdev: sh_mobile_lcdc: Turn dot
clock on...) + Laurent's latest patch series (sh_mobile_meram cleanup
and fixes), which fixes a suspend bug, should be everything.
If you only want the runtime portion then you can probably get by with
just the common/fbdev-meram branch.
Thanks,
Damian
^ permalink raw reply
* Re: [PATCH 00/13] Clean up mach/gpio.h headers
From: Grant Likely @ 2011-08-09 21:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809213230.GC14281@n2100.arm.linux.org.uk>
On Tue, Aug 09, 2011 at 10:32:30PM +0100, Russell King - ARM Linux wrote:
> On Tue, Aug 09, 2011 at 03:00:55PM -0600, Grant Likely wrote:
> > On Tue, Aug 09, 2011 at 09:04:12AM +0100, Russell King - ARM Linux wrote:
> > > This is a preliminary posting of my gpio patch set.
> > >
> > > This patch series moves the trivial gpiolib implementations out of
> > > mach/gpio.h and into asm/gpio.h.
> > >
> > > As a side effect of that, most of this patch series is about fixing up
> > > direct includes of mach/gpio.h - this is something I've been on at
> > > people over the last year or more about ensuring that they use
> > > linux/gpio.h in preference. While I've blindly converted all arch/arm
> > > to use linux/gpio.h (with the exception of mach/ includes which are
> > > converted to asm/gpio.h), drivers were only converted to asm/gpio.h.
> > > These should be reviewed and changed to linux/gpio.h.
> > >
> > > As a result of this patch series, several mach/gpio.h end up being
> > > empty.
> > >
> > > Many others just contain platform private GPIO APIs and definitions.
> > >
> > > The last thing which mach/gpio.h is used for is to provide a definition
> > > for ARCH_GPIO_NR to asm-generic/gpio.h. I've not attempted to solve
> > > that issue yet.
> > >
> > > A small number of platforms optimize the gpio accessors for on-SoC
> > > GPIOs. In the interests of consolidation, these will have to be killed
> > > but this patch set does not do that yet.
> > >
> > > Lastly, several {mach,plat}/gpio.h needs to be looked at with a view to
> > > deleting the direct include of asm-generic/gpio.h.
> >
> > Looks good to me, though I haven't looked closely. I imagine this
> > should get merged via a branch in the arm-soc tree?
>
> And this is where the existence of the arm-soc tree makes things more
> difficult for me. I'd normally just keep it as a separate branch in
> my own tree. What I do now, I've no idea.
A separate branch in your tree works too. It could even get pulled
into the arm-soc tree so that it gets picked up by the daily
integration test before going on to linux-next.
g.
^ permalink raw reply
* Re: [PATCH 00/13] Clean up mach/gpio.h headers
From: Russell King - ARM Linux @ 2011-08-09 21:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809210055.GF11568@ponder.secretlab.ca>
On Tue, Aug 09, 2011 at 03:00:55PM -0600, Grant Likely wrote:
> On Tue, Aug 09, 2011 at 09:04:12AM +0100, Russell King - ARM Linux wrote:
> > This is a preliminary posting of my gpio patch set.
> >
> > This patch series moves the trivial gpiolib implementations out of
> > mach/gpio.h and into asm/gpio.h.
> >
> > As a side effect of that, most of this patch series is about fixing up
> > direct includes of mach/gpio.h - this is something I've been on at
> > people over the last year or more about ensuring that they use
> > linux/gpio.h in preference. While I've blindly converted all arch/arm
> > to use linux/gpio.h (with the exception of mach/ includes which are
> > converted to asm/gpio.h), drivers were only converted to asm/gpio.h.
> > These should be reviewed and changed to linux/gpio.h.
> >
> > As a result of this patch series, several mach/gpio.h end up being
> > empty.
> >
> > Many others just contain platform private GPIO APIs and definitions.
> >
> > The last thing which mach/gpio.h is used for is to provide a definition
> > for ARCH_GPIO_NR to asm-generic/gpio.h. I've not attempted to solve
> > that issue yet.
> >
> > A small number of platforms optimize the gpio accessors for on-SoC
> > GPIOs. In the interests of consolidation, these will have to be killed
> > but this patch set does not do that yet.
> >
> > Lastly, several {mach,plat}/gpio.h needs to be looked at with a view to
> > deleting the direct include of asm-generic/gpio.h.
>
> Looks good to me, though I haven't looked closely. I imagine this
> should get merged via a branch in the arm-soc tree?
And this is where the existence of the arm-soc tree makes things more
difficult for me. I'd normally just keep it as a separate branch in
my own tree. What I do now, I've no idea.
^ permalink raw reply
* Re: [PATCH 00/13] Clean up mach/gpio.h headers
From: Grant Likely @ 2011-08-09 21:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
On Tue, Aug 09, 2011 at 09:04:12AM +0100, Russell King - ARM Linux wrote:
> This is a preliminary posting of my gpio patch set.
>
> This patch series moves the trivial gpiolib implementations out of
> mach/gpio.h and into asm/gpio.h.
>
> As a side effect of that, most of this patch series is about fixing up
> direct includes of mach/gpio.h - this is something I've been on at
> people over the last year or more about ensuring that they use
> linux/gpio.h in preference. While I've blindly converted all arch/arm
> to use linux/gpio.h (with the exception of mach/ includes which are
> converted to asm/gpio.h), drivers were only converted to asm/gpio.h.
> These should be reviewed and changed to linux/gpio.h.
>
> As a result of this patch series, several mach/gpio.h end up being
> empty.
>
> Many others just contain platform private GPIO APIs and definitions.
>
> The last thing which mach/gpio.h is used for is to provide a definition
> for ARCH_GPIO_NR to asm-generic/gpio.h. I've not attempted to solve
> that issue yet.
>
> A small number of platforms optimize the gpio accessors for on-SoC
> GPIOs. In the interests of consolidation, these will have to be killed
> but this patch set does not do that yet.
>
> Lastly, several {mach,plat}/gpio.h needs to be looked at with a view to
> deleting the direct include of asm-generic/gpio.h.
Looks good to me, though I haven't looked closely. I imagine this
should get merged via a branch in the arm-soc tree?
g.
^ permalink raw reply
* Re: [PATCH 06/13] ARM: gpio: davinci: convert drivers to use
From: Russell King - ARM Linux @ 2011-08-09 19:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4E4122B6.2070706@ru.mvista.com>
On Tue, Aug 09, 2011 at 04:06:14PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 09-08-2011 12:06, Russell King - ARM Linux wrote:
>
> CCing linux-usb and Felipe...
>
>> Signed-off-by: Russell King<rmk+kernel@arm.linux.org.uk>
>> ---
>> drivers/usb/musb/davinci.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>> diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
>> index 8bdf25a..f9a3f62 100644
>> --- a/drivers/usb/musb/davinci.c
>> +++ b/drivers/usb/musb/davinci.c
>> @@ -35,7 +35,7 @@
>>
>> #include<mach/hardware.h>
>> #include<mach/memory.h>
>> -#include<mach/gpio.h>
>> +#include<asm/gpio.h>
>
> Shouldn't this now be moved to the below #include group?
When doing this kind of work with sed -i, that doesn't happen. There's
too much of this crap (and I've been telling people about this for at
least a year) that I don't think there's that luxury anymore.
If maintainers would have paid more attention, then most of these changes
would not be necessary. My view is that if maintainers do care about this
stuff _they_ should have been the ones to pick up on it long ago. In
other words, they've lost the right to complain about petty crap like
the ordering of includes through their own inaction on this point.
^ permalink raw reply
* Re: [PATCH 11/13] ARM: gpio: consolidate trivial gpiolib
From: David Brown @ 2011-08-09 17:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhM1-0003af-U5@rmk-PC.arm.linux.org.uk>
On Tue, Aug 09, 2011 at 09:08:01AM +0100, Russell King - ARM Linux wrote:
> Consolidate 24 trivial gpiolib implementions out of mach/gpio.h
> into asm/gpio.h. This is basically the include of asm-generic/gpio.h
> and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep
> as described in Documentation/gpio.txt
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> arch/arm/mach-msm/include/mach/gpio.h | 5 +----
For msm (msm8660):
Tested-by: David Brown <davidb@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply
* RE: [PATCH 13/13] ARM: gpio: make trivial GPIOLIB implementation
From: H Hartley Sweeten @ 2011-08-09 17:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhMg-0003an-GW@rmk-PC.arm.linux.org.uk>
On Tuesday, August 09, 2011 1:09 AM, Russell King wrote:
>
> Rather than marking the mach/gpio.h header files which want to use the
> trivial GPIOLIB implementation, mark those which do not want to use it
> instead. This means that by default, you get the trivial implementation
> and only have to do something extra if you need to. This should
> encourage the use of the trivial default implementation.
>
> As an additional bonus, several gpio.h header files become empty.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> arch/arm/include/asm/gpio.h | 2 +-
> arch/arm/include/asm/hardware/iop3xx-gpio.h | 2 ++
>
> diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
> index 5032224..11ad0bf 100644
> --- a/arch/arm/include/asm/gpio.h
> +++ b/arch/arm/include/asm/gpio.h
> @@ -4,7 +4,7 @@
> /* not all ARM platforms necessarily support this API ... */
> #include <mach/gpio.h>
>
> -#ifdef __ARM_GPIOLIB_TRIVIAL
> +#ifndef __ARM_GPIOLIB_COMPLEX
> /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
> #include <asm-generic/gpio.h>
>
> diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h
> index fbc770e..071f676 100644
> --- a/arch/arm/mach-ep93xx/include/mach/gpio.h
> +++ b/arch/arm/mach-ep93xx/include/mach/gpio.h
> @@ -99,9 +99,6 @@
> /* maximum value for irq capable line identifiers */
> #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7)
>
> -/* new generic GPIO API - see Documentation/gpio.txt */
> -#define __ARM_GPIOLIB_TRIVIAL
> -
> /*
> * Map GPIO A0..A7 (0..7) to irq 64..71,
> * B0..B7 (7..15) to irq 72..79, and
For ep93xx:
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Thanks!
^ permalink raw reply
* RE: [PATCH 11/13] ARM: gpio: consolidate trivial gpiolib
From: H Hartley Sweeten @ 2011-08-09 17:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhM1-0003af-U5@rmk-PC.arm.linux.org.uk>
On Tuesday, August 09, 2011 1:08 AM, Russell King wrote:
>
> Consolidate 24 trivial gpiolib implementions out of mach/gpio.h
> into asm/gpio.h. This is basically the include of asm-generic/gpio.h
> and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep
> as described in Documentation/gpio.txt
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> arch/arm/include/asm/gpio.h | 10 ++++++++++
> arch/arm/mach-ep93xx/include/mach/gpio.h | 7 +------
>
> diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
> index 166a7a3..15e8970 100644
> --- a/arch/arm/include/asm/gpio.h
> +++ b/arch/arm/include/asm/gpio.h
> @@ -4,4 +4,14 @@
> /* not all ARM platforms necessarily support this API ... */
> #include <mach/gpio.h>
>
> +#ifdef __ARM_GPIOLIB_TRIVIAL
> +/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
> +#include <asm-generic/gpio.h>
> +
> +/* The trivial gpiolib dispatchers */
> +#define gpio_get_value __gpio_get_value
> +#define gpio_set_value __gpio_set_value
> +#define gpio_cansleep __gpio_cansleep
> +#endif
> +
> #endif /* _ARCH_ARM_GPIO_H */
> diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h
> index c57152c..fbc770e 100644
> --- a/arch/arm/mach-ep93xx/include/mach/gpio.h
> +++ b/arch/arm/mach-ep93xx/include/mach/gpio.h
> @@ -100,12 +100,7 @@
> #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7)
>
> /* new generic GPIO API - see Documentation/gpio.txt */
> -
> -#include <asm-generic/gpio.h>
> -
> -#define gpio_get_value __gpio_get_value
> -#define gpio_set_value __gpio_set_value
> -#define gpio_cansleep __gpio_cansleep
> +#define __ARM_GPIOLIB_TRIVIAL
>
> /*
> * Map GPIO A0..A7 (0..7) to irq 64..71,
For ep93xx:
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Thanks!
^ permalink raw reply
* Re: [PATCH 06/13] ARM: gpio: davinci: convert drivers to use asm/gpio.h
From: Sergei Shtylyov @ 2011-08-09 12:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <E1QqhKP-0003aK-9R@rmk-PC.arm.linux.org.uk>
Hello.
On 09-08-2011 12:06, Russell King - ARM Linux wrote:
CCing linux-usb and Felipe...
> Signed-off-by: Russell King<rmk+kernel@arm.linux.org.uk>
> ---
> drivers/usb/musb/davinci.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
> index 8bdf25a..f9a3f62 100644
> --- a/drivers/usb/musb/davinci.c
> +++ b/drivers/usb/musb/davinci.c
> @@ -35,7 +35,7 @@
>
> #include<mach/hardware.h>
> #include<mach/memory.h>
> -#include<mach/gpio.h>
> +#include<asm/gpio.h>
Shouldn't this now be moved to the below #include group?
> #include<mach/cputype.h>
>
> #include<asm/mach-types.h>
WBR, Sergei
^ permalink raw reply
* Re: LCDC problem after commit 794d78fea51504bad3880d14f354a9847f318f25
From: Magnus Damm @ 2011-08-09 10:48 UTC (permalink / raw)
To: linux-sh
In-Reply-To: <201108080125.34329.rjw@sisk.pl>
Hi Rafael,
[Dropped Linux-PM list, added Laurent and Damian]
On Mon, Aug 8, 2011 at 10:46 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> On Mon, Aug 8, 2011 at 8:25 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> Unfortunately, after commit 794d78fea51504bad3880d14f354a9847f318f25
>> (drivers: sh: late disabling of clocks V2) the LCDC screen on my
>> Mackerel board goes off (late) during boot and cannot be turned on
>> by any way AFAICS (the backlight remains on, though).
>>
>> It looks like the late disabling of clocks interacts badly with the
>> clock management done by PM domains.
>
> This is most likely showing a so-far-not-handled clock dependency for
> the LCDC hardware. I'll have a look.
Further investigation shows that this only triggers when the MERAM is
enabled in the kernel configuration using CONFIG_FB_SH_MOBILE_MERAM=y.
So this seems more related to MERAM power management than LCDC.
Digging a bit deeper makes it clear that the sh_mobile_meram.c driver
in upstream doesn't seem to include any Runtime PM code. I recall
seeing various versions posted to the mailing list.
Laurent [CC], can you please provide us with a list of outstanding
LCDC/MERAM patches to make this work as expected? I realize there are
quite a few outstanding LCDC patches, but if possible please provide a
list of the bare minimum to make this work with 3.1-rc.
I suspect that Damian [CC] is busy, but if time allows perhaps he can
share his ideas as well.
When looking into this I noticed that the MERAM parent clock
assignment seems broken:
static struct clk mstp_clks[MSTP_NR] = {
...
[MSTP113] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 13, 0), /* MERAM */
Judging by the "Clock Assignment to Modules" table in the CPGA chapter
of the sh7372 data sheet, this should probably be &div4_clks[DIV4_S]
or &div4_clks[DIV4_B]. But before dealing with the parent accounting
we need to have Runtime PM support included in the MERAM driver.
Cheers,
/ magnus
^ permalink raw reply
* Re: [PATCH 00/13] Clean up mach/gpio.h headers
From: Jamie Iles @ 2011-08-09 9:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Hi Russell,
On Tue, Aug 09, 2011 at 09:04:12AM +0100, Russell King - ARM Linux wrote:
> This is a preliminary posting of my gpio patch set.
>
> This patch series moves the trivial gpiolib implementations out of
> mach/gpio.h and into asm/gpio.h.
>
> As a side effect of that, most of this patch series is about fixing up
> direct includes of mach/gpio.h - this is something I've been on at
> people over the last year or more about ensuring that they use
> linux/gpio.h in preference. While I've blindly converted all arch/arm
> to use linux/gpio.h (with the exception of mach/ includes which are
> converted to asm/gpio.h), drivers were only converted to asm/gpio.h.
> These should be reviewed and changed to linux/gpio.h.
>
> As a result of this patch series, several mach/gpio.h end up being
> empty.
Nice series! This gives me an empty gpio.h for picoxcell.
Tested-by: Jamie Iles <jamie@jamieiles.com>
Jamie
^ permalink raw reply
* [PATCH 13/13] ARM: gpio: make trivial GPIOLIB implementation the
From: Russell King - ARM Linux @ 2011-08-09 8:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Rather than marking the mach/gpio.h header files which want to use the
trivial GPIOLIB implementation, mark those which do not want to use it
instead. This means that by default, you get the trivial implementation
and only have to do something extra if you need to. This should
encourage the use of the trivial default implementation.
As an additional bonus, several gpio.h header files become empty.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/gpio.h | 2 +-
arch/arm/include/asm/hardware/iop3xx-gpio.h | 2 ++
arch/arm/mach-at91/include/mach/gpio.h | 2 --
arch/arm/mach-davinci/include/mach/gpio.h | 2 ++
arch/arm/mach-ep93xx/include/mach/gpio.h | 3 ---
arch/arm/mach-exynos4/include/mach/gpio.h | 2 --
arch/arm/mach-gemini/include/mach/gpio.h | 2 --
arch/arm/mach-ixp4xx/include/mach/gpio.h | 2 ++
arch/arm/mach-ks8695/include/mach/gpio.h | 2 --
arch/arm/mach-lpc32xx/include/mach/gpio.h | 2 --
arch/arm/mach-msm/include/mach/gpio.h | 22 +---------------------
arch/arm/mach-mxs/include/mach/gpio.h | 3 ---
arch/arm/mach-realview/include/mach/gpio.h | 2 +-
arch/arm/mach-s3c2410/include/mach/gpio.h | 2 --
arch/arm/mach-s3c64xx/include/mach/gpio.h | 2 --
arch/arm/mach-s5p64x0/include/mach/gpio.h | 2 --
arch/arm/mach-s5pc100/include/mach/gpio.h | 2 --
arch/arm/mach-s5pv210/include/mach/gpio.h | 2 --
arch/arm/mach-sa1100/include/mach/gpio.h | 2 ++
arch/arm/mach-shmobile/include/mach/gpio.h | 6 ++++--
arch/arm/mach-tegra/include/mach/gpio.h | 2 --
arch/arm/mach-u300/include/mach/gpio.h | 2 ++
arch/arm/mach-versatile/include/mach/gpio.h | 2 +-
arch/arm/mach-vt8500/include/mach/gpio.h | 2 +-
arch/arm/mach-w90x900/include/mach/gpio.h | 2 --
arch/arm/plat-mxc/include/mach/gpio.h | 3 ---
arch/arm/plat-nomadik/include/plat/gpio.h | 2 --
arch/arm/plat-omap/include/plat/gpio.h | 2 --
arch/arm/plat-orion/include/plat/gpio.h | 2 --
arch/arm/plat-pxa/include/plat/gpio.h | 2 ++
arch/arm/plat-spear/include/plat/gpio.h | 20 +-------------------
31 files changed, 22 insertions(+), 85 deletions(-)
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 5032224..11ad0bf 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -4,7 +4,7 @@
/* not all ARM platforms necessarily support this API ... */
#include <mach/gpio.h>
-#ifdef __ARM_GPIOLIB_TRIVIAL
+#ifndef __ARM_GPIOLIB_COMPLEX
/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
#include <asm-generic/gpio.h>
diff --git a/arch/arm/include/asm/hardware/iop3xx-gpio.h b/arch/arm/include/asm/hardware/iop3xx-gpio.h
index b69d972..9eda7dc 100644
--- a/arch/arm/include/asm/hardware/iop3xx-gpio.h
+++ b/arch/arm/include/asm/hardware/iop3xx-gpio.h
@@ -28,6 +28,8 @@
#include <mach/hardware.h>
#include <asm-generic/gpio.h>
+#define __ARM_GPIOLIB_COMPLEX
+
#define IOP3XX_N_GPIOS 8
static inline int gpio_get_value(unsigned gpio)
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
index 6ddc1a6..2b9a1f5 100644
--- a/arch/arm/mach-at91/include/mach/gpio.h
+++ b/arch/arm/mach-at91/include/mach/gpio.h
@@ -215,8 +215,6 @@ extern void at91_gpio_resume(void);
#include <asm/errno.h>
-#define __ARM_GPIOLIB_TRIVIAL
-
#define gpio_to_irq(gpio) (gpio)
#define irq_to_gpio(irq) (irq)
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index 73fc7a0..14e7bb20 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -21,6 +21,8 @@
#include <mach/irqs.h>
#include <mach/common.h>
+#define __ARM_GPIOLIB_COMPLEX
+
#define DAVINCI_GPIO_BASE 0x01C67000
enum davinci_gpio_type {
diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h
index fbc770e..071f676 100644
--- a/arch/arm/mach-ep93xx/include/mach/gpio.h
+++ b/arch/arm/mach-ep93xx/include/mach/gpio.h
@@ -99,9 +99,6 @@
/* maximum value for irq capable line identifiers */
#define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7)
-/* new generic GPIO API - see Documentation/gpio.txt */
-#define __ARM_GPIOLIB_TRIVIAL
-
/*
* Map GPIO A0..A7 (0..7) to irq 64..71,
* B0..B7 (7..15) to irq 72..79, and
diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h
index b91e8b2..80523ca 100644
--- a/arch/arm/mach-exynos4/include/mach/gpio.h
+++ b/arch/arm/mach-exynos4/include/mach/gpio.h
@@ -146,6 +146,4 @@ enum s5p_gpio_number {
#define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \
CONFIG_SAMSUNG_GPIO_EXTRA + 1)
-#define __ARM_GPIOLIB_TRIVIAL
-
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-gemini/include/mach/gpio.h b/arch/arm/mach-gemini/include/mach/gpio.h
index 20c0a36..40a0527 100644
--- a/arch/arm/mach-gemini/include/mach/gpio.h
+++ b/arch/arm/mach-gemini/include/mach/gpio.h
@@ -14,8 +14,6 @@
#include <mach/irqs.h>
-#define __ARM_GPIOLIB_TRIVIAL
-
#define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE)
#define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE)
diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h
index 19009bf..83d6b4e 100644
--- a/arch/arm/mach-ixp4xx/include/mach/gpio.h
+++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h
@@ -28,6 +28,8 @@
#include <linux/kernel.h>
#include <mach/hardware.h>
+#define __ARM_GPIOLIB_COMPLEX
+
static inline int gpio_request(unsigned gpio, const char *label)
{
return 0;
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h
index 59d6b53..994267b 100644
--- a/arch/arm/mach-ks8695/include/mach/gpio.h
+++ b/arch/arm/mach-ks8695/include/mach/gpio.h
@@ -40,8 +40,6 @@ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
*/
extern int irq_to_gpio(unsigned int irq);
-#define __ARM_GPIOLIB_TRIVIAL
-
/* Register the GPIOs */
extern void ks8695_register_gpios(void);
diff --git a/arch/arm/mach-lpc32xx/include/mach/gpio.h b/arch/arm/mach-lpc32xx/include/mach/gpio.h
index b01cd24..66d31f6 100644
--- a/arch/arm/mach-lpc32xx/include/mach/gpio.h
+++ b/arch/arm/mach-lpc32xx/include/mach/gpio.h
@@ -49,6 +49,4 @@
*/
#define LPC32XX_GPIO(x, y) ((x) + (y))
-#define __ARM_GPIOLIB_TRIVIAL
-
#endif
diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h
index 10197a9..40a8c17 100644
--- a/arch/arm/mach-msm/include/mach/gpio.h
+++ b/arch/arm/mach-msm/include/mach/gpio.h
@@ -1,21 +1 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- * Author: Mike Lockwood <lockwood@android.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-#ifndef __ASM_ARCH_MSM_GPIO_H
-#define __ASM_ARCH_MSM_GPIO_H
-
-#define __ARM_GPIOLIB_TRIVIAL
-
-#endif /* __ASM_ARCH_MSM_GPIO_H */
+/* empty */
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h
index bf28a1f..bb11e63 100644
--- a/arch/arm/mach-mxs/include/mach/gpio.h
+++ b/arch/arm/mach-mxs/include/mach/gpio.h
@@ -22,9 +22,6 @@
#define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr))
-/* use gpiolib dispatchers */
-#define __ARM_GPIOLIB_TRIVIAL
-
#define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START)
#endif /* __MACH_MXS_GPIO_H__ */
diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h
index 910974b..40a8c17 100644
--- a/arch/arm/mach-realview/include/mach/gpio.h
+++ b/arch/arm/mach-realview/include/mach/gpio.h
@@ -1 +1 @@
-#define __ARM_GPIOLIB_TRIVIAL
+/* empty */
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index d502d17..6fac70f 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -11,8 +11,6 @@
* published by the Free Software Foundation.
*/
-#define __ARM_GPIOLIB_TRIVIAL
-
/* some boards require extra gpio capacity to support external
* devices that need GPIO.
*/
diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h
index 3a8857c..6e34c2f 100644
--- a/arch/arm/mach-s3c64xx/include/mach/gpio.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
@@ -12,8 +12,6 @@
* published by the Free Software Foundation.
*/
-#define __ARM_GPIOLIB_TRIVIAL
-
/* GPIO bank sizes */
#define S3C64XX_GPIO_A_NR (8)
#define S3C64XX_GPIO_B_NR (7)
diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-s5p64x0/include/mach/gpio.h
index c3a6aa0..06cd3c9 100644
--- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
@@ -13,8 +13,6 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define __ARM_GPIOLIB_TRIVIAL
-
/* GPIO bank sizes */
#define S5P6440_GPIO_A_NR (6)
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h
index 0e75641..5e1a924 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -15,8 +15,6 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define __ARM_GPIOLIB_TRIVIAL
-
/* GPIO bank sizes */
#define S5PC100_GPIO_A0_NR (8)
#define S5PC100_GPIO_A1_NR (5)
diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h
index d348ee2..6c8b903 100644
--- a/arch/arm/mach-s5pv210/include/mach/gpio.h
+++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
@@ -13,8 +13,6 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define __ARM_GPIOLIB_TRIVIAL
-
/* Practically, GPIO banks up to MP03 are the configurable gpio banks */
/* GPIO bank sizes */
diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h
index 7befc10..ab45b43 100644
--- a/arch/arm/mach-sa1100/include/mach/gpio.h
+++ b/arch/arm/mach-sa1100/include/mach/gpio.h
@@ -28,6 +28,8 @@
#include <asm/irq.h>
#include <asm-generic/gpio.h>
+#define __ARM_GPIOLIB_COMPLEX
+
static inline int gpio_get_value(unsigned gpio)
{
if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
index 95e11cf..7bf0890 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -18,13 +18,15 @@
#ifdef CONFIG_GPIOLIB
-#define __ARM_GPIOLIB_TRIVIAL
-
static inline int irq_to_gpio(unsigned int irq)
{
return -ENOSYS;
}
+#else
+
+#define __ARM_GPIOLIB_COMPLEX
+
#endif /* CONFIG_GPIOLIB */
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
index 5107223..e353805 100644
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ b/arch/arm/mach-tegra/include/mach/gpio.h
@@ -25,8 +25,6 @@
#define TEGRA_NR_GPIOS INT_GPIO_NR
-#define __ARM_GPIOLIB_TRIVIAL
-
#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio))
#define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE)
diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h
index 3d7b7d1..9a890e2 100644
--- a/arch/arm/mach-u300/include/mach/gpio.h
+++ b/arch/arm/mach-u300/include/mach/gpio.h
@@ -18,6 +18,8 @@
#include <mach/hardware.h>
#include <asm/irq.h>
+#define __ARM_GPIOLIB_COMPLEX
+
/* Switch type depending on platform/chip variant */
#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
#define U300_COH901335
diff --git a/arch/arm/mach-versatile/include/mach/gpio.h b/arch/arm/mach-versatile/include/mach/gpio.h
index 910974b..40a8c17 100644
--- a/arch/arm/mach-versatile/include/mach/gpio.h
+++ b/arch/arm/mach-versatile/include/mach/gpio.h
@@ -1 +1 @@
-#define __ARM_GPIOLIB_TRIVIAL
+/* empty */
diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h
index 910974b..40a8c17 100644
--- a/arch/arm/mach-vt8500/include/mach/gpio.h
+++ b/arch/arm/mach-vt8500/include/mach/gpio.h
@@ -1 +1 @@
-#define __ARM_GPIOLIB_TRIVIAL
+/* empty */
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h
index e7d4ed1..5385a42 100644
--- a/arch/arm/mach-w90x900/include/mach/gpio.h
+++ b/arch/arm/mach-w90x900/include/mach/gpio.h
@@ -16,8 +16,6 @@
#include <mach/hardware.h>
#include <asm/irq.h>
-#define __ARM_GPIOLIB_TRIVIAL
-
static inline int gpio_to_irq(unsigned gpio)
{
return gpio;
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 4398edd..3e1ffc8 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -27,9 +27,6 @@
/* range e.g. GPIO_1_5 is gpio 5 under linux */
#define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr))
-/* use gpiolib dispatchers */
-#define __ARM_GPIOLIB_TRIVIAL
-
#define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio))
#define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START)
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h
index 395156a..cf0b78b 100644
--- a/arch/arm/plat-nomadik/include/plat/gpio.h
+++ b/arch/arm/plat-nomadik/include/plat/gpio.h
@@ -12,8 +12,6 @@
#ifndef __ASM_PLAT_GPIO_H
#define __ASM_PLAT_GPIO_H
-#define __ARM_GPIOLIB_TRIVIAL
-
/*
* "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
* the "gpio" namespace for generic and cross-machine functions
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index f1fdfa5..9e86ee0 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -222,8 +222,6 @@ extern void omap_gpio_restore_context(void);
#include <linux/errno.h>
#include <asm-generic/gpio.h>
-#define __ARM_GPIOLIB_TRIVIAL
-
static inline int irq_to_gpio(unsigned irq)
{
int tmp;
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 985c197..f7d7630 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -13,8 +13,6 @@
#include <linux/init.h>
-#define __ARM_GPIOLIB_TRIVIAL
-
/*
* Orion-specific GPIO API extensions.
*/
diff --git a/arch/arm/plat-pxa/include/plat/gpio.h b/arch/arm/plat-pxa/include/plat/gpio.h
index 1ddd2b9..6fc41db 100644
--- a/arch/arm/plat-pxa/include/plat/gpio.h
+++ b/arch/arm/plat-pxa/include/plat/gpio.h
@@ -1,6 +1,8 @@
#ifndef __PLAT_GPIO_H
#define __PLAT_GPIO_H
+#define __ARM_GPIOLIB_COMPLEX
+
struct irq_data;
/*
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h
index 22d9e0f..40a8c17 100644
--- a/arch/arm/plat-spear/include/plat/gpio.h
+++ b/arch/arm/plat-spear/include/plat/gpio.h
@@ -1,19 +1 @@
-/*
- * arch/arm/plat-spear/include/plat/gpio.h
- *
- * GPIO macros for SPEAr platform
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __PLAT_GPIO_H
-#define __PLAT_GPIO_H
-
-#define __ARM_GPIOLIB_TRIVIAL
-
-#endif /* __PLAT_GPIO_H */
+/* empty */
--
1.7.4.4
^ permalink raw reply related
* [PATCH 12/13] ARM: gpio: consolidate gpio_to_irq
From: Russell King - ARM Linux @ 2011-08-09 8:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Many of the gpio_to_irq implementations use the gpiolib version of this
function. Provide the standard gpiolib gpio_to_irq() for everyone, but
allow platforms to override it if they wish. Add the neccessary
overrides for those platforms which do not use the standard definition.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/gpio.h | 9 +++++++++
arch/arm/mach-davinci/include/mach/gpio.h | 5 -----
arch/arm/mach-exynos4/include/mach/gpio.h | 2 --
arch/arm/mach-ixp4xx/include/mach/gpio.h | 1 +
arch/arm/mach-ks8695/include/mach/gpio.h | 2 --
arch/arm/mach-lpc32xx/include/mach/gpio.h | 5 -----
arch/arm/mach-msm/include/mach/gpio.h | 2 --
arch/arm/mach-mxs/include/mach/gpio.h | 1 -
arch/arm/mach-realview/include/mach/gpio.h | 1 -
arch/arm/mach-s3c2410/include/mach/gpio.h | 1 -
arch/arm/mach-s3c64xx/include/mach/gpio.h | 1 -
arch/arm/mach-s5p64x0/include/mach/gpio.h | 1 -
arch/arm/mach-s5pc100/include/mach/gpio.h | 1 -
arch/arm/mach-s5pv210/include/mach/gpio.h | 1 -
arch/arm/mach-shmobile/include/mach/gpio.h | 5 -----
arch/arm/mach-tegra/include/mach/gpio.h | 1 +
arch/arm/mach-u300/include/mach/gpio.h | 1 +
arch/arm/mach-versatile/include/mach/gpio.h | 1 -
arch/arm/mach-vt8500/include/mach/gpio.h | 1 -
arch/arm/mach-w90x900/include/mach/gpio.h | 1 +
arch/arm/plat-nomadik/include/plat/gpio.h | 1 -
arch/arm/plat-omap/include/plat/gpio.h | 5 -----
arch/arm/plat-orion/include/plat/gpio.h | 5 -----
arch/arm/plat-spear/include/plat/gpio.h | 1 -
24 files changed, 13 insertions(+), 42 deletions(-)
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 15e8970..5032224 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -14,4 +14,13 @@
#define gpio_cansleep __gpio_cansleep
#endif
+/*
+ * Provide a default gpio_to_irq() which should satisfy every case.
+ * However, some platforms want to do this differently, so allow them
+ * to override it.
+ */
+#ifndef gpio_to_irq
+#define gpio_to_irq __gpio_to_irq
+#endif
+
#endif /* _ARCH_ARM_GPIO_H */
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index fbece12..73fc7a0 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -147,11 +147,6 @@ static inline int gpio_cansleep(unsigned gpio)
return __gpio_cansleep(gpio);
}
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
static inline int irq_to_gpio(unsigned irq)
{
/* don't support the reverse mapping */
diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h
index b2e3595..b91e8b2 100644
--- a/arch/arm/mach-exynos4/include/mach/gpio.h
+++ b/arch/arm/mach-exynos4/include/mach/gpio.h
@@ -13,8 +13,6 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define gpio_to_irq __gpio_to_irq
-
/* Practically, GPIO banks up to GPZ are the configurable gpio banks */
/* GPIO bank sizes */
diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h
index a5f87de..19009bf 100644
--- a/arch/arm/mach-ixp4xx/include/mach/gpio.h
+++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h
@@ -70,6 +70,7 @@ static inline void gpio_set_value(unsigned gpio, int value)
#include <asm-generic/gpio.h> /* cansleep wrappers */
extern int gpio_to_irq(int gpio);
+#define gpio_to_irq gpio_to_irq
extern int irq_to_gpio(unsigned int irq);
#endif
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h
index c13952c..59d6b53 100644
--- a/arch/arm/mach-ks8695/include/mach/gpio.h
+++ b/arch/arm/mach-ks8695/include/mach/gpio.h
@@ -40,8 +40,6 @@ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
*/
extern int irq_to_gpio(unsigned int irq);
-#define gpio_to_irq __gpio_to_irq
-
#define __ARM_GPIOLIB_TRIVIAL
/* Register the GPIOs */
diff --git a/arch/arm/mach-lpc32xx/include/mach/gpio.h b/arch/arm/mach-lpc32xx/include/mach/gpio.h
index 0ca6c27..b01cd24 100644
--- a/arch/arm/mach-lpc32xx/include/mach/gpio.h
+++ b/arch/arm/mach-lpc32xx/include/mach/gpio.h
@@ -51,9 +51,4 @@
#define __ARM_GPIOLIB_TRIVIAL
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
#endif
diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h
index bc75e20..10197a9 100644
--- a/arch/arm/mach-msm/include/mach/gpio.h
+++ b/arch/arm/mach-msm/include/mach/gpio.h
@@ -18,6 +18,4 @@
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
-
#endif /* __ASM_ARCH_MSM_GPIO_H */
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h
index bb44c8d..bf28a1f 100644
--- a/arch/arm/mach-mxs/include/mach/gpio.h
+++ b/arch/arm/mach-mxs/include/mach/gpio.h
@@ -24,7 +24,6 @@
/* use gpiolib dispatchers */
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
#define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START)
diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h
index bd11dc5..910974b 100644
--- a/arch/arm/mach-realview/include/mach/gpio.h
+++ b/arch/arm/mach-realview/include/mach/gpio.h
@@ -1,2 +1 @@
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 998ef4c..d502d17 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -12,7 +12,6 @@
*/
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
/* some boards require extra gpio capacity to support external
* devices that need GPIO.
diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h
index 6958b3f..3a8857c 100644
--- a/arch/arm/mach-s3c64xx/include/mach/gpio.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
@@ -13,7 +13,6 @@
*/
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
/* GPIO bank sizes */
#define S3C64XX_GPIO_A_NR (8)
diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-s5p64x0/include/mach/gpio.h
index a25160b..c3a6aa0 100644
--- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
@@ -14,7 +14,6 @@
#define __ASM_ARCH_GPIO_H __FILE__
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
/* GPIO bank sizes */
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h
index f515bfb..0e75641 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -16,7 +16,6 @@
#define __ASM_ARCH_GPIO_H __FILE__
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
/* GPIO bank sizes */
#define S5PC100_GPIO_A0_NR (8)
diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h
index 27f2139..d348ee2 100644
--- a/arch/arm/mach-s5pv210/include/mach/gpio.h
+++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
@@ -14,7 +14,6 @@
#define __ASM_ARCH_GPIO_H __FILE__
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
/* Practically, GPIO banks up to MP03 are the configurable gpio banks */
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
index e8feff0..95e11cf 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -20,11 +20,6 @@
#define __ARM_GPIOLIB_TRIVIAL
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
static inline int irq_to_gpio(unsigned int irq)
{
return -ENOSYS;
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
index d51be09..5107223 100644
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ b/arch/arm/mach-tegra/include/mach/gpio.h
@@ -36,6 +36,7 @@ static inline int gpio_to_irq(unsigned int gpio)
return INT_GPIO_BASE + gpio;
return -EINVAL;
}
+#define gpio_to_irq gpio_to_irq
static inline int irq_to_gpio(unsigned int irq)
{
diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h
index d5a71ab..3d7b7d1 100644
--- a/arch/arm/mach-u300/include/mach/gpio.h
+++ b/arch/arm/mach-u300/include/mach/gpio.h
@@ -281,6 +281,7 @@ static inline unsigned gpio_to_irq(unsigned gpio)
{
return PIN_TO_PORT(gpio) + IRQ_U300_GPIO_PORT0;
}
+#define gpio_to_irq gpio_to_irq
static inline unsigned irq_to_gpio(unsigned irq)
{
diff --git a/arch/arm/mach-versatile/include/mach/gpio.h b/arch/arm/mach-versatile/include/mach/gpio.h
index bd11dc5..910974b 100644
--- a/arch/arm/mach-versatile/include/mach/gpio.h
+++ b/arch/arm/mach-versatile/include/mach/gpio.h
@@ -1,2 +1 @@
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h
index bd11dc5..910974b 100644
--- a/arch/arm/mach-vt8500/include/mach/gpio.h
+++ b/arch/arm/mach-vt8500/include/mach/gpio.h
@@ -1,2 +1 @@
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h
index 60c7846..e7d4ed1 100644
--- a/arch/arm/mach-w90x900/include/mach/gpio.h
+++ b/arch/arm/mach-w90x900/include/mach/gpio.h
@@ -22,6 +22,7 @@ static inline int gpio_to_irq(unsigned gpio)
{
return gpio;
}
+#define gpio_to_irq gpio_to_irq
static inline int irq_to_gpio(unsigned irq)
{
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h
index 569b2c6..395156a 100644
--- a/arch/arm/plat-nomadik/include/plat/gpio.h
+++ b/arch/arm/plat-nomadik/include/plat/gpio.h
@@ -13,7 +13,6 @@
#define __ASM_PLAT_GPIO_H
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
/*
* "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 20eedbb..f1fdfa5 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -224,11 +224,6 @@ extern void omap_gpio_restore_context(void);
#define __ARM_GPIOLIB_TRIVIAL
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
static inline int irq_to_gpio(unsigned irq)
{
int tmp;
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 71c4c6c..985c197 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -16,11 +16,6 @@
#define __ARM_GPIOLIB_TRIVIAL
/*
- * GENERIC_GPIO primitives.
- */
-#define gpio_to_irq __gpio_to_irq
-
-/*
* Orion-specific GPIO API extensions.
*/
void orion_gpio_set_unused(unsigned pin);
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h
index 3c6f044..22d9e0f 100644
--- a/arch/arm/plat-spear/include/plat/gpio.h
+++ b/arch/arm/plat-spear/include/plat/gpio.h
@@ -15,6 +15,5 @@
#define __PLAT_GPIO_H
#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_to_irq __gpio_to_irq
#endif /* __PLAT_GPIO_H */
--
1.7.4.4
^ permalink raw reply related
* [PATCH 11/13] ARM: gpio: consolidate trivial gpiolib implementations
From: Russell King - ARM Linux @ 2011-08-09 8:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Consolidate 24 trivial gpiolib implementions out of mach/gpio.h
into asm/gpio.h. This is basically the include of asm-generic/gpio.h
and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep
as described in Documentation/gpio.txt
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/gpio.h | 10 ++++++++++
arch/arm/mach-at91/include/mach/gpio.h | 5 +----
arch/arm/mach-ep93xx/include/mach/gpio.h | 7 +------
arch/arm/mach-exynos4/include/mach/gpio.h | 5 +----
arch/arm/mach-gemini/include/mach/gpio.h | 5 +----
arch/arm/mach-ks8695/include/mach/gpio.h | 11 ++---------
arch/arm/mach-lpc32xx/include/mach/gpio.h | 17 +----------------
arch/arm/mach-msm/include/mach/gpio.h | 5 +----
arch/arm/mach-mxs/include/mach/gpio.h | 6 +-----
arch/arm/mach-realview/include/mach/gpio.h | 6 +-----
arch/arm/mach-s3c2410/include/mach/gpio.h | 5 +----
arch/arm/mach-s3c64xx/include/mach/gpio.h | 6 +-----
arch/arm/mach-s5p64x0/include/mach/gpio.h | 6 +-----
arch/arm/mach-s5pc100/include/mach/gpio.h | 6 +-----
arch/arm/mach-s5pv210/include/mach/gpio.h | 6 +-----
arch/arm/mach-shmobile/include/mach/gpio.h | 15 +--------------
arch/arm/mach-tegra/include/mach/gpio.h | 6 +-----
arch/arm/mach-versatile/include/mach/gpio.h | 6 +-----
arch/arm/mach-vt8500/include/mach/gpio.h | 6 +-----
arch/arm/mach-w90x900/include/mach/gpio.h | 5 +----
arch/arm/plat-mxc/include/mach/gpio.h | 5 +----
arch/arm/plat-nomadik/include/plat/gpio.h | 11 +----------
arch/arm/plat-omap/include/plat/gpio.h | 15 +--------------
arch/arm/plat-orion/include/plat/gpio.h | 6 ++----
arch/arm/plat-spear/include/plat/gpio.h | 6 +-----
25 files changed, 36 insertions(+), 151 deletions(-)
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 166a7a3..15e8970 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -4,4 +4,14 @@
/* not all ARM platforms necessarily support this API ... */
#include <mach/gpio.h>
+#ifdef __ARM_GPIOLIB_TRIVIAL
+/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
+#include <asm-generic/gpio.h>
+
+/* The trivial gpiolib dispatchers */
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+#define gpio_cansleep __gpio_cansleep
+#endif
+
#endif /* _ARCH_ARM_GPIO_H */
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
index 056dc66..6ddc1a6 100644
--- a/arch/arm/mach-at91/include/mach/gpio.h
+++ b/arch/arm/mach-at91/include/mach/gpio.h
@@ -214,11 +214,8 @@ extern void at91_gpio_resume(void);
*/
#include <asm/errno.h>
-#include <asm-generic/gpio.h> /* cansleep wrappers */
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq(gpio) (gpio)
#define irq_to_gpio(irq) (irq)
diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h
index c57152c..fbc770e 100644
--- a/arch/arm/mach-ep93xx/include/mach/gpio.h
+++ b/arch/arm/mach-ep93xx/include/mach/gpio.h
@@ -100,12 +100,7 @@
#define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7)
/* new generic GPIO API - see Documentation/gpio.txt */
-
-#include <asm-generic/gpio.h>
-
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
/*
* Map GPIO A0..A7 (0..7) to irq 64..71,
diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h
index be9266b..b2e3595 100644
--- a/arch/arm/mach-exynos4/include/mach/gpio.h
+++ b/arch/arm/mach-exynos4/include/mach/gpio.h
@@ -13,9 +13,6 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
#define gpio_to_irq __gpio_to_irq
/* Practically, GPIO banks up to GPZ are the configurable gpio banks */
@@ -151,6 +148,6 @@ enum s5p_gpio_number {
#define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \
CONFIG_SAMSUNG_GPIO_EXTRA + 1)
-#include <asm-generic/gpio.h>
+#define __ARM_GPIOLIB_TRIVIAL
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-gemini/include/mach/gpio.h b/arch/arm/mach-gemini/include/mach/gpio.h
index 3bc2c70..20c0a36 100644
--- a/arch/arm/mach-gemini/include/mach/gpio.h
+++ b/arch/arm/mach-gemini/include/mach/gpio.h
@@ -13,11 +13,8 @@
#define __MACH_GPIO_H__
#include <mach/irqs.h>
-#include <asm-generic/gpio.h>
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE)
#define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE)
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h
index 86312d4..c13952c 100644
--- a/arch/arm/mach-ks8695/include/mach/gpio.h
+++ b/arch/arm/mach-ks8695/include/mach/gpio.h
@@ -40,17 +40,10 @@ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
*/
extern int irq_to_gpio(unsigned int irq);
-#include <asm-generic/gpio.h>
-
-/* If it turns out that we need to optimise GPIO access for the
- * Micrel's GPIOs, then these can be changed to check their argument
- * directly as static inlines. However for now it's probably not
- * worthwhile.
- */
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
#define gpio_to_irq __gpio_to_irq
+#define __ARM_GPIOLIB_TRIVIAL
+
/* Register the GPIOs */
extern void ks8695_register_gpios(void);
diff --git a/arch/arm/mach-lpc32xx/include/mach/gpio.h b/arch/arm/mach-lpc32xx/include/mach/gpio.h
index 67d03da..0ca6c27 100644
--- a/arch/arm/mach-lpc32xx/include/mach/gpio.h
+++ b/arch/arm/mach-lpc32xx/include/mach/gpio.h
@@ -19,8 +19,6 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H
-#include <asm-generic/gpio.h>
-
/*
* Note!
* Muxed GP pins need to be setup to the GP state in the board level
@@ -51,20 +49,7 @@
*/
#define LPC32XX_GPIO(x, y) ((x) + (y))
-static inline int gpio_get_value(unsigned gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned gpio)
-{
- return __gpio_cansleep(gpio);
-}
+#define __ARM_GPIOLIB_TRIVIAL
static inline int gpio_to_irq(unsigned gpio)
{
diff --git a/arch/arm/mach-msm/include/mach/gpio.h b/arch/arm/mach-msm/include/mach/gpio.h
index 36ad50d..bc75e20 100644
--- a/arch/arm/mach-msm/include/mach/gpio.h
+++ b/arch/arm/mach-msm/include/mach/gpio.h
@@ -16,11 +16,8 @@
#ifndef __ASM_ARCH_MSM_GPIO_H
#define __ASM_ARCH_MSM_GPIO_H
-#include <asm-generic/gpio.h>
+#define __ARM_GPIOLIB_TRIVIAL
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
#define gpio_to_irq __gpio_to_irq
#endif /* __ASM_ARCH_MSM_GPIO_H */
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h
index 828cccc..bb44c8d 100644
--- a/arch/arm/mach-mxs/include/mach/gpio.h
+++ b/arch/arm/mach-mxs/include/mach/gpio.h
@@ -20,14 +20,10 @@
#ifndef __MACH_MXS_GPIO_H__
#define __MACH_MXS_GPIO_H__
-#include <asm-generic/gpio.h>
-
#define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr))
/* use gpiolib dispatchers */
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
#define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START)
diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h
index 94ff276..bd11dc5 100644
--- a/arch/arm/mach-realview/include/mach/gpio.h
+++ b/arch/arm/mach-realview/include/mach/gpio.h
@@ -1,6 +1,2 @@
-#include <asm-generic/gpio.h>
-
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index f7f6b07..998ef4c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -11,9 +11,7 @@
* published by the Free Software Foundation.
*/
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
/* some boards require extra gpio capacity to support external
@@ -28,7 +26,6 @@
#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
#endif
-#include <asm-generic/gpio.h>
#include <mach/gpio-nrs.h>
#include <mach/gpio-fns.h>
diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h
index 0d46e99..6958b3f 100644
--- a/arch/arm/mach-s3c64xx/include/mach/gpio.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
@@ -12,9 +12,7 @@
* published by the Free Software Foundation.
*/
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
/* GPIO bank sizes */
@@ -96,5 +94,3 @@ enum s3c_gpio_number {
#define BOARD_NR_GPIOS 16
#define ARCH_NR_GPIOS (GPIO_BOARD_START + BOARD_NR_GPIOS)
-
-#include <asm-generic/gpio.h>
diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-s5p64x0/include/mach/gpio.h
index adb5f29..a25160b 100644
--- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
@@ -13,9 +13,7 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
/* GPIO bank sizes */
@@ -134,6 +132,4 @@ enum s5p6450_gpio_number {
#define ARCH_NR_GPIOS (S5P64X0_GPIO_END + CONFIG_SAMSUNG_GPIO_EXTRA)
-#include <asm-generic/gpio.h>
-
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h
index 29a8a12..f515bfb 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -15,9 +15,7 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
/* GPIO bank sizes */
@@ -146,6 +144,4 @@ enum s5p_gpio_number {
/* define the number of gpios we need to the one after the MP04() range */
#define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)
-#include <asm-generic/gpio.h>
-
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h
index a5a1e33..27f2139 100644
--- a/arch/arm/mach-s5pv210/include/mach/gpio.h
+++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
@@ -13,9 +13,7 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H __FILE__
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
/* Practically, GPIO banks up to MP03 are the configurable gpio banks */
@@ -142,6 +140,4 @@ enum s5p_gpio_number {
#define ARCH_NR_GPIOS (S5PV210_MP05(S5PV210_GPIO_MP05_NR) + \
CONFIG_SAMSUNG_GPIO_EXTRA + 1)
-#include <asm-generic/gpio.h>
-
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
index 2b1bb9e..e8feff0 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -18,20 +18,7 @@
#ifdef CONFIG_GPIOLIB
-static inline int gpio_get_value(unsigned gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned gpio)
-{
- return __gpio_cansleep(gpio);
-}
+#define __ARM_GPIOLIB_TRIVIAL
static inline int gpio_to_irq(unsigned gpio)
{
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
index 196f114..d51be09 100644
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ b/arch/arm/mach-tegra/include/mach/gpio.h
@@ -25,11 +25,7 @@
#define TEGRA_NR_GPIOS INT_GPIO_NR
-#include <asm-generic/gpio.h>
-
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio))
#define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE)
diff --git a/arch/arm/mach-versatile/include/mach/gpio.h b/arch/arm/mach-versatile/include/mach/gpio.h
index 94ff276..bd11dc5 100644
--- a/arch/arm/mach-versatile/include/mach/gpio.h
+++ b/arch/arm/mach-versatile/include/mach/gpio.h
@@ -1,6 +1,2 @@
-#include <asm-generic/gpio.h>
-
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h
index 94ff276..bd11dc5 100644
--- a/arch/arm/mach-vt8500/include/mach/gpio.h
+++ b/arch/arm/mach-vt8500/include/mach/gpio.h
@@ -1,6 +1,2 @@
-#include <asm-generic/gpio.h>
-
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h
index 034da3e..60c7846 100644
--- a/arch/arm/mach-w90x900/include/mach/gpio.h
+++ b/arch/arm/mach-w90x900/include/mach/gpio.h
@@ -15,11 +15,8 @@
#include <mach/hardware.h>
#include <asm/irq.h>
-#include <asm-generic/gpio.h>
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
static inline int gpio_to_irq(unsigned gpio)
{
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 31c820c..4398edd 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -21,7 +21,6 @@
#include <linux/spinlock.h>
#include <mach/hardware.h>
-#include <asm-generic/gpio.h>
/* There's a off-by-one betweem the gpio bank number and the gpiochip */
@@ -29,9 +28,7 @@
#define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr))
/* use gpiolib dispatchers */
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio))
#define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START)
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h
index d5d7e65..569b2c6 100644
--- a/arch/arm/plat-nomadik/include/plat/gpio.h
+++ b/arch/arm/plat-nomadik/include/plat/gpio.h
@@ -12,16 +12,7 @@
#ifndef __ASM_PLAT_GPIO_H
#define __ASM_PLAT_GPIO_H
-#include <asm-generic/gpio.h>
-
-/*
- * These currently cause a function call to happen, they may be optimized
- * if needed by adding cpu-specific defines to identify blocks
- * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc)
- */
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
/*
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 91e8de3..20eedbb 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -222,20 +222,7 @@ extern void omap_gpio_restore_context(void);
#include <linux/errno.h>
#include <asm-generic/gpio.h>
-static inline int gpio_get_value(unsigned gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned gpio)
-{
- return __gpio_cansleep(gpio);
-}
+#define __ARM_GPIOLIB_TRIVIAL
static inline int gpio_to_irq(unsigned gpio)
{
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 3075b9f..71c4c6c 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -12,14 +12,12 @@
#define __PLAT_GPIO_H
#include <linux/init.h>
-#include <asm-generic/gpio.h>
+
+#define __ARM_GPIOLIB_TRIVIAL
/*
* GENERIC_GPIO primitives.
*/
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
#define gpio_to_irq __gpio_to_irq
/*
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h
index b857c91..3c6f044 100644
--- a/arch/arm/plat-spear/include/plat/gpio.h
+++ b/arch/arm/plat-spear/include/plat/gpio.h
@@ -14,11 +14,7 @@
#ifndef __PLAT_GPIO_H
#define __PLAT_GPIO_H
-#include <asm-generic/gpio.h>
-
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
+#define __ARM_GPIOLIB_TRIVIAL
#define gpio_to_irq __gpio_to_irq
#endif /* __PLAT_GPIO_H */
--
1.7.4.4
^ permalink raw reply related
* [PATCH 10/13] ARM: gpio: pxa: convert drivers to use asm/gpio.h
From: Russell King - ARM Linux @ 2011-08-09 8:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/pcmcia/pxa2xx_vpac270.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pcmcia/pxa2xx_vpac270.c b/drivers/pcmcia/pxa2xx_vpac270.c
index e956f65..66ab92c 100644
--- a/drivers/pcmcia/pxa2xx_vpac270.c
+++ b/drivers/pcmcia/pxa2xx_vpac270.c
@@ -17,7 +17,7 @@
#include <asm/mach-types.h>
-#include <mach/gpio.h>
+#include <asm/gpio.h>
#include <mach/vpac270.h>
#include "soc_common.h"
--
1.7.4.4
^ permalink raw reply related
* [PATCH 09/13] ARM: gpio: tegra: convert drivers to use asm/gpio.h
From: Russell King - ARM Linux @ 2011-08-09 8:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/mmc/host/sdhci-tegra.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 18b0bd3..e9094f1 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -21,7 +21,7 @@
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
-#include <mach/gpio.h>
+#include <asm/gpio.h>
#include <mach/sdhci.h>
#include "sdhci-pltfm.h"
--
1.7.4.4
^ permalink raw reply related
* [PATCH 08/13] ARM: gpio: ixp2000: convert drivers to use asm/gpio.h
From: Russell King - ARM Linux @ 2011-08-09 8:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/i2c/busses/i2c-ixp2000.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-ixp2000.c b/drivers/i2c/busses/i2c-ixp2000.c
index 5d8aed5..be9991b 100644
--- a/drivers/i2c/busses/i2c-ixp2000.c
+++ b/drivers/i2c/busses/i2c-ixp2000.c
@@ -35,7 +35,7 @@
#include <linux/slab.h>
#include <mach/hardware.h> /* Pick up IXP2000-specific bits */
-#include <mach/gpio.h>
+#include <asm/gpio.h>
static inline int ixp2000_scl_pin(void *data)
{
--
1.7.4.4
^ permalink raw reply related
* [PATCH 07/13] ARM: gpio: pnx4008: convert drivers to use asm/gpio.h
From: Russell King - ARM Linux @ 2011-08-09 8:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/usb/host/ohci-pnx4008.c | 2 +-
drivers/video/pnx4008/sdum.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c
index 653d6a6..d1b4193 100644
--- a/drivers/usb/host/ohci-pnx4008.c
+++ b/drivers/usb/host/ohci-pnx4008.c
@@ -26,7 +26,7 @@
#include <mach/platform.h>
#include <mach/irqs.h>
-#include <mach/gpio.h>
+#include <asm/gpio.h>
#define USB_CTRL IO_ADDRESS(PNX4008_PWRMAN_BASE + 0x64)
diff --git a/drivers/video/pnx4008/sdum.c b/drivers/video/pnx4008/sdum.c
index 5ec4f2d..50e0039 100644
--- a/drivers/video/pnx4008/sdum.c
+++ b/drivers/video/pnx4008/sdum.c
@@ -30,7 +30,7 @@
#include <linux/clk.h>
#include <linux/gfp.h>
#include <asm/uaccess.h>
-#include <mach/gpio.h>
+#include <asm/gpio.h>
#include "sdum.h"
#include "fbcommon.h"
--
1.7.4.4
^ permalink raw reply related
* [PATCH 06/13] ARM: gpio: davinci: convert drivers to use asm/gpio.h
From: Russell King - ARM Linux @ 2011-08-09 8:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110809080411.GA1831@n2100.arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/usb/musb/davinci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 8bdf25a..f9a3f62 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -35,7 +35,7 @@
#include <mach/hardware.h>
#include <mach/memory.h>
-#include <mach/gpio.h>
+#include <asm/gpio.h>
#include <mach/cputype.h>
#include <asm/mach-types.h>
--
1.7.4.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox