Skip to contentSkip to conversation

ARM: S3C64XX: Update for conversion to SAMSUNG_GPIO_EXTRA

PATCH New Mark Brown 2 participants 8 messages Oct 31, 2011 – Nov 4, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/3 ARM: S3C64XX: Update for conversion to SAMSUNG_GPIO_EXTRA

The conversion of the S3C64XX GPIOs to the generic Samsung GPIOs mean that rather than using the previous S3C24XX_GPIO_EXTRA configuration the driver now uses SAMSUNG_GPIO_EXTRA.

Since SAMSUNG_GPIO_EXTRA requires the arch to include the extra space in ARCH_NR_GPIOs add it on to BOARD_NR_GPIOs (in case boards are relying on the existing reservation).

---
 arch/arm/mach-s3c64xx/include/mach/gpio.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-s3c64xx/include/mach/gpio.h +1 -1
index 6e34c2f..090c497 100644
@@ -88,6 +88,6 @@ enum s3c_gpio_number {
 /* define the number of gpios we need to the one after the GPQ() range */
 #define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1)
 
-#define BOARD_NR_GPIOS 16
+#define BOARD_NR_GPIOS (16 + CONFIG_SAMSUNG_GPIO_EXTRA)
 
 #define ARCH_NR_GPIOS	(GPIO_BOARD_START + BOARD_NR_GPIOS)
Signature · 1 line
1.7.7.1
author
#1 lore raw

PATCH 2/3 ARM: SAMSUNG: Fix GPIO space reservation for S3C64xx platforms

The conversion to use SAMSUNG_GPIO_EXTRA rather than S3C24XX_GPIO_EXTRA broke a number of S3C64xx boards which had been using the symbols provided to reserve a range of GPIOs for board specific use. Fix this by adding equivalent symbols for the new shared driver and updating the relevant boards to use the new symbols.

---
 arch/arm/mach-s3c64xx/Kconfig |    6 +++---
 arch/arm/plat-samsung/Kconfig |    8 ++++++++
 2 files changed, 11 insertions(+), 3 deletions(-)
arch/arm/mach-s3c64xx/Kconfig +3 -3
index 5552e04..4d8c489 100644
@@ -188,7 +188,7 @@ config SMDK6410_WM1190_EV1
 	depends on MACH_SMDK6410
 	select REGULATOR
 	select REGULATOR_WM8350
-	select S3C24XX_GPIO_EXTRA64
+	select SAMSUNG_GPIO_EXTRA64
 	select MFD_WM8350_I2C
 	select MFD_WM8350_CONFIG_MODE_0
 	select MFD_WM8350_CONFIG_MODE_3
@@ -206,7 +206,7 @@ config SMDK6410_WM1192_EV1
 	depends on MACH_SMDK6410
 	select REGULATOR
 	select REGULATOR_WM831X
-	select S3C24XX_GPIO_EXTRA64
+	select SAMSUNG_GPIO_EXTRA64
 	select MFD_WM831X
 	select MFD_WM831X_I2C
 	help
@@ -287,7 +287,7 @@ config MACH_WLF_CRAGG_6410
 	select S3C_DEV_WDT
 	select S3C_DEV_RTC
 	select S3C64XX_DEV_SPI
-	select S3C24XX_GPIO_EXTRA128
+	select SAMSUNG_GPIO_EXTRA128
 	select I2C
 	help
 	  Machine support for the Wolfson Cragganmore S3C6410 variant.
arch/arm/plat-samsung/Kconfig +8 -0
index 313eb26..bb0af66 100644
@@ -88,12 +88,20 @@ config S5P_GPIO_DRVSTR
 
 config SAMSUNG_GPIO_EXTRA
 	int "Number of additional GPIO pins"
+	default 128 if SAMSUNG_GPIO_EXTRA128
+	default 64 if SAMSUNG_GPIO_EXTRA64
 	default 0
 	help
 	  Use additional GPIO space in addition to the GPIO's the SOC
 	  provides. This allows expanding the GPIO space for use with
 	  GPIO expanders.
 
+config SAMSUNG_GPIO_EXTRA64
+	bool
+
+config SAMSUNG_GPIO_EXTRA128
+	bool
+
 config S3C_GPIO_SPACE
 	int "Space between gpio banks"
 	default 0
Signature · 1 line
1.7.7.1
author
#2 lore raw

PATCH 3/3 ARM: S3C64XX: Correct reservation of GPIOs for CPU module on Cragganmore

In reply to Mark Brown

The gpio_base for the PMIC on the CPU module was being incorrectly set to be the same as that for the CODEC causing the two GPIO drivers to collide.

---
 arch/arm/mach-s3c64xx/mach-crag6410.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-s3c64xx/mach-crag6410.c +2 -1
index 3903d86..03eb475 100644
@@ -74,6 +74,7 @@
 #define PCA935X_GPIO_BASE		GPIO_BOARD_START
 #define CODEC_GPIO_BASE		(GPIO_BOARD_START + 8)
 #define GLENFARCLAS_PMIC_GPIO_BASE	(GPIO_BOARD_START + 16)
+#define BANFF_PMIC_GPIO_BASE		(GLENFARCLAS_PMIC_GPIO_BASE + 16)
 
 /* serial port setup */
 
@@ -509,7 +510,7 @@ static struct wm831x_touch_pdata touch_pdata __initdata = {
 static struct wm831x_pdata crag_pmic_pdata __initdata = {
 	.wm831x_num = 1,
 	.irq_base = BANFF_PMIC_IRQ_BASE,
-	.gpio_base = GPIO_BOARD_START + 8,
+	.gpio_base = BANFF_PMIC_GPIO_BASE,
 	.soft_shutdown = true,
 
 	.backup = &banff_backup_pdata,
Signature · 1 line
1.7.7.1
#6 lore raw

PATCH 1/3 ARM: S3C64XX: Update for conversion to SAMSUNG_GPIO_EXTRA

In reply to Mark Brown
Quoted 28 lines · Mark Brown

The conversion of the S3C64XX GPIOs to the generic Samsung GPIOs mean that rather than using the previous S3C24XX_GPIO_EXTRA configuration the driver now uses SAMSUNG_GPIO_EXTRA.

Since SAMSUNG_GPIO_EXTRA requires the arch to include the extra space in ARCH_NR_GPIOs add it on to BOARD_NR_GPIOs (in case boards are relying on the existing reservation).

---
 arch/arm/mach-s3c64xx/include/mach/gpio.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-s3c64xx/include/mach/gpio.h +0 -0

s3c64xx/include/mach/gpio.h
index 6e34c2f..090c497 100644

arch/arm/mach-s3c64xx/include/mach/gpio.h +1 -2
@@ -88,6 +88,6 @@ enum s3c_gpio_number {
 /* define the number of gpios we need to the one after the GPQ() range */
 #define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1)
 
-#define BOARD_NR_GPIOS 16
+#define BOARD_NR_GPIOS (16 + CONFIG_SAMSUNG_GPIO_EXTRA)
 
 #define ARCH_NR_GPIOS	(GPIO_BOARD_START + BOARD_NR_GPIOS)
--
Quoted 1 line

1.7.7.1

Yes, agree. BTW, what's the 'v3.1' in title?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#7 lore raw

PATCH 1/3 ARM: S3C64XX: Update for conversion to SAMSUNG_GPIO_EXTRA

Quoted 1 line · Kukjin Kim

Yes, agree. BTW, what's the 'v3.1' in title?

A thinko for 3.2, sorry.

#3 lore raw

PATCH 3/3 ARM: S3C64XX: Correct reservation of GPIOs for CPU module on Cragganmore

In reply to Mark Brown
Quoted 15 lines · Mark Brown

The gpio_base for the PMIC on the CPU module was being incorrectly set to be the same as that for the CODEC causing the two GPIO drivers to collide.

---
 arch/arm/mach-s3c64xx/mach-crag6410.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-s3c64xx/mach-crag6410.c +0 -0

s3c64xx/mach-crag6410.c
index 3903d86..03eb475 100644

arch/arm/mach-s3c64xx/mach-crag6410.c line 79

Quoted 6 lines
arch/arm/mach-s3c64xx/mach-crag6410.c +1 -0
@@ -74,6 +74,7 @@
 #define PCA935X_GPIO_BASE		GPIO_BOARD_START
 #define CODEC_GPIO_BASE		(GPIO_BOARD_START + 8)
 #define GLENFARCLAS_PMIC_GPIO_BASE	(GPIO_BOARD_START + 16)
+#define BANFF_PMIC_GPIO_BASE
 	(GLENFARCLAS_PMIC_GPIO_BASE + 16)
 

Mark,

Above definitions are at mach/crag6410.h file not mach-crag6410.c file in my tree.
And in my opinion, to use GPIO_BOARD_START is better than to use GLENFARCLAS_PMIC_GPIO_BASE like others for easily reading.

arch/arm/mach-s3c64xx/mach-crag6410.c static struct wm831x_touch_pdata touch_pdata

Quoted 3 lines
arch/arm/mach-s3c64xx/mach-crag6410.c +0 -0
 /* serial port setup */
@@ -509,7 +510,7 @@ static struct wm831x_touch_pdata touch_pdata

__initdata

arch/arm/mach-s3c64xx/mach-crag6410.c static struct wm831x_touch_pdata touch_pdata · line 515

Quoted 7 lines
arch/arm/mach-s3c64xx/mach-crag6410.c +1 -1
 = {
 static struct wm831x_pdata crag_pmic_pdata __initdata = {
 	.wm831x_num = 1,
 	.irq_base = BANFF_PMIC_IRQ_BASE,
-	.gpio_base = GPIO_BOARD_START + 8,
+	.gpio_base = BANFF_PMIC_GPIO_BASE,
 	.soft_shutdown = true,

There is no above line in my tree...

Quoted 4 lines
arch/arm/mach-s3c64xx/mach-crag6410.c +0 -1
 	.backup = &banff_backup_pdata,
--

1.7.7.1

So I think, this should be following...?

(quoted diff) +0 -0

b/arch/arm/mach-s3c64xx/include/mach/crag6410.h
index be9074e..1cc1cc8 100644

arch/arm/mach-s3c64xx/include/mach/crag6410.h +2 -1
@@ -17,7 +17,8 @@
 #define GLENFARCLAS_PMIC_IRQ_BASE		(IRQ_BOARD_START + 64)
 
 #define PCA935X_GPIO_BASE		GPIO_BOARD_START
-#define CODEC_GPIO_BASE		(GPIO_BOARD_START + 8)
+#define CODEC_GPIO_BASE			(GPIO_BOARD_START + 8)
 #define GLENFARCLAS_PMIC_GPIO_BASE	(GPIO_BOARD_START + 16)
+#define BANFF_PMIC_GPIO_BASE		(GPIO_BOARD_START + 32)
 
 #endif
(quoted diff) +0 -0

b/arch/arm/mach-s3c64xx/mach-crag6410.c
index d04b654..8b04a46 100644

arch/arm/mach-s3c64xx/mach-crag6410.c +0 -0
@@ -500,7 +500,7 @@ static struct wm831x_touch_pdata touch_pdata __initdata

= {
static struct wm831x_pdata crag_pmic_pdata __initdata = {
.wm831x_num = 1,
.irq_base = BANFF_PMIC_IRQ_BASE,
- .gpio_base = GPIO_BOARD_START + 8,
+ .gpio_base = BANFF_PMIC_GPIO_BASE,

.backup = &banff_backup_pdata,

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#4 lore raw

PATCH 3/3 ARM: S3C64XX: Correct reservation of GPIOs for CPU module on Cragganmore

Quoted 8 lines · Kukjin Kim
Quoted 5 lines · Mark Brown

#define PCA935X_GPIO_BASE GPIO_BOARD_START
#define CODEC_GPIO_BASE (GPIO_BOARD_START + 8)
#define GLENFARCLAS_PMIC_GPIO_BASE (GPIO_BOARD_START + 16)
+#define BANFF_PMIC_GPIO_BASE
(GLENFARCLAS_PMIC_GPIO_BASE + 16)

Quoted 4 lines

Above definitions are at mach/crag6410.h file not mach-crag6410.c file in my tree.
And in my opinion, to use GPIO_BOARD_START is better than to use GLENFARCLAS_PMIC_GPIO_BASE like others for easily reading.

I'd prefer it if the were all defined in terms of the preceeding one but yes.

Quoted 1 line

So I think, this should be following...?

Yes.

#5 lore raw

PATCH 3/3 ARM: S3C64XX: Correct reservation of GPIOs for CPU module on Cragganmore

Quoted 11 lines · Mark Brown
Quoted 9 lines · Kukjin Kim
Quoted 5 lines · Mark Brown

#define PCA935X_GPIO_BASE GPIO_BOARD_START
#define CODEC_GPIO_BASE (GPIO_BOARD_START + 8)
#define GLENFARCLAS_PMIC_GPIO_BASE (GPIO_BOARD_START + 16)
+#define BANFF_PMIC_GPIO_BASE
(GLENFARCLAS_PMIC_GPIO_BASE + 16)

Above definitions are at mach/crag6410.h file not mach-crag6410.c file

in my

Quoted 10 lines
Quoted 3 lines

tree.
And in my opinion, to use GPIO_BOARD_START is better than to use GLENFARCLAS_PMIC_GPIO_BASE like others for easily reading.

I'd prefer it if the were all defined in terms of the preceeding one but yes.

Quoted 1 line

So I think, this should be following...?

Yes.

OK, applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.