linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It
@ 2010-03-02 16:05 Christian Pellegrin
  2010-03-02 16:11 ` christian pellegrin
  2010-03-02 21:54 ` [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It Ben Dooks
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Pellegrin @ 2010-03-02 16:05 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 arch/arm/mach-s3c2410/include/mach/gpio-core.h |    5 +++++
 arch/arm/mach-s3c2410/include/mach/gpio-nrs.h  |    4 ++++
 arch/arm/mach-s3c2410/include/mach/gpio.h      |    8 ++++++++
 arch/arm/plat-s3c/pm-gpio.c                    |    5 +++--
 arch/arm/plat-s3c24xx/gpiolib.c                |   16 +++++++++++++++-
 5 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index f8b879a..de9697c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -24,8 +24,13 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
 {
 	struct s3c_gpio_chip *chip;
 
+#ifdef CONFIG_CPU_S3C244X
+	if (pin > S3C2410_GPJ(15))
+		return NULL;
+#else
 	if (pin > S3C2410_GPG(10))
 		return NULL;
+#endif
 
 	chip = &s3c24xx_gpios[pin/32];
 	return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
index 2edbb9c..f1f32e2 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
@@ -24,6 +24,7 @@
 #define S3C2410_GPIO_BANKF   (32*5)
 #define S3C2410_GPIO_BANKG   (32*6)
 #define S3C2410_GPIO_BANKH   (32*7)
+#define S3C2410_GPIO_BANKJ   (32*8)
 
 /* GPIO bank sizes */
 #define S3C2410_GPIO_A_NR	(32)
@@ -34,6 +35,7 @@
 #define S3C2410_GPIO_F_NR	(32)
 #define S3C2410_GPIO_G_NR	(32)
 #define S3C2410_GPIO_H_NR	(32)
+#define S3C2410_GPIO_J_NR	(32)
 
 #if CONFIG_S3C_GPIO_SPACE != 0
 #error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment
@@ -53,6 +55,7 @@ enum s3c_gpio_number {
 	S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E),
 	S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F),
 	S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G),
+	S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H),
 };
 
 #endif /* __ASSEMBLY__ */
@@ -67,6 +70,7 @@ enum s3c_gpio_number {
 #define S3C2410_GPF(_nr)	(S3C2410_GPIO_F_START + (_nr))
 #define S3C2410_GPG(_nr)	(S3C2410_GPIO_G_START + (_nr))
 #define S3C2410_GPH(_nr)	(S3C2410_GPIO_H_START + (_nr))
+#define S3C2410_GPJ(_nr)	(S3C2410_GPIO_J_START + (_nr))
 
 /* compatibility until drivers can be modified */
 
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 15f0b3e..1528fc7 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -20,10 +20,18 @@
  * devices that need GPIO.
  */
 
+#ifdef CONFIG_CPU_S3C244X
+#define ARCH_NR_GPIOS	(32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
+#else
 #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>
 
+#ifdef CONFIG_CPU_S3C244X
+#define S3C_GPIO_END	(S3C2410_GPIO_BANKJ + 32)
+#else
 #define S3C_GPIO_END	(S3C2410_GPIO_BANKH + 32)
+#endif
diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
index cfd326a..8ef2c9d 100644
--- a/arch/arm/plat-s3c/pm-gpio.c
+++ b/arch/arm/plat-s3c/pm-gpio.c
@@ -20,6 +20,7 @@
 #include <linux/gpio.h>
 
 #include <mach/gpio-core.h>
+#include <mach/regs-gpioj.h>
 #include <plat/pm.h>
 
 /* PM GPIO helpers */
@@ -343,7 +344,7 @@ void s3c_pm_save_gpios(void)
 			  ourchip->pm_save[2],
 			  ourchip->pm_save[3]);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
@@ -374,7 +375,7 @@ void s3c_pm_restore_gpios(void)
 
 		s3c_pm_resume_gpio(ourchip);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
index 6d7a961..815b2b1 100644
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ b/arch/arm/plat-s3c24xx/gpiolib.c
@@ -26,6 +26,7 @@
 #include <plat/pm.h>
 
 #include <mach/regs-gpio.h>
+#include <mach/regs-gpioj.h>
 
 static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset)
 {
@@ -151,7 +152,8 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
 			.ngpio			= 16,
 			.to_irq			= s3c24xx_gpiolib_bankg_toirq,
 		},
-	}, {
+	},
+	[7] = {
 		.base	= S3C2410_GPHCON,
 		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
 		.chip	= {
@@ -161,6 +163,18 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
 			.ngpio			= 11,
 		},
 	},
+#ifdef CONFIG_CPU_S3C244X
+	[8] = {
+		.base	= S3C2440_GPJCON,
+		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
+		.chip	= {
+			.base			= S3C2410_GPJ(0),
+			.owner			= THIS_MODULE,
+			.label			= "GPIOJ",
+			.ngpio			= 13,
+		},
+	},
+#endif
 };
 
 static __init int s3c24xx_gpiolib_init(void)
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH resend v2.6.33] Fix support for banks H and J on S3C244X CPUs
  2010-03-02 16:11 ` christian pellegrin
@ 2010-03-02 16:11   ` Christian Pellegrin
  0 siblings, 0 replies; 17+ messages in thread
From: Christian Pellegrin @ 2010-03-02 16:11 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds support to gpiolib for GPIO bank J present on S3C244X
CPUs. It solves a bug causing bank H not being saved and restored during
suspend.

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 arch/arm/mach-s3c2410/include/mach/gpio-core.h |    5 +++++
 arch/arm/mach-s3c2410/include/mach/gpio-nrs.h  |    4 ++++
 arch/arm/mach-s3c2410/include/mach/gpio.h      |    8 ++++++++
 arch/arm/plat-s3c/pm-gpio.c                    |    5 +++--
 arch/arm/plat-s3c24xx/gpiolib.c                |   16 +++++++++++++++-
 5 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index f8b879a..de9697c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -24,8 +24,13 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
 {
 	struct s3c_gpio_chip *chip;
 
+#ifdef CONFIG_CPU_S3C244X
+	if (pin > S3C2410_GPJ(15))
+		return NULL;
+#else
 	if (pin > S3C2410_GPG(10))
 		return NULL;
+#endif
 
 	chip = &s3c24xx_gpios[pin/32];
 	return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
index 2edbb9c..f1f32e2 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
@@ -24,6 +24,7 @@
 #define S3C2410_GPIO_BANKF   (32*5)
 #define S3C2410_GPIO_BANKG   (32*6)
 #define S3C2410_GPIO_BANKH   (32*7)
+#define S3C2410_GPIO_BANKJ   (32*8)
 
 /* GPIO bank sizes */
 #define S3C2410_GPIO_A_NR	(32)
@@ -34,6 +35,7 @@
 #define S3C2410_GPIO_F_NR	(32)
 #define S3C2410_GPIO_G_NR	(32)
 #define S3C2410_GPIO_H_NR	(32)
+#define S3C2410_GPIO_J_NR	(32)
 
 #if CONFIG_S3C_GPIO_SPACE != 0
 #error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment
@@ -53,6 +55,7 @@ enum s3c_gpio_number {
 	S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E),
 	S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F),
 	S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G),
+	S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H),
 };
 
 #endif /* __ASSEMBLY__ */
@@ -67,6 +70,7 @@ enum s3c_gpio_number {
 #define S3C2410_GPF(_nr)	(S3C2410_GPIO_F_START + (_nr))
 #define S3C2410_GPG(_nr)	(S3C2410_GPIO_G_START + (_nr))
 #define S3C2410_GPH(_nr)	(S3C2410_GPIO_H_START + (_nr))
+#define S3C2410_GPJ(_nr)	(S3C2410_GPIO_J_START + (_nr))
 
 /* compatibility until drivers can be modified */
 
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 15f0b3e..1528fc7 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -20,10 +20,18 @@
  * devices that need GPIO.
  */
 
+#ifdef CONFIG_CPU_S3C244X
+#define ARCH_NR_GPIOS	(32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
+#else
 #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>
 
+#ifdef CONFIG_CPU_S3C244X
+#define S3C_GPIO_END	(S3C2410_GPIO_BANKJ + 32)
+#else
 #define S3C_GPIO_END	(S3C2410_GPIO_BANKH + 32)
+#endif
diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
index cfd326a..8ef2c9d 100644
--- a/arch/arm/plat-s3c/pm-gpio.c
+++ b/arch/arm/plat-s3c/pm-gpio.c
@@ -20,6 +20,7 @@
 #include <linux/gpio.h>
 
 #include <mach/gpio-core.h>
+#include <mach/regs-gpioj.h>
 #include <plat/pm.h>
 
 /* PM GPIO helpers */
@@ -343,7 +344,7 @@ void s3c_pm_save_gpios(void)
 			  ourchip->pm_save[2],
 			  ourchip->pm_save[3]);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
@@ -374,7 +375,7 @@ void s3c_pm_restore_gpios(void)
 
 		s3c_pm_resume_gpio(ourchip);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
index 6d7a961..815b2b1 100644
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ b/arch/arm/plat-s3c24xx/gpiolib.c
@@ -26,6 +26,7 @@
 #include <plat/pm.h>
 
 #include <mach/regs-gpio.h>
+#include <mach/regs-gpioj.h>
 
 static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset)
 {
@@ -151,7 +152,8 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
 			.ngpio			= 16,
 			.to_irq			= s3c24xx_gpiolib_bankg_toirq,
 		},
-	}, {
+	},
+	[7] = {
 		.base	= S3C2410_GPHCON,
 		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
 		.chip	= {
@@ -161,6 +163,18 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
 			.ngpio			= 11,
 		},
 	},
+#ifdef CONFIG_CPU_S3C244X
+	[8] = {
+		.base	= S3C2440_GPJCON,
+		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
+		.chip	= {
+			.base			= S3C2410_GPJ(0),
+			.owner			= THIS_MODULE,
+			.label			= "GPIOJ",
+			.ngpio			= 13,
+		},
+	},
+#endif
 };
 
 static __init int s3c24xx_gpiolib_init(void)
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It
  2010-03-02 16:05 [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It Christian Pellegrin
@ 2010-03-02 16:11 ` christian pellegrin
  2010-03-02 16:11   ` [PATCH resend v2.6.33] Fix support for banks H and J on S3C244X CPUs Christian Pellegrin
  2010-03-02 21:54 ` [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It Ben Dooks
  1 sibling, 1 reply; 17+ messages in thread
From: christian pellegrin @ 2010-03-02 16:11 UTC (permalink / raw)
  To: linux-arm-kernel

Sorry, blundered the description line. Sending a better one in
response to this mail.


-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It
  2010-03-02 16:05 [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It Christian Pellegrin
  2010-03-02 16:11 ` christian pellegrin
@ 2010-03-02 21:54 ` Ben Dooks
  2010-03-03  6:58   ` christian pellegrin
  1 sibling, 1 reply; 17+ messages in thread
From: Ben Dooks @ 2010-03-02 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 02, 2010 at 05:05:37PM +0100, Christian Pellegrin wrote:
> 
> Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
> ---
>  arch/arm/mach-s3c2410/include/mach/gpio-core.h |    5 +++++
>  arch/arm/mach-s3c2410/include/mach/gpio-nrs.h  |    4 ++++
>  arch/arm/mach-s3c2410/include/mach/gpio.h      |    8 ++++++++
>  arch/arm/plat-s3c/pm-gpio.c                    |    5 +++--
>  arch/arm/plat-s3c24xx/gpiolib.c                |   16 +++++++++++++++-
>  5 files changed, 35 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> index f8b879a..de9697c 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> @@ -24,8 +24,13 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
>  {
>  	struct s3c_gpio_chip *chip;
>  
> +#ifdef CONFIG_CPU_S3C244X
> +	if (pin > S3C2410_GPJ(15))
> +		return NULL;
> +#else
>  	if (pin > S3C2410_GPG(10))
>  		return NULL;
> +#endif
>  
>  	chip = &s3c24xx_gpios[pin/32];
>  	return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
> index 2edbb9c..f1f32e2 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
> @@ -24,6 +24,7 @@
>  #define S3C2410_GPIO_BANKF   (32*5)
>  #define S3C2410_GPIO_BANKG   (32*6)
>  #define S3C2410_GPIO_BANKH   (32*7)
> +#define S3C2410_GPIO_BANKJ   (32*8)
>  
>  /* GPIO bank sizes */
>  #define S3C2410_GPIO_A_NR	(32)
> @@ -34,6 +35,7 @@
>  #define S3C2410_GPIO_F_NR	(32)
>  #define S3C2410_GPIO_G_NR	(32)
>  #define S3C2410_GPIO_H_NR	(32)
> +#define S3C2410_GPIO_J_NR	(32)
>  
>  #if CONFIG_S3C_GPIO_SPACE != 0
>  #error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment
> @@ -53,6 +55,7 @@ enum s3c_gpio_number {
>  	S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E),
>  	S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F),
>  	S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G),
> +	S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H),
>  };
>  
>  #endif /* __ASSEMBLY__ */
> @@ -67,6 +70,7 @@ enum s3c_gpio_number {
>  #define S3C2410_GPF(_nr)	(S3C2410_GPIO_F_START + (_nr))
>  #define S3C2410_GPG(_nr)	(S3C2410_GPIO_G_START + (_nr))
>  #define S3C2410_GPH(_nr)	(S3C2410_GPIO_H_START + (_nr))
> +#define S3C2410_GPJ(_nr)	(S3C2410_GPIO_J_START + (_nr))
>  
>  /* compatibility until drivers can be modified */
>  
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
> index 15f0b3e..1528fc7 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
> @@ -20,10 +20,18 @@
>   * devices that need GPIO.
>   */
>  
> +#ifdef CONFIG_CPU_S3C244X
> +#define ARCH_NR_GPIOS	(32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
> +#else
>  #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>
>  
> +#ifdef CONFIG_CPU_S3C244X
> +#define S3C_GPIO_END	(S3C2410_GPIO_BANKJ + 32)
> +#else
>  #define S3C_GPIO_END	(S3C2410_GPIO_BANKH + 32)
> +#endif
> diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
> index cfd326a..8ef2c9d 100644
> --- a/arch/arm/plat-s3c/pm-gpio.c
> +++ b/arch/arm/plat-s3c/pm-gpio.c
> @@ -20,6 +20,7 @@
>  #include <linux/gpio.h>
>  
>  #include <mach/gpio-core.h>
> +#include <mach/regs-gpioj.h>
>  #include <plat/pm.h>
>  
>  /* PM GPIO helpers */
> @@ -343,7 +344,7 @@ void s3c_pm_save_gpios(void)
>  			  ourchip->pm_save[2],
>  			  ourchip->pm_save[3]);
>  
> -		gpio_nr += ourchip->chip.ngpio;
> +		gpio_nr += ourchip->chip.ngpio - 1;

This seems to be a seperate fix to the original change.

>  		gpio_nr += CONFIG_S3C_GPIO_SPACE;
>  	}
>  }
> @@ -374,7 +375,7 @@ void s3c_pm_restore_gpios(void)
>  
>  		s3c_pm_resume_gpio(ourchip);
>  
> -		gpio_nr += ourchip->chip.ngpio;
> +		gpio_nr += ourchip->chip.ngpio - 1;
>  		gpio_nr += CONFIG_S3C_GPIO_SPACE;
>  	}
>  }

and again.

> diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
> index 6d7a961..815b2b1 100644
> --- a/arch/arm/plat-s3c24xx/gpiolib.c
> +++ b/arch/arm/plat-s3c24xx/gpiolib.c
> @@ -26,6 +26,7 @@
>  #include <plat/pm.h>
>  
>  #include <mach/regs-gpio.h>
> +#include <mach/regs-gpioj.h>
>  
>  static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset)
>  {
> @@ -151,7 +152,8 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
>  			.ngpio			= 16,
>  			.to_irq			= s3c24xx_gpiolib_bankg_toirq,
>  		},
> -	}, {
> +	},
> +	[7] = {
>  		.base	= S3C2410_GPHCON,
>  		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
>  		.chip	= {
> @@ -161,6 +163,18 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
>  			.ngpio			= 11,
>  		},
>  	},
> +#ifdef CONFIG_CPU_S3C244X
> +	[8] = {
> +		.base	= S3C2440_GPJCON,
> +		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
> +		.chip	= {
> +			.base			= S3C2410_GPJ(0),
> +			.owner			= THIS_MODULE,
> +			.label			= "GPIOJ",
> +			.ngpio			= 13,
> +		},
> +	},
> +#endif
>  };

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It
  2010-03-02 21:54 ` [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It Ben Dooks
@ 2010-03-03  6:58   ` christian pellegrin
  2010-03-03  7:00     ` [PATCH] Adds support for banks H and J on S3C244X CPUs Christian Pellegrin
  2010-03-03  7:00     ` [PATCH] Fix GPIOs bank H and J not being preserved during suspend Christian Pellegrin
  0 siblings, 2 replies; 17+ messages in thread
From: christian pellegrin @ 2010-03-03  6:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 2, 2010 at 10:54 PM, Ben Dooks <ben-linux@fluff.org> wrote:

>
> and again.
>

ack, I will split this patch in 2 separate ones and send them in
response to this mail. Thanks.


-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] Adds support for banks H and J on S3C244X CPUs
  2010-03-03  6:58   ` christian pellegrin
@ 2010-03-03  7:00     ` Christian Pellegrin
  2010-03-03  8:24       ` omap gpio help doron
  2010-03-03  7:00     ` [PATCH] Fix GPIOs bank H and J not being preserved during suspend Christian Pellegrin
  1 sibling, 1 reply; 17+ messages in thread
From: Christian Pellegrin @ 2010-03-03  7:00 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds support to gpiolib for GPIO bank J present on S3C244X
CPUs.

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 arch/arm/mach-s3c2410/include/mach/gpio-nrs.h |    4 ++++
 arch/arm/mach-s3c2410/include/mach/gpio.h     |    8 ++++++++
 arch/arm/plat-s3c24xx/gpiolib.c               |   16 +++++++++++++++-
 3 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
index 2edbb9c..f1f32e2 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
@@ -24,6 +24,7 @@
 #define S3C2410_GPIO_BANKF   (32*5)
 #define S3C2410_GPIO_BANKG   (32*6)
 #define S3C2410_GPIO_BANKH   (32*7)
+#define S3C2410_GPIO_BANKJ   (32*8)
 
 /* GPIO bank sizes */
 #define S3C2410_GPIO_A_NR	(32)
@@ -34,6 +35,7 @@
 #define S3C2410_GPIO_F_NR	(32)
 #define S3C2410_GPIO_G_NR	(32)
 #define S3C2410_GPIO_H_NR	(32)
+#define S3C2410_GPIO_J_NR	(32)
 
 #if CONFIG_S3C_GPIO_SPACE != 0
 #error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment
@@ -53,6 +55,7 @@ enum s3c_gpio_number {
 	S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E),
 	S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F),
 	S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G),
+	S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H),
 };
 
 #endif /* __ASSEMBLY__ */
@@ -67,6 +70,7 @@ enum s3c_gpio_number {
 #define S3C2410_GPF(_nr)	(S3C2410_GPIO_F_START + (_nr))
 #define S3C2410_GPG(_nr)	(S3C2410_GPIO_G_START + (_nr))
 #define S3C2410_GPH(_nr)	(S3C2410_GPIO_H_START + (_nr))
+#define S3C2410_GPJ(_nr)	(S3C2410_GPIO_J_START + (_nr))
 
 /* compatibility until drivers can be modified */
 
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 15f0b3e..1528fc7 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -20,10 +20,18 @@
  * devices that need GPIO.
  */
 
+#ifdef CONFIG_CPU_S3C244X
+#define ARCH_NR_GPIOS	(32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
+#else
 #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>
 
+#ifdef CONFIG_CPU_S3C244X
+#define S3C_GPIO_END	(S3C2410_GPIO_BANKJ + 32)
+#else
 #define S3C_GPIO_END	(S3C2410_GPIO_BANKH + 32)
+#endif
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
index 6d7a961..815b2b1 100644
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ b/arch/arm/plat-s3c24xx/gpiolib.c
@@ -26,6 +26,7 @@
 #include <plat/pm.h>
 
 #include <mach/regs-gpio.h>
+#include <mach/regs-gpioj.h>
 
 static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset)
 {
@@ -151,7 +152,8 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
 			.ngpio			= 16,
 			.to_irq			= s3c24xx_gpiolib_bankg_toirq,
 		},
-	}, {
+	},
+	[7] = {
 		.base	= S3C2410_GPHCON,
 		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
 		.chip	= {
@@ -161,6 +163,18 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
 			.ngpio			= 11,
 		},
 	},
+#ifdef CONFIG_CPU_S3C244X
+	[8] = {
+		.base	= S3C2440_GPJCON,
+		.pm	= __gpio_pm(&s3c_gpio_pm_2bit),
+		.chip	= {
+			.base			= S3C2410_GPJ(0),
+			.owner			= THIS_MODULE,
+			.label			= "GPIOJ",
+			.ngpio			= 13,
+		},
+	},
+#endif
 };
 
 static __init int s3c24xx_gpiolib_init(void)
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-03  6:58   ` christian pellegrin
  2010-03-03  7:00     ` [PATCH] Adds support for banks H and J on S3C244X CPUs Christian Pellegrin
@ 2010-03-03  7:00     ` Christian Pellegrin
  2010-03-04 23:21       ` Ben Dooks
  1 sibling, 1 reply; 17+ messages in thread
From: Christian Pellegrin @ 2010-03-03  7:00 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds bank H and J GPIOs (present on S3C244X CPUs) to the list
of registers that must be saved/resumed during suspend.

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 arch/arm/mach-s3c2410/include/mach/gpio-core.h |    5 +++++
 arch/arm/plat-s3c/pm-gpio.c                    |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index f8b879a..de9697c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -24,8 +24,13 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
 {
 	struct s3c_gpio_chip *chip;
 
+#ifdef CONFIG_CPU_S3C244X
+	if (pin > S3C2410_GPJ(15))
+		return NULL;
+#else
 	if (pin > S3C2410_GPG(10))
 		return NULL;
+#endif
 
 	chip = &s3c24xx_gpios[pin/32];
 	return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
index cfd326a..b3cc8db 100644
--- a/arch/arm/plat-s3c/pm-gpio.c
+++ b/arch/arm/plat-s3c/pm-gpio.c
@@ -343,7 +343,7 @@ void s3c_pm_save_gpios(void)
 			  ourchip->pm_save[2],
 			  ourchip->pm_save[3]);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
@@ -374,7 +374,7 @@ void s3c_pm_restore_gpios(void)
 
 		s3c_pm_resume_gpio(ourchip);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* omap gpio help
  2010-03-03  7:00     ` [PATCH] Adds support for banks H and J on S3C244X CPUs Christian Pellegrin
@ 2010-03-03  8:24       ` doron
  0 siblings, 0 replies; 17+ messages in thread
From: doron @ 2010-03-03  8:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all
My System is :Kernel 2.6.22.18 omap mistral
I wrote an driver  to the activation of " GPIO " according to the kernel
instructions (gpio.txt) and when I request to free the GPIO I receive always
that the GPIO is reserved .
What the required steps in order to toggle the GPIO MUXED and not MUXED

Regards  Doron Sandroy

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-03  7:00     ` [PATCH] Fix GPIOs bank H and J not being preserved during suspend Christian Pellegrin
@ 2010-03-04 23:21       ` Ben Dooks
  2010-03-08 11:17         ` christian pellegrin
  0 siblings, 1 reply; 17+ messages in thread
From: Ben Dooks @ 2010-03-04 23:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 03, 2010 at 08:00:37AM +0100, Christian Pellegrin wrote:
> This patch adds bank H and J GPIOs (present on S3C244X CPUs) to the list
> of registers that must be saved/resumed during suspend.
> 
> Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
> ---
>  arch/arm/mach-s3c2410/include/mach/gpio-core.h |    5 +++++
>  arch/arm/plat-s3c/pm-gpio.c                    |    4 ++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> index f8b879a..de9697c 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> @@ -24,8 +24,13 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
>  {
>  	struct s3c_gpio_chip *chip;
>  
> +#ifdef CONFIG_CPU_S3C244X
> +	if (pin > S3C2410_GPJ(15))
> +		return NULL;
> +#else

Hmm, could we use the arch define for number of GPIOs here instead
of an ifdef?

  	if (pin > S3C2410_GPG(10))
>  		return NULL;
> +#endif
>  
>  	chip = &s3c24xx_gpios[pin/32];
>  	return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
> diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
> index cfd326a..b3cc8db 100644
> --- a/arch/arm/plat-s3c/pm-gpio.c
> +++ b/arch/arm/plat-s3c/pm-gpio.c
> @@ -343,7 +343,7 @@ void s3c_pm_save_gpios(void)
>  			  ourchip->pm_save[2],
>  			  ourchip->pm_save[3]);
>  
> -		gpio_nr += ourchip->chip.ngpio;
> +		gpio_nr += ourchip->chip.ngpio - 1;
>  		gpio_nr += CONFIG_S3C_GPIO_SPACE;
>  	}
>  }
> @@ -374,7 +374,7 @@ void s3c_pm_restore_gpios(void)
>  
>  		s3c_pm_resume_gpio(ourchip);
>  
> -		gpio_nr += ourchip->chip.ngpio;
> +		gpio_nr += ourchip->chip.ngpio - 1;
>  		gpio_nr += CONFIG_S3C_GPIO_SPACE;
>  	}
>  }
> -- 
> 1.5.6.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-04 23:21       ` Ben Dooks
@ 2010-03-08 11:17         ` christian pellegrin
  2010-03-08 11:21           ` [PATCH v2] " Christian Pellegrin
  0 siblings, 1 reply; 17+ messages in thread
From: christian pellegrin @ 2010-03-08 11:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 5, 2010 at 12:21 AM, Ben Dooks <ben-linux@fluff.org> wrote:

>> +#ifdef CONFIG_CPU_S3C244X
>> + ? ? if (pin > S3C2410_GPJ(15))
>> + ? ? ? ? ? ? return NULL;
>> +#else
>
> Hmm, could we use the arch define for number of GPIOs here instead
> of an ifdef?
>


ack, good idea. I'm sending the new patchi in response to this. Tested
on s3c2440 custom board.

-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-08 11:17         ` christian pellegrin
@ 2010-03-08 11:21           ` Christian Pellegrin
  2010-03-08 15:55             ` Ben Dooks
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Pellegrin @ 2010-03-08 11:21 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds bank H and J GPIOs (present on S3C244X CPUs) to the list
of registers that must be saved/resumed during suspend.

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 arch/arm/mach-s3c2410/include/mach/gpio-core.h |    2 +-
 arch/arm/plat-s3c/pm-gpio.c                    |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index f8b879a..7c33ecf 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -24,7 +24,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
 {
 	struct s3c_gpio_chip *chip;
 
-	if (pin > S3C2410_GPG(10))
+	if (pin > S3C_GPIO_END)
 		return NULL;
 
 	chip = &s3c24xx_gpios[pin/32];
diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
index cfd326a..b3cc8db 100644
--- a/arch/arm/plat-s3c/pm-gpio.c
+++ b/arch/arm/plat-s3c/pm-gpio.c
@@ -343,7 +343,7 @@ void s3c_pm_save_gpios(void)
 			  ourchip->pm_save[2],
 			  ourchip->pm_save[3]);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
@@ -374,7 +374,7 @@ void s3c_pm_restore_gpios(void)
 
 		s3c_pm_resume_gpio(ourchip);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-08 11:21           ` [PATCH v2] " Christian Pellegrin
@ 2010-03-08 15:55             ` Ben Dooks
  2010-03-08 16:14               ` christian pellegrin
  0 siblings, 1 reply; 17+ messages in thread
From: Ben Dooks @ 2010-03-08 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 08, 2010 at 12:21:28PM +0100, Christian Pellegrin wrote:
> This patch adds bank H and J GPIOs (present on S3C244X CPUs) to the list
> of registers that must be saved/resumed during suspend.
> 
> Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
> ---
>  arch/arm/mach-s3c2410/include/mach/gpio-core.h |    2 +-
>  arch/arm/plat-s3c/pm-gpio.c                    |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> index f8b879a..7c33ecf 100644
> --- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> +++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
> @@ -24,7 +24,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
>  {
>  	struct s3c_gpio_chip *chip;
>  
> -	if (pin > S3C2410_GPG(10))
> +	if (pin > S3C_GPIO_END)
>  		return NULL;
>  
>  	chip = &s3c24xx_gpios[pin/32];
> diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
> index cfd326a..b3cc8db 100644
> --- a/arch/arm/plat-s3c/pm-gpio.c
> +++ b/arch/arm/plat-s3c/pm-gpio.c
> @@ -343,7 +343,7 @@ void s3c_pm_save_gpios(void)
>  			  ourchip->pm_save[2],
>  			  ourchip->pm_save[3]);
>  
> -		gpio_nr += ourchip->chip.ngpio;
> +		gpio_nr += ourchip->chip.ngpio - 1;
>  		gpio_nr += CONFIG_S3C_GPIO_SPACE;
>  	}
>  }
> @@ -374,7 +374,7 @@ void s3c_pm_restore_gpios(void)
>  
>  		s3c_pm_resume_gpio(ourchip);
>  
> -		gpio_nr += ourchip->chip.ngpio;
> +		gpio_nr += ourchip->chip.ngpio - 1;
>  		gpio_nr += CONFIG_S3C_GPIO_SPACE;
>  	}
>  }

Still not getting why you're changing this from x, to x - 1.

> 1.5.6.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-08 15:55             ` Ben Dooks
@ 2010-03-08 16:14               ` christian pellegrin
  2010-03-08 16:16                 ` Ben Dooks
  0 siblings, 1 reply; 17+ messages in thread
From: christian pellegrin @ 2010-03-08 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 8, 2010 at 4:55 PM, Ben Dooks <ben-linux@fluff.org> wrote:
>
> Still not getting why you're changing this from x, to x - 1.
>

ok: the reason is that gpio_nr is already incremented by one in the
for instruction. So gpio_nr is not pointing to the first pin of a bank
after the first iteration. Of course this doesn't matter because we
don't have 32 banks of gpio pins and s3c_gpiolib_getchip works even if
we point to a pin in the middle of a bank. But if we get a s3c device
with more than 32 banks the 33rd will be skipped. Or at least this is
the reason why I did this, maybe I'm mistaken.

Anyway this is a minor point, I fixed it when catching why bank H was
not preserved (and so my serial console ttyS1 was dead).

-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-08 16:14               ` christian pellegrin
@ 2010-03-08 16:16                 ` Ben Dooks
  2010-03-12  7:25                   ` christian pellegrin
  0 siblings, 1 reply; 17+ messages in thread
From: Ben Dooks @ 2010-03-08 16:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 08, 2010 at 05:14:05PM +0100, christian pellegrin wrote:
> On Mon, Mar 8, 2010 at 4:55 PM, Ben Dooks <ben-linux@fluff.org> wrote:
> >
> > Still not getting why you're changing this from x, to x - 1.
> >
> 
> ok: the reason is that gpio_nr is already incremented by one in the
> for instruction. So gpio_nr is not pointing to the first pin of a bank
> after the first iteration. Of course this doesn't matter because we
> don't have 32 banks of gpio pins and s3c_gpiolib_getchip works even if
> we point to a pin in the middle of a bank. But if we get a s3c device
> with more than 32 banks the 33rd will be skipped. Or at least this is
> the reason why I did this, maybe I'm mistaken.
> 
> Anyway this is a minor point, I fixed it when catching why bank H was
> not preserved (and so my serial console ttyS1 was dead).

Can we have that as a seperate patch with that information in it, to show
what is being changed. Thanks.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2] Fix GPIOs bank H and J not being preserved during suspend
  2010-03-08 16:16                 ` Ben Dooks
@ 2010-03-12  7:25                   ` christian pellegrin
  2010-03-12  7:28                     ` [PATCH v2] Fix GPIOs banks " Christian Pellegrin
  2010-03-12  7:29                     ` [PATCH v2] Fix one-too-much bug when building list of regs to be preserved on PM Christian Pellegrin
  0 siblings, 2 replies; 17+ messages in thread
From: christian pellegrin @ 2010-03-12  7:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 8, 2010 at 5:16 PM, Ben Dooks <ben-linux@fluff.org> wrote:

> Can we have that as a seperate patch with that information in it, to show
> what is being changed. Thanks.
>

ack, the patches in-reply-to to this email. Thanks.


-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2] Fix GPIOs banks not being preserved during suspend
  2010-03-12  7:25                   ` christian pellegrin
@ 2010-03-12  7:28                     ` Christian Pellegrin
  2010-03-12  7:29                     ` [PATCH v2] Fix one-too-much bug when building list of regs to be preserved on PM Christian Pellegrin
  1 sibling, 0 replies; 17+ messages in thread
From: Christian Pellegrin @ 2010-03-12  7:28 UTC (permalink / raw)
  To: linux-arm-kernel

This patch corrects the list of registers that must be saved/resumed
during suspend.

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 arch/arm/mach-s3c2410/include/mach/gpio-core.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index f8b879a..7c33ecf 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -24,7 +24,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
 {
 	struct s3c_gpio_chip *chip;
 
-	if (pin > S3C2410_GPG(10))
+	if (pin > S3C_GPIO_END)
 		return NULL;
 
 	chip = &s3c24xx_gpios[pin/32];
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2] Fix one-too-much bug when building list of regs to be preserved on PM
  2010-03-12  7:25                   ` christian pellegrin
  2010-03-12  7:28                     ` [PATCH v2] Fix GPIOs banks " Christian Pellegrin
@ 2010-03-12  7:29                     ` Christian Pellegrin
  1 sibling, 0 replies; 17+ messages in thread
From: Christian Pellegrin @ 2010-03-12  7:29 UTC (permalink / raw)
  To: linux-arm-kernel

gpio_nr is already incremented in the for loop, so if we will have 32
banks of GPIOs someday the 33rd won't be saved/restored during PM

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 arch/arm/plat-s3c/pm-gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-s3c/pm-gpio.c
index cfd326a..b3cc8db 100644
--- a/arch/arm/plat-s3c/pm-gpio.c
+++ b/arch/arm/plat-s3c/pm-gpio.c
@@ -343,7 +343,7 @@ void s3c_pm_save_gpios(void)
 			  ourchip->pm_save[2],
 			  ourchip->pm_save[3]);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
@@ -374,7 +374,7 @@ void s3c_pm_restore_gpios(void)
 
 		s3c_pm_resume_gpio(ourchip);
 
-		gpio_nr += ourchip->chip.ngpio;
+		gpio_nr += ourchip->chip.ngpio - 1;
 		gpio_nr += CONFIG_S3C_GPIO_SPACE;
 	}
 }
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-03-12  7:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-02 16:05 [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It Christian Pellegrin
2010-03-02 16:11 ` christian pellegrin
2010-03-02 16:11   ` [PATCH resend v2.6.33] Fix support for banks H and J on S3C244X CPUs Christian Pellegrin
2010-03-02 21:54 ` [PATCH] This patch adds support for GPIO bank J present on S3C244X CPUs. It Ben Dooks
2010-03-03  6:58   ` christian pellegrin
2010-03-03  7:00     ` [PATCH] Adds support for banks H and J on S3C244X CPUs Christian Pellegrin
2010-03-03  8:24       ` omap gpio help doron
2010-03-03  7:00     ` [PATCH] Fix GPIOs bank H and J not being preserved during suspend Christian Pellegrin
2010-03-04 23:21       ` Ben Dooks
2010-03-08 11:17         ` christian pellegrin
2010-03-08 11:21           ` [PATCH v2] " Christian Pellegrin
2010-03-08 15:55             ` Ben Dooks
2010-03-08 16:14               ` christian pellegrin
2010-03-08 16:16                 ` Ben Dooks
2010-03-12  7:25                   ` christian pellegrin
2010-03-12  7:28                     ` [PATCH v2] Fix GPIOs banks " Christian Pellegrin
2010-03-12  7:29                     ` [PATCH v2] Fix one-too-much bug when building list of regs to be preserved on PM Christian Pellegrin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).