[PATCH 01/09] ARM: s3c2442: gta02: Fix usage gpio bank j pin definitions

Subsystems: arm port, the rest

STALE5639d

35 messages, 3 authors, 2011-03-07 · open the first message on its own page

[PATCH 01/09] ARM: s3c2442: gta02: Fix usage gpio bank j pin definitions

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:50:37

The gta02 header file still uses the old S3C2410_GPJx defines instead of the
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been removed
this causes the following build failure:

	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
	sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2' undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared identifier is reported only once
	sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it appears in.)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
	sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2' undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
	sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1' undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: At top level:
	sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2' undeclared here (not in a function)
	sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1' undeclared here (not in a function)

This patches fixes the issue by doing a s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
on the file.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/include/mach/gta02.h |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-s3c2440/include/mach/gta02.h b/arch/arm/mach-s3c2440/include/mach/gta02.h
index 953331d..3a56a22 100644
--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
@@ -44,19 +44,19 @@
 #define GTA02v3_GPIO_nUSB_FLT	S3C2410_GPG(10)	/* v3 + v4 only */
 #define GTA02v3_GPIO_nGSM_OC	S3C2410_GPG(11)	/* v3 + v4 only */
 
-#define GTA02_GPIO_AMP_SHUT	S3C2440_GPJ1	/* v2 + v3 + v4 only */
-#define GTA02v1_GPIO_WLAN_GPIO10	S3C2440_GPJ2
-#define GTA02_GPIO_HP_IN	S3C2440_GPJ2	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_INT0		S3C2440_GPJ3	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_nGSM_EN	S3C2440_GPJ4
-#define GTA02_GPIO_3D_RESET	S3C2440_GPJ5
-#define GTA02_GPIO_nDL_GSM	S3C2440_GPJ6	/* v4 + v5 only */
-#define GTA02_GPIO_WLAN_GPIO0	S3C2440_GPJ7
-#define GTA02v1_GPIO_BAT_ID	S3C2440_GPJ8
-#define GTA02_GPIO_KEEPACT	S3C2440_GPJ8
-#define GTA02v1_GPIO_HP_IN	S3C2440_GPJ10
-#define GTA02_CHIP_PWD		S3C2440_GPJ11	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_nWLAN_RESET	S3C2440_GPJ12	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_AMP_SHUT	S3C2410_GPJ(1)	/* v2 + v3 + v4 only */
+#define GTA02v1_GPIO_WLAN_GPIO10	S3C2410_GPJ(2)
+#define GTA02_GPIO_HP_IN	S3C2410_GPJ(2)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_INT0		S3C2410_GPJ(3)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_nGSM_EN	S3C2410_GPJ(4)
+#define GTA02_GPIO_3D_RESET	S3C2410_GPJ(5)
+#define GTA02_GPIO_nDL_GSM	S3C2410_GPJ(6)	/* v4 + v5 only */
+#define GTA02_GPIO_WLAN_GPIO0	S3C2410_GPJ(7)
+#define GTA02v1_GPIO_BAT_ID	S3C2410_GPJ(8)
+#define GTA02_GPIO_KEEPACT	S3C2410_GPJ(8)
+#define GTA02v1_GPIO_HP_IN	S3C2410_GPJ(10)
+#define GTA02_CHIP_PWD		S3C2410_GPJ(11)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_nWLAN_RESET	S3C2410_GPJ(12)	/* v2 + v3 + v4 only */
 
 #define GTA02_IRQ_GSENSOR_1	IRQ_EINT0
 #define GTA02_IRQ_MODEM		IRQ_EINT1
-- 
1.7.2.3

[PATCH 02/09] ARM: s3c2440: gta02: Register PCM device

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:50:40

The ASoC multi-component patch introduced a new pcm platform device, which needs
to be registered by board files in order for sound to work.
This patch does this for the gta02 board.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 9f2c14e..e83062b 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -509,6 +509,7 @@ static struct platform_device *gta02_devices[] __initdata = {
 	&gta02_nor_flash,
 	&s3c24xx_pwm_device,
 	&s3c_device_iis,
+	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 };
 
-- 
1.7.2.3

[PATCH 04/09] ARM: s3c2440: gta02: Select missing S3C_DEV_USB_HOST

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:50:57

The gta02 mach file references the ohci device.
So we need to select S3C_DEV_USB_HOST to have the device available.

This fixes the following linker errors:
	arch/arm/mach-s3c2440/built-in.o: In function `gta02_machine_init':
	mach-gta02.c:(.init.text+0x370): undefined reference to `s3c_ohci_set_platdata'
	arch/arm/mach-s3c2440/built-in.o:(.init.data+0xac): undefined reference to `s3c_device_ohci'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index a0cb258..50825a3 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -99,6 +99,7 @@ config MACH_NEO1973_GTA02
 	select POWER_SUPPLY
 	select MACH_NEO1973
 	select S3C2410_PWM
+	select S3C_DEV_USB_HOST
 	help
 	   Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
 
-- 
1.7.2.3

[PATCH 07/09] ARM: s3c2440: gta02: Call regulator_has_full_constraints

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:50:59

At the end of gta02_pmu_attach_child_devices all drivers should have taken
control of their regulators and we can tell the regulator core to disable all
regulators which are currently not in use.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 01e0930..1396639 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -563,6 +563,8 @@ static void gta02_pmu_attach_child_devices(struct pcf50633 *pcf)
 
 	platform_add_devices(gta02_devices_pmu_children,
 			     ARRAY_SIZE(gta02_devices_pmu_children));
+
+	regulator_has_full_constraints();
 }
 
 static void gta02_poweroff(void)
-- 
1.7.2.3

[PATCH 08/09] ARM: s3c2440: gta02: Request usb pullup pin before using it

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:51:00

Request the gpio pin used to control the usb pullup before using it to avoid a
runtime warning about an auto-requested gpio.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 1396639..94456fa 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -451,11 +451,11 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
 	switch (cmd) {
 	case S3C2410_UDC_P_ENABLE:
 		pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
 		break;
 	case S3C2410_UDC_P_DISABLE:
 		pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 0);
 		break;
 	case S3C2410_UDC_P_RESET:
 		pr_debug("%s S3C2410_UDC_P_RESET\n", __func__);
@@ -572,11 +572,24 @@ static void gta02_poweroff(void)
 	pcf50633_reg_set_bit_mask(gta02_pcf, PCF50633_REG_OOCSHDWN, 1, 1);
 }
 
+static void gta02_request_gpios(void)
+{
+	int ret;
+	ret = gpio_request_one(GTA02_GPIO_USB_PULLUP, GPIOF_OUT_INIT_LOW,
+				"USB pullup");
+	if (ret) {
+		printk(KERN_ERR "Failed to request USB pullup gpio pin: %d\n",
+			ret);
+	}
+}
+
 static void __init gta02_machine_init(void)
 {
 	/* Set the panic callback to turn AUX LED on or off. */
 	panic_blink = gta02_panic_blink;
 
+	gta02_request_gpios();
+
 	s3c_pm_init();
 
 #ifdef CONFIG_CHARGER_PCF50633
-- 
1.7.2.3

[PATCH 09/09] ARM: s3c2440: gta02: Add touchscreen support

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:51:02

This patch registers the s3c touchscreen and adc devices to add touchscreen
support for the gta02.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 94456fa..2300ec5 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -79,6 +79,8 @@
 #include <mach/regs-mem.h>
 #include <mach/hardware.h>
 
+#include <plat/ts.h>
+
 #include <mach/gta02.h>
 
 #include <plat/regs-serial.h>
@@ -480,6 +482,13 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
 	},
 };
 
+/* Touchscreen */
+static struct s3c2410_ts_mach_info gta02_ts_info = {
+	.delay = 10000,
+	.presc = 0xff, /* slow as we can go */
+	.oversampling_shift = 2,
+};
+
 /* Buttons */
 static struct gpio_keys_button gta02_buttons[] = {
 	{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[] __initdata = {
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 	&gta02_buttons_device,
+	&s3c_device_adc,
+	&s3c_device_ts,
 };
 
 /* These guys DO need to be children of PMU. */
@@ -597,6 +608,7 @@ static void __init gta02_machine_init(void)
 #endif
 
 	s3c24xx_udc_set_platdata(&gta02_udc_cfg);
+	s3c24xx_ts_set_platdata(&gta02_ts_info);
 	s3c_ohci_set_platdata(&gta02_usb_info);
 	s3c_nand_set_platdata(&gta02_nand_info);
 	s3c_i2c0_set_platdata(NULL);
-- 
1.7.2.3

[PATCH 06/09] ARM: s3c2440: gta02: Remove state_mem constraints for the pcf50633 regulators

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:51:03

The pcf50633 regulator driver does not use the state_mem constraints, so there
is no use in setting them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index e57c4d8..01e0930 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -283,9 +283,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.always_on = 1,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_DOWN1] = {
@@ -304,9 +301,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.apply_uV = 1,
 				.always_on = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_HCLDO] = {
@@ -325,9 +319,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 0,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO2] = {
@@ -362,9 +353,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO6] = {
@@ -379,9 +367,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 1800000,
 				.max_uV = 1800000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 
-- 
1.7.2.3

[PATCH 05/09] ARM: s3c2440: gta02: Fix regulator valid_modes_ops

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:51:05

The REGULATOR_CHANGE_STATUS flag needs to be set on valid_ops_mask, otherwise it
a driver wont be able to turn the regulator on or off.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 6629998..e57c4d8 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -314,8 +314,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 2000000,
 				.max_uV = 3300000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
-				.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
-				.always_on = 1,
+				.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+						REGULATOR_CHANGE_STATUS,
 			},
 		},
 		[PCF50633_REGULATOR_LDO1] = {
@@ -323,6 +323,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 3300000,
 				.max_uV = 3300000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
+				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
 				.state_mem = {
 					.enabled = 0,
@@ -350,6 +351,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 3200000,
 				.max_uV = 3200000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
+				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
 			},
 		},
@@ -358,6 +360,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 3000000,
 				.max_uV = 3000000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
+				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
 				.state_mem = {
 					.enabled = 1,
-- 
1.7.2.3

[PATCH 03/09] ARM: s3c2440: gta02: Add button support

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-07 01:52:09

This patch adds support for the two buttons found on the gta02 device, which are
connectd to gpio pins, using the gpio-keys driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index e83062b..6629998 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -58,6 +58,9 @@
 #include <linux/mfd/pcf50633/pmic.h>
 #include <linux/mfd/pcf50633/backlight.h>
 
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
+
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -489,6 +492,36 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
 	},
 };
 
+/* Buttons */
+static struct gpio_keys_button gta02_buttons[] = {
+	{
+		.gpio = GTA02_GPIO_AUX_KEY,
+		.code = KEY_PHONE,
+		.desc = "Aux",
+		.type = EV_KEY,
+		.debounce_interval = 100,
+	},
+	{
+		.gpio = GTA02_GPIO_HOLD_KEY,
+		.code = KEY_PAUSE,
+		.desc = "Hold",
+		.type = EV_KEY,
+		.debounce_interval = 100,
+	},
+};
+
+static struct gpio_keys_platform_data gta02_buttons_pdata = {
+	.buttons = gta02_buttons,
+	.nbuttons = ARRAY_SIZE(gta02_buttons),
+};
+
+static struct platform_device gta02_buttons_device = {
+	.name = "gpio-keys",
+	.id = -1,
+	.dev = {
+		.platform_data = &gta02_buttons_pdata,
+	},
+};
 
 static void __init gta02_map_io(void)
 {
@@ -511,6 +544,7 @@ static struct platform_device *gta02_devices[] __initdata = {
 	&s3c_device_iis,
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
+	&gta02_buttons_device,
 };
 
 /* These guys DO need to be children of PMU. */
-- 
1.7.2.3

Re: [PATCH 07/09] ARM: s3c2440: gta02: Call regulator_has_full_constraints

From: Mark Brown <hidden>
Date: 2011-02-07 11:58:58

On Mon, Feb 07, 2011 at 02:51:59AM +0100, Lars-Peter Clausen wrote:
At the end of gta02_pmu_attach_child_devices all drivers should have taken
control of their regulators and we can tell the regulator core to disable all
regulators which are currently not in use.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
You're misunderstanding this API.  It can be called at any time and will
only actually do anything at the end of init.  You should just call it
from your machine init.

[PATCH v2 07/09] ARM: s3c2440: gta02: Call regulator_has_full_constraints

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-08 02:54:01

This allows the regulator core to disable all regulators which are not in use
at the end of the kernel init phase.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 01e0930..2682592 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -590,6 +590,8 @@ static void __init gta02_machine_init(void)
 
 	platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
 	pm_power_off = gta02_poweroff;
+
+	regulator_has_full_constraints();
 }
 
 
-- 
1.7.2.3

Re: [PATCH 01/09] ARM: s3c2442: gta02: Fix usage gpio bank j pin definitions

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-18 10:41:33

On 02/07/2011 02:51 AM, Lars-Peter Clausen wrote:
The gta02 header file still uses the old S3C2410_GPJx defines instead of the
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been removed
this causes the following build failure:

	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
	sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2' undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared identifier is reported only once
	sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it appears in.)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
	sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2' undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
	sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1' undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: At top level:
	sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2' undeclared here (not in a function)
	sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1' undeclared here (not in a function)

This patches fixes the issue by doing a s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
on the file.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Hi

Ben or Kukjin could you take a look at this series and merge it, if it is ok?

- Lars

quoted hunk
---
 arch/arm/mach-s3c2440/include/mach/gta02.h |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-s3c2440/include/mach/gta02.h b/arch/arm/mach-s3c2440/include/mach/gta02.h
index 953331d..3a56a22 100644
--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
@@ -44,19 +44,19 @@
 #define GTA02v3_GPIO_nUSB_FLT	S3C2410_GPG(10)	/* v3 + v4 only */
 #define GTA02v3_GPIO_nGSM_OC	S3C2410_GPG(11)	/* v3 + v4 only */
 
-#define GTA02_GPIO_AMP_SHUT	S3C2440_GPJ1	/* v2 + v3 + v4 only */
-#define GTA02v1_GPIO_WLAN_GPIO10	S3C2440_GPJ2
-#define GTA02_GPIO_HP_IN	S3C2440_GPJ2	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_INT0		S3C2440_GPJ3	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_nGSM_EN	S3C2440_GPJ4
-#define GTA02_GPIO_3D_RESET	S3C2440_GPJ5
-#define GTA02_GPIO_nDL_GSM	S3C2440_GPJ6	/* v4 + v5 only */
-#define GTA02_GPIO_WLAN_GPIO0	S3C2440_GPJ7
-#define GTA02v1_GPIO_BAT_ID	S3C2440_GPJ8
-#define GTA02_GPIO_KEEPACT	S3C2440_GPJ8
-#define GTA02v1_GPIO_HP_IN	S3C2440_GPJ10
-#define GTA02_CHIP_PWD		S3C2440_GPJ11	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_nWLAN_RESET	S3C2440_GPJ12	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_AMP_SHUT	S3C2410_GPJ(1)	/* v2 + v3 + v4 only */
+#define GTA02v1_GPIO_WLAN_GPIO10	S3C2410_GPJ(2)
+#define GTA02_GPIO_HP_IN	S3C2410_GPJ(2)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_INT0		S3C2410_GPJ(3)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_nGSM_EN	S3C2410_GPJ(4)
+#define GTA02_GPIO_3D_RESET	S3C2410_GPJ(5)
+#define GTA02_GPIO_nDL_GSM	S3C2410_GPJ(6)	/* v4 + v5 only */
+#define GTA02_GPIO_WLAN_GPIO0	S3C2410_GPJ(7)
+#define GTA02v1_GPIO_BAT_ID	S3C2410_GPJ(8)
+#define GTA02_GPIO_KEEPACT	S3C2410_GPJ(8)
+#define GTA02v1_GPIO_HP_IN	S3C2410_GPJ(10)
+#define GTA02_CHIP_PWD		S3C2410_GPJ(11)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_nWLAN_RESET	S3C2410_GPJ(12)	/* v2 + v3 + v4 only */
 
 #define GTA02_IRQ_GSENSOR_1	IRQ_EINT0
 #define GTA02_IRQ_MODEM		IRQ_EINT1

RE: [PATCH 01/09] ARM: s3c2442: gta02: Fix usage gpio bank j pin definitions

From: Kukjin Kim <hidden>
Date: 2011-02-21 09:58:35

Lasrs-Peter Clausen wrote:
On 02/07/2011 02:51 AM, Lars-Peter Clausen wrote:
quoted
The gta02 header file still uses the old S3C2410_GPJx defines instead of
the
quoted
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been
removed
quoted
this causes the following build failure:

	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
	sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
quoted
	sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared
identifier is reported only once
quoted
	sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it
appears in.)
quoted
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
	sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
quoted
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
	sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1'
undeclared (first use in this function)
quoted
	sound/soc/samsung/neo1973_wm8753.c: At top level:
	sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2'
undeclared here (not in a function)
quoted
	sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1'
undeclared here (not in a function)
quoted
This patches fixes the issue by doing a
s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
quoted
on the file.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Hi

Ben or Kukjin could you take a look at this series and merge it, if it is
ok?
Hi Lars-Peter,

Basically, the maintainer of mach-s3c* is Ben Dooks.
I think, he will review this series but if he can't soon, I will/can do it.

Ben, could you please review this patches?
If you're busy, please let me know :)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 09/09] ARM: s3c2440: gta02: Add touchscreen support

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:04:10

Lars-Peter Clausen wrote:
This patch registers the s3c touchscreen and adc devices to add
touchscreen
quoted hunk
support for the gta02.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index 94456fa..2300ec5 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -79,6 +79,8 @@
 #include <mach/regs-mem.h>
 #include <mach/hardware.h>

+#include <plat/ts.h>
+
Please group same/similar inclusion together like following.
<linux/...> <asm/...> then <mach/...> or <plat/...>

In other words, please add your <plat/ts.h> inclusion after other <plat/...>
quoted hunk
 #include <mach/gta02.h>

 #include <plat/regs-serial.h>
@@ -480,6 +482,13 @@ static struct s3c2410_hcd_info gta02_usb_info
__initdata
= {
 	},
 };

+/* Touchscreen */
+static struct s3c2410_ts_mach_info gta02_ts_info = {
+	.delay = 10000,
+	.presc = 0xff, /* slow as we can go */
+	.oversampling_shift = 2,
+};
How about to use tab between member and = like following?

static struct s3c2410_ts_mach_info gta02_ts_info = {
	.delay			= 10000,
	.presc			= 0xff, /* slow as we can go */
	.oversampling_shift	= 2,
};
quoted hunk
+
 /* Buttons */
 static struct gpio_keys_button gta02_buttons[] = {
 	{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[]
__initdata
= {
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 	&gta02_buttons_device,
+	&s3c_device_adc,
No need to build plat-samsung/dev-adc.c for this?
If you want to add '&s3c_deivce_adc', should add 'select SAMSUNG_DEV_ADC'
into "config MACH_NEO1973_GTA02".
+	&s3c_device_ts,
'select SAMSUNG_DEV_TS'
quoted hunk
 };

 /* These guys DO need to be children of PMU. */
@@ -597,6 +608,7 @@ static void __init gta02_machine_init(void)
 #endif

 	s3c24xx_udc_set_platdata(&gta02_udc_cfg);
+	s3c24xx_ts_set_platdata(&gta02_ts_info);
Same as above. 'select SAMSUNG_DEV_TS' should be added for
plat-samsung/dev-ts.c.
 	s3c_ohci_set_platdata(&gta02_usb_info);
 	s3c_nand_set_platdata(&gta02_nand_info);
 	s3c_i2c0_set_platdata(NULL);
--
1.7.2.3

Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 08/09] ARM: s3c2440: gta02: Request usb pullup pin before using it

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:16:46

Lars-Peter Clausen wrote:
Request the gpio pin used to control the usb pullup before using it to
avoid
quoted hunk
a
runtime warning about an auto-requested gpio.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index 1396639..94456fa 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -451,11 +451,11 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e
cmd)
 	switch (cmd) {
 	case S3C2410_UDC_P_ENABLE:
 		pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
How about following instead?
	gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
	gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
	gpio_free(GTA02_GPIO_USB_PULLUP);
quoted hunk
 		break;
 	case S3C2410_UDC_P_DISABLE:
 		pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 0);
 		break;
 	case S3C2410_UDC_P_RESET:
 		pr_debug("%s S3C2410_UDC_P_RESET\n", __func__);
@@ -572,11 +572,24 @@ static void gta02_poweroff(void)
 	pcf50633_reg_set_bit_mask(gta02_pcf, PCF50633_REG_OOCSHDWN, 1, 1);
 }

+static void gta02_request_gpios(void)
+{
+	int ret;
+	ret = gpio_request_one(GTA02_GPIO_USB_PULLUP, GPIOF_OUT_INIT_LOW,
+				"USB pullup");
+	if (ret) {
+		printk(KERN_ERR "Failed to request USB pullup gpio pin:
%d\n",
+			ret);
+	}
+}
+
 static void __init gta02_machine_init(void)
 {
 	/* Set the panic callback to turn AUX LED on or off. */
 	panic_blink = gta02_panic_blink;

+	gta02_request_gpios();
+
 	s3c_pm_init();

 #ifdef CONFIG_CHARGER_PCF50633
--


Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 06/09] ARM: s3c2440: gta02: Remove state_mem constraints for the pcf50633 regulators

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:26:08

Lars-Peter Clausen wrote:
quoted hunk
The pcf50633 regulator driver does not use the state_mem constraints, so
there
is no use in setting them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index e57c4d8..01e0930 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -283,9 +283,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.always_on = 1,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_DOWN1] = {
@@ -304,9 +301,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.apply_uV = 1,
 				.always_on = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_HCLDO] = {
@@ -325,9 +319,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 0,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO2] = {
@@ -362,9 +353,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO6] = {
@@ -379,9 +367,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 1800000,
 				.max_uV = 1800000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},

--
Don't we need regulator_suspend_mem_state_show() on PCF50633?


Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 04/09] ARM: s3c2440: gta02: Select missing S3C_DEV_USB_HOST

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:31:36

Lars-Peter Clausen wrote:
quoted hunk
The gta02 mach file references the ohci device.
So we need to select S3C_DEV_USB_HOST to have the device available.

This fixes the following linker errors:
	arch/arm/mach-s3c2440/built-in.o: In function `gta02_machine_init':
	mach-gta02.c:(.init.text+0x370): undefined reference to
`s3c_ohci_set_platdata'
	arch/arm/mach-s3c2440/built-in.o:(.init.data+0xac): undefined
reference to `s3c_device_ohci'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index a0cb258..50825a3 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -99,6 +99,7 @@ config MACH_NEO1973_GTA02
 	select POWER_SUPPLY
 	select MACH_NEO1973
 	select S3C2410_PWM
+	select S3C_DEV_USB_HOST
 	help
 	   Say Y here if you are using the Openmoko GTA02 / Freerunner GSM
Phone

--
1.7.2.3
Ok, applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 02/09] ARM: s3c2440: gta02: Register PCM device

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:38:55

Lars-Peter Clausen wrote:
quoted hunk
The ASoC multi-component patch introduced a new pcm platform device, which
needs
to be registered by board files in order for sound to work.
This patch does this for the gta02 board.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index 9f2c14e..e83062b 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -509,6 +509,7 @@ static struct platform_device *gta02_devices[]
__initdata
= {
 	&gta02_nor_flash,
 	&s3c24xx_pwm_device,
 	&s3c_device_iis,
+	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 };

--
Ok, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 01/09] ARM: s3c2442: gta02: Fix usage gpio bank j pin definitions

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:43:18

Lars-Peter Clausen wrote:
The gta02 header file still uses the old S3C2410_GPJx defines instead of
the
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been
removed
this causes the following build failure:

	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
	sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared
identifier is reported only once
	sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it
appears in.)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
	sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
	sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1'
undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: At top level:
	sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2'
undeclared here (not in a function)
	sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1'
undeclared here (not in a function)

This patches fixes the issue by doing a
s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
Maybe, "s,S3C2440_GPJ([\d]+),S3C2410_GPJ(\1),g" instead ?
on the file.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/include/mach/gta02.h |   26
+++++++++++++-------------
quoted hunk
 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-s3c2440/include/mach/gta02.h b/arch/arm/mach-
s3c2440/include/mach/gta02.h
index 953331d..3a56a22 100644
--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
@@ -44,19 +44,19 @@
 #define GTA02v3_GPIO_nUSB_FLT	S3C2410_GPG(10)	/* v3 + v4 only */
 #define GTA02v3_GPIO_nGSM_OC	S3C2410_GPG(11)	/* v3 + v4 only */

-#define GTA02_GPIO_AMP_SHUT	S3C2440_GPJ1	/* v2 + v3 + v4 only */
-#define GTA02v1_GPIO_WLAN_GPIO10	S3C2440_GPJ2
-#define GTA02_GPIO_HP_IN	S3C2440_GPJ2	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_INT0		S3C2440_GPJ3	/* v2 + v3 + v4 only
*/
-#define GTA02_GPIO_nGSM_EN	S3C2440_GPJ4
-#define GTA02_GPIO_3D_RESET	S3C2440_GPJ5
-#define GTA02_GPIO_nDL_GSM	S3C2440_GPJ6	/* v4 + v5 only */
-#define GTA02_GPIO_WLAN_GPIO0	S3C2440_GPJ7
-#define GTA02v1_GPIO_BAT_ID	S3C2440_GPJ8
-#define GTA02_GPIO_KEEPACT	S3C2440_GPJ8
-#define GTA02v1_GPIO_HP_IN	S3C2440_GPJ10
-#define GTA02_CHIP_PWD		S3C2440_GPJ11	/* v2 + v3 + v4 only
*/
-#define GTA02_GPIO_nWLAN_RESET	S3C2440_GPJ12	/* v2 + v3 + v4 only
*/
+#define GTA02_GPIO_AMP_SHUT	S3C2410_GPJ(1)	/* v2 + v3 + v4 only */
+#define GTA02v1_GPIO_WLAN_GPIO10	S3C2410_GPJ(2)
+#define GTA02_GPIO_HP_IN	S3C2410_GPJ(2)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_INT0		S3C2410_GPJ(3)	/* v2 + v3 + v4 only
*/
+#define GTA02_GPIO_nGSM_EN	S3C2410_GPJ(4)
+#define GTA02_GPIO_3D_RESET	S3C2410_GPJ(5)
+#define GTA02_GPIO_nDL_GSM	S3C2410_GPJ(6)	/* v4 + v5 only */
+#define GTA02_GPIO_WLAN_GPIO0	S3C2410_GPJ(7)
+#define GTA02v1_GPIO_BAT_ID	S3C2410_GPJ(8)
+#define GTA02_GPIO_KEEPACT	S3C2410_GPJ(8)
+#define GTA02v1_GPIO_HP_IN	S3C2410_GPJ(10)
+#define GTA02_CHIP_PWD		S3C2410_GPJ(11)	/* v2 + v3 + v4
only */
+#define GTA02_GPIO_nWLAN_RESET	S3C2410_GPJ(12)	/* v2 + v3 + v4
only */

 #define GTA02_IRQ_GSENSOR_1	IRQ_EINT0
 #define GTA02_IRQ_MODEM		IRQ_EINT1
--
1.7.2.3
Yeah, old S3C2440_GPJx has removed.
Is the S3C2410_GPJ(1) right instead of S3C2440_GPJ1?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 03/09] ARM: s3c2440: gta02: Add button support

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:46:11

Lars-Peter Clausen wrote:
This patch adds support for the two buttons found on the gta02 device,
which
are
connectd to gpio pins, using the gpio-keys driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   34
++++++++++++++++++++++++++++++++++
quoted hunk
 1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index e83062b..6629998 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -58,6 +58,9 @@
 #include <linux/mfd/pcf50633/pmic.h>
 #include <linux/mfd/pcf50633/backlight.h>

+#include <linux/input.h>
+#include <linux/gpio_keys.h>
+
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -489,6 +492,36 @@ static struct s3c2410_hcd_info gta02_usb_info
__initdata
quoted hunk
= {
 	},
 };

+/* Buttons */
+static struct gpio_keys_button gta02_buttons[] = {
+	{
+		.gpio = GTA02_GPIO_AUX_KEY,
+		.code = KEY_PHONE,
+		.desc = "Aux",
+		.type = EV_KEY,
+		.debounce_interval = 100,
+	},
+	{
+		.gpio = GTA02_GPIO_HOLD_KEY,
+		.code = KEY_PAUSE,
+		.desc = "Hold",
+		.type = EV_KEY,
+		.debounce_interval = 100,
+	},
+};
+
+static struct gpio_keys_platform_data gta02_buttons_pdata = {
+	.buttons = gta02_buttons,
+	.nbuttons = ARRAY_SIZE(gta02_buttons),
+};
+
+static struct platform_device gta02_buttons_device = {
+	.name = "gpio-keys",
+	.id = -1,
+	.dev = {
+		.platform_data = &gta02_buttons_pdata,
+	},
+};

 static void __init gta02_map_io(void)
 {
@@ -511,6 +544,7 @@ static struct platform_device *gta02_devices[]
__initdata
= {
 	&s3c_device_iis,
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
+	&gta02_buttons_device,
 };

 /* These guys DO need to be children of PMU. */
--
Ok, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 05/09] ARM: s3c2440: gta02: Fix regulator valid_modes_ops

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:48:13

Lars-Peter Clausen wrote:
The REGULATOR_CHANGE_STATUS flag needs to be set on valid_ops_mask,
otherwise
quoted hunk
it
a driver wont be able to turn the regulator on or off.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index 6629998..e57c4d8 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -314,8 +314,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 2000000,
 				.max_uV = 3300000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
-				.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
-				.always_on = 1,
+				.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+						REGULATOR_CHANGE_STATUS,
 			},
 		},
 		[PCF50633_REGULATOR_LDO1] = {
@@ -323,6 +323,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 3300000,
 				.max_uV = 3300000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
+				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
 				.state_mem = {
 					.enabled = 0,
@@ -350,6 +351,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 3200000,
 				.max_uV = 3200000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
+				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
 			},
 		},
@@ -358,6 +360,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 3000000,
 				.max_uV = 3000000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
+				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
 				.state_mem = {
 					.enabled = 1,
--
Ok, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH v2 07/09] ARM: s3c2440: gta02: Call regulator_has_full_constraints

From: Kukjin Kim <hidden>
Date: 2011-02-28 06:48:48

Lars-Peter Clausen wrote:
This allows the regulator core to disable all regulators which are not in
use
quoted hunk
at the end of the kernel init phase.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index 01e0930..2682592 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -590,6 +590,8 @@ static void __init gta02_machine_init(void)

 	platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
 	pm_power_off = gta02_poweroff;
+
+	regulator_has_full_constraints();
 }


--
Ok, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

Re: [PATCH 08/09] ARM: s3c2440: gta02: Request usb pullup pin before using it

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-28 10:24:26

On 02/28/2011 07:16 AM, Kukjin Kim wrote:
Lars-Peter Clausen wrote:
quoted
Request the gpio pin used to control the usb pullup before using it to
avoid
quoted
a
runtime warning about an auto-requested gpio.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index 1396639..94456fa 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -451,11 +451,11 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e
cmd)
 	switch (cmd) {
 	case S3C2410_UDC_P_ENABLE:
 		pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
How about following instead?
	gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
	gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
	gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved for the
udc driver. If it is freed again, it could be requested from someone else which
could lead to undefined behaviour.

quoted
 		break;
 	case S3C2410_UDC_P_DISABLE:
 		pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 0);
 		break;
 	case S3C2410_UDC_P_RESET:
 		pr_debug("%s S3C2410_UDC_P_RESET\n", __func__);
@@ -572,11 +572,24 @@ static void gta02_poweroff(void)
 	pcf50633_reg_set_bit_mask(gta02_pcf, PCF50633_REG_OOCSHDWN, 1, 1);
 }

+static void gta02_request_gpios(void)
+{
+	int ret;
+	ret = gpio_request_one(GTA02_GPIO_USB_PULLUP, GPIOF_OUT_INIT_LOW,
+				"USB pullup");
+	if (ret) {
+		printk(KERN_ERR "Failed to request USB pullup gpio pin:
%d\n",
quoted
+			ret);
+	}
+}
+
 static void __init gta02_machine_init(void)
 {
 	/* Set the panic callback to turn AUX LED on or off. */
 	panic_blink = gta02_panic_blink;

+	gta02_request_gpios();
+
 	s3c_pm_init();

 #ifdef CONFIG_CHARGER_PCF50633
--


Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

Re: [PATCH 06/09] ARM: s3c2440: gta02: Remove state_mem constraints for the pcf50633 regulators

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-28 10:27:05

On 02/28/2011 07:26 AM, Kukjin Kim wrote:
Lars-Peter Clausen wrote:
quoted
The pcf50633 regulator driver does not use the state_mem constraints, so
there
is no use in setting them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index e57c4d8..01e0930 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -283,9 +283,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.always_on = 1,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_DOWN1] = {
@@ -304,9 +301,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.apply_uV = 1,
 				.always_on = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_HCLDO] = {
@@ -325,9 +319,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 0,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO2] = {
@@ -362,9 +353,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO6] = {
@@ -379,9 +367,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 1800000,
 				.max_uV = 1800000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},

--
Don't we need regulator_suspend_mem_state_show() on PCF50633?
No. The pcf50633 driver has no set_suspend_enable or set_suspend_disable ops.
So the 'suspend_mem_state' sysfs file does not get registered and that function
is never called.

- Lars

Re: [PATCH 09/09] ARM: s3c2440: gta02: Add touchscreen support

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-28 10:43:32

On 02/28/2011 07:04 AM, Kukjin Kim wrote:
Lars-Peter Clausen wrote:
quoted
This patch registers the s3c touchscreen and adc devices to add
touchscreen
quoted
support for the gta02.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index 94456fa..2300ec5 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -79,6 +79,8 @@
 #include <mach/regs-mem.h>
 #include <mach/hardware.h>

+#include <plat/ts.h>
+
Please group same/similar inclusion together like following.
<linux/...> <asm/...> then <mach/...> or <plat/...>

In other words, please add your <plat/ts.h> inclusion after other <plat/...>
Ok.
quoted
 #include <mach/gta02.h>

 #include <plat/regs-serial.h>
@@ -480,6 +482,13 @@ static struct s3c2410_hcd_info gta02_usb_info
__initdata
quoted
= {
 	},
 };

+/* Touchscreen */
+static struct s3c2410_ts_mach_info gta02_ts_info = {
+	.delay = 10000,
+	.presc = 0xff, /* slow as we can go */
+	.oversampling_shift = 2,
+};
How about to use tab between member and = like following?

static struct s3c2410_ts_mach_info gta02_ts_info = {
	.delay			= 10000,
	.presc			= 0xff, /* slow as we can go */
	.oversampling_shift	= 2,
};
Ok.
quoted
+
 /* Buttons */
 static struct gpio_keys_button gta02_buttons[] = {
 	{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[]
__initdata
quoted
= {
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 	&gta02_buttons_device,
+	&s3c_device_adc,
No need to build plat-samsung/dev-adc.c for this?
If you want to add '&s3c_deivce_adc', should add 'select SAMSUNG_DEV_ADC'
into "config MACH_NEO1973_GTA02".
There appear to be two different definitions for s3c_deivce_adc one is in
plat-samsung/dev-adc.c the other is in plat-s3c24xx/devs.c. So if I select
SAMSUNG_DEV_ADC I'll actually get compile errors.
The definition in plat-s3c24xx/devs.c should probably be dropped, but thats
something for a different patch.

quoted
+	&s3c_device_ts,
'select SAMSUNG_DEV_TS'
Same here.
quoted
 };

 /* These guys DO need to be children of PMU. */
@@ -597,6 +608,7 @@ static void __init gta02_machine_init(void)
 #endif

 	s3c24xx_udc_set_platdata(&gta02_udc_cfg);
+	s3c24xx_ts_set_platdata(&gta02_ts_info);
Same as above. 'select SAMSUNG_DEV_TS' should be added for
plat-samsung/dev-ts.c.
And here.
quoted
 	s3c_ohci_set_platdata(&gta02_usb_info);
 	s3c_nand_set_platdata(&gta02_nand_info);
 	s3c_i2c0_set_platdata(NULL);
--
1.7.2.3

Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 08/09] ARM: s3c2440: gta02: Request usb pullup pin before using it

From: Kukjin Kim <hidden>
Date: 2011-02-28 10:44:31

Lars-Peter Clausen wrote:
On 02/28/2011 07:16 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
Request the gpio pin used to control the usb pullup before using it to
avoid
quoted
a
runtime warning about an auto-requested gpio.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index 1396639..94456fa 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -451,11 +451,11 @@ static void gta02_udc_command(enum
s3c2410_udc_cmd_e
quoted
quoted
cmd)
 	switch (cmd) {
 	case S3C2410_UDC_P_ENABLE:
 		pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
How about following instead?
	gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
	gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
	gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved for
the
udc driver. If it is freed again, it could be requested from someone else
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

Re: [PATCH 01/09] ARM: s3c2442: gta02: Fix usage gpio bank j pin definitions

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-28 10:45:24

On 02/28/2011 07:41 AM, Kukjin Kim wrote:
Lars-Peter Clausen wrote:
quoted
The gta02 header file still uses the old S3C2410_GPJx defines instead of
the
quoted
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been
removed
this causes the following build failure:

	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
	sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared
identifier is reported only once
	sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it
appears in.)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
	sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
	sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1'
undeclared (first use in this function)
	sound/soc/samsung/neo1973_wm8753.c: At top level:
	sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2'
undeclared here (not in a function)
	sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1'
undeclared here (not in a function)

This patches fixes the issue by doing a
s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
Maybe, "s,S3C2440_GPJ([\d]+),S3C2410_GPJ(\1),g" instead ?
quoted
on the file.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/include/mach/gta02.h |   26
+++++++++++++-------------
quoted
 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-s3c2440/include/mach/gta02.h b/arch/arm/mach-
s3c2440/include/mach/gta02.h
index 953331d..3a56a22 100644
--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
@@ -44,19 +44,19 @@
 #define GTA02v3_GPIO_nUSB_FLT	S3C2410_GPG(10)	/* v3 + v4 only */
 #define GTA02v3_GPIO_nGSM_OC	S3C2410_GPG(11)	/* v3 + v4 only */

-#define GTA02_GPIO_AMP_SHUT	S3C2440_GPJ1	/* v2 + v3 + v4 only */
-#define GTA02v1_GPIO_WLAN_GPIO10	S3C2440_GPJ2
-#define GTA02_GPIO_HP_IN	S3C2440_GPJ2	/* v2 + v3 + v4 only */
-#define GTA02_GPIO_INT0		S3C2440_GPJ3	/* v2 + v3 + v4 only
*/
quoted
-#define GTA02_GPIO_nGSM_EN	S3C2440_GPJ4
-#define GTA02_GPIO_3D_RESET	S3C2440_GPJ5
-#define GTA02_GPIO_nDL_GSM	S3C2440_GPJ6	/* v4 + v5 only */
-#define GTA02_GPIO_WLAN_GPIO0	S3C2440_GPJ7
-#define GTA02v1_GPIO_BAT_ID	S3C2440_GPJ8
-#define GTA02_GPIO_KEEPACT	S3C2440_GPJ8
-#define GTA02v1_GPIO_HP_IN	S3C2440_GPJ10
-#define GTA02_CHIP_PWD		S3C2440_GPJ11	/* v2 + v3 + v4 only
*/
quoted
-#define GTA02_GPIO_nWLAN_RESET	S3C2440_GPJ12	/* v2 + v3 + v4 only
*/
quoted
+#define GTA02_GPIO_AMP_SHUT	S3C2410_GPJ(1)	/* v2 + v3 + v4 only */
+#define GTA02v1_GPIO_WLAN_GPIO10	S3C2410_GPJ(2)
+#define GTA02_GPIO_HP_IN	S3C2410_GPJ(2)	/* v2 + v3 + v4 only */
+#define GTA02_GPIO_INT0		S3C2410_GPJ(3)	/* v2 + v3 + v4 only
*/
quoted
+#define GTA02_GPIO_nGSM_EN	S3C2410_GPJ(4)
+#define GTA02_GPIO_3D_RESET	S3C2410_GPJ(5)
+#define GTA02_GPIO_nDL_GSM	S3C2410_GPJ(6)	/* v4 + v5 only */
+#define GTA02_GPIO_WLAN_GPIO0	S3C2410_GPJ(7)
+#define GTA02v1_GPIO_BAT_ID	S3C2410_GPJ(8)
+#define GTA02_GPIO_KEEPACT	S3C2410_GPJ(8)
+#define GTA02v1_GPIO_HP_IN	S3C2410_GPJ(10)
+#define GTA02_CHIP_PWD		S3C2410_GPJ(11)	/* v2 + v3 + v4
only */
+#define GTA02_GPIO_nWLAN_RESET	S3C2410_GPJ(12)	/* v2 + v3 + v4
only */

 #define GTA02_IRQ_GSENSOR_1	IRQ_EINT0
 #define GTA02_IRQ_MODEM		IRQ_EINT1
--
1.7.2.3
Yeah, old S3C2440_GPJx has removed.
Is the S3C2410_GPJ(1) right instead of S3C2440_GPJ1?
I think so. At least the the compile errors are gone and the drivers using
these gpios work as expected.

- Lars

RE: [PATCH 01/09] ARM: s3c2442: gta02: Fix usage gpio bank j pin definitions

From: Kukjin Kim <hidden>
Date: 2011-02-28 10:50:05

Lars-Peter Clausen wrote:
On 02/28/2011 07:41 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
(snip)
quoted
Yeah, old S3C2440_GPJx has removed.
Is the S3C2410_GPJ(1) right instead of S3C2440_GPJ1?
I think so. At least the the compile errors are gone and the drivers using
these gpios work as expected.
Ok, you mean test it on board...so will apply into my s5p-fixes-for-linus
for 38-rc.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

RE: [PATCH 09/09] ARM: s3c2440: gta02: Add touchscreen support

From: Kukjin Kim <hidden>
Date: 2011-02-28 10:57:19

Lars-Peter Clausen wrote:
On 02/28/2011 07:04 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
(snip)
quoted
quoted
 /* Buttons */
 static struct gpio_keys_button gta02_buttons[] = {
 	{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[]
__initdata
quoted
= {
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 	&gta02_buttons_device,
+	&s3c_device_adc,
No need to build plat-samsung/dev-adc.c for this?
If you want to add '&s3c_deivce_adc', should add 'select
SAMSUNG_DEV_ADC'
quoted
into "config MACH_NEO1973_GTA02".
There appear to be two different definitions for s3c_deivce_adc one is in
plat-samsung/dev-adc.c the other is in plat-s3c24xx/devs.c. So if I select
SAMSUNG_DEV_ADC I'll actually get compile errors.
The definition in plat-s3c24xx/devs.c should probably be dropped, but
thats
something for a different patch.
Oops, you're right...ok, please keep your current code.
If required, we can do it later :)

(snip)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

Re: [PATCH 08/09] ARM: s3c2440: gta02: Request usb pullup pin before using it

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-28 10:57:30

On 02/28/2011 11:44 AM, Kukjin Kim wrote:
Lars-Peter Clausen wrote:
quoted
On 02/28/2011 07:16 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
Request the gpio pin used to control the usb pullup before using it to
avoid
quoted
a
runtime warning about an auto-requested gpio.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index 1396639..94456fa 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -451,11 +451,11 @@ static void gta02_udc_command(enum
s3c2410_udc_cmd_e
quoted
quoted
quoted
cmd)
 	switch (cmd) {
 	case S3C2410_UDC_P_ENABLE:
 		pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
How about following instead?
	gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
	gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
	gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved for
the
udc driver. If it is freed again, it could be requested from someone else
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...
Well, for one because it's part of the gpio-api. You should not call any other
gpio functions on a pin unless you've successfully requested that pin.
On the other hand this helps debugging and ensures that the same gpio is not
used by two drivers accident. For example it is also possible to request gpios
from userspace using the gpio sysfs. So by keeping the gpio requested it wont
be possible to request it from userspace by accident. And the gpio will also be
listed in the gpio debugfs file, which can be helpful for debugging as well.

- Lars

RE: [PATCH 06/09] ARM: s3c2440: gta02: Remove state_mem constraints for the pcf50633 regulators

From: Kukjin Kim <hidden>
Date: 2011-02-28 10:58:16

Lars-Peter Clausen wrote:
On 02/28/2011 07:26 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
The pcf50633 regulator driver does not use the state_mem constraints,
so
quoted
quoted
there
is no use in setting them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index e57c4d8..01e0930 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -283,9 +283,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.always_on = 1,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_DOWN1] = {
@@ -304,9 +301,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.apply_uV = 1,
 				.always_on = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_HCLDO] = {
@@ -325,9 +319,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 0,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO2] = {
@@ -362,9 +353,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
 				.valid_ops_mask = REGULATOR_CHANGE_STATUS,
 				.apply_uV = 1,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},
 		[PCF50633_REGULATOR_LDO6] = {
@@ -379,9 +367,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 				.min_uV = 1800000,
 				.max_uV = 1800000,
 				.valid_modes_mask = REGULATOR_MODE_NORMAL,
-				.state_mem = {
-					.enabled = 1,
-				},
 			},
 		},

--
Don't we need regulator_suspend_mem_state_show() on PCF50633?
No. The pcf50633 driver has no set_suspend_enable or set_suspend_disable
ops.
So the 'suspend_mem_state' sysfs file does not get registered and that
function
is never called.
Ok, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

[PATCH v2 09/09] ARM: s3c2440: gta02: Add touchscreen support

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-02-28 11:16:26

This patch adds registers the s3c touchscreen and adc devices to add touchscreen
support for the gta02.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 640ca68..12193ad 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -89,6 +89,8 @@
 #include <plat/udc.h>
 #include <plat/gpio-cfg.h>
 #include <plat/iic.h>
+#include <plat/ts.h>
+
 
 static struct pcf50633 *gta02_pcf;
 
@@ -480,6 +482,13 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
 	},
 };
 
+/* Touchscreen */
+static struct s3c2410_ts_mach_info gta02_ts_info = {
+	.delay			= 10000,
+	.presc			= 0xff, /* slow as we can go */
+	.oversampling_shift	= 2,
+};
+
 /* Buttons */
 static struct gpio_keys_button gta02_buttons[] = {
 	{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[] __initdata = {
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 	&gta02_buttons_device,
+	&s3c_device_adc,
+	&s3c_device_ts,
 };
 
 /* These guys DO need to be children of PMU. */
@@ -595,6 +606,7 @@ static void __init gta02_machine_init(void)
 #endif
 
 	s3c24xx_udc_set_platdata(&gta02_udc_cfg);
+	s3c24xx_ts_set_platdata(&gta02_ts_info);
 	s3c_ohci_set_platdata(&gta02_usb_info);
 	s3c_nand_set_platdata(&gta02_nand_info);
 	s3c_i2c0_set_platdata(NULL);
-- 
1.7.2.3

RE: [PATCH v2 09/09] ARM: s3c2440: gta02: Add touchscreen support

From: Kukjin Kim <hidden>
Date: 2011-02-28 11:56:18

Lars-Peter Clausen wrote:
quoted hunk
This patch adds registers the s3c touchscreen and adc devices to add
touchscreen
support for the gta02.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted hunk
gta02.c
index 640ca68..12193ad 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -89,6 +89,8 @@
 #include <plat/udc.h>
 #include <plat/gpio-cfg.h>
 #include <plat/iic.h>
+#include <plat/ts.h>
+

 static struct pcf50633 *gta02_pcf;
@@ -480,6 +482,13 @@ static struct s3c2410_hcd_info gta02_usb_info
__initdata
quoted hunk
= {
 	},
 };

+/* Touchscreen */
+static struct s3c2410_ts_mach_info gta02_ts_info = {
+	.delay			= 10000,
+	.presc			= 0xff, /* slow as we can go */
+	.oversampling_shift	= 2,
+};
+
 /* Buttons */
 static struct gpio_keys_button gta02_buttons[] = {
 	{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[]
__initdata
quoted hunk
= {
 	&samsung_asoc_dma,
 	&s3c_device_i2c0,
 	&gta02_buttons_device,
+	&s3c_device_adc,
+	&s3c_device_ts,
 };

 /* These guys DO need to be children of PMU. */
@@ -595,6 +606,7 @@ static void __init gta02_machine_init(void)
 #endif

 	s3c24xx_udc_set_platdata(&gta02_udc_cfg);
+	s3c24xx_ts_set_platdata(&gta02_ts_info);
 	s3c_ohci_set_platdata(&gta02_usb_info);
 	s3c_nand_set_platdata(&gta02_nand_info);
 	s3c_i2c0_set_platdata(NULL);
--
1.7.2.3
Ok, applied.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

Re: [PATCH 08/09] ARM: s3c2440: gta02: Request usb pullup pin before using it

From: Lars-Peter Clausen <lars@metafoo.de>
Date: 2011-03-07 06:59:29

On 03/07/2011 07:42 AM, Kukjin Kim wrote:
Lars-Peter Clausen wrote:
quoted
On 02/28/2011 11:44 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
On 02/28/2011 07:16 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
Request the gpio pin used to control the usb pullup before using it
to
quoted
quoted
quoted
quoted
avoid
quoted
a
runtime warning about an auto-requested gpio.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index 1396639..94456fa 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -451,11 +451,11 @@ static void gta02_udc_command(enum
s3c2410_udc_cmd_e
quoted
quoted
quoted
cmd)
 	switch (cmd) {
 	case S3C2410_UDC_P_ENABLE:
 		pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
How about following instead?
	gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
	gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
	gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved
for
quoted
quoted
quoted
the
udc driver. If it is freed again, it could be requested from someone
else
quoted
quoted
quoted
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...
Well, for one because it's part of the gpio-api. You should not call any
other
gpio functions on a pin unless you've successfully requested that pin.
On the other hand this helps debugging and ensures that the same gpio is
not
quoted
used by two drivers accident. For example it is also possible to request
gpios
from userspace using the gpio sysfs. So by keeping the gpio requested it
wont
quoted
be possible to request it from userspace by accident. And the gpio will
also
quoted
be
listed in the gpio debugfs file, which can be helpful for debugging as
well.
quoted
- Lars
Hi Lars,

Ok, will apply :)
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Hi Kgene

Actually I've prepared another patch, which I'm was about to send in a few
minutes, which moves the controlling of the pullup pin to the udc driver.

- Lars

RE: [PATCH 08/09] ARM: s3c2440: gta02: Request usb pullup pin before using it

From: Kukjin Kim <hidden>
Date: 2011-03-07 07:14:50

Lars-Peter Clausen wrote:
On 02/28/2011 11:44 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
On 02/28/2011 07:16 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
Request the gpio pin used to control the usb pullup before using it
to
quoted
quoted
quoted
avoid
quoted
a
runtime warning about an auto-requested gpio.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/arm/mach-s3c2440/mach-gta02.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-
quoted
gta02.c
index 1396639..94456fa 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -451,11 +451,11 @@ static void gta02_udc_command(enum
s3c2410_udc_cmd_e
quoted
quoted
quoted
cmd)
 	switch (cmd) {
 	case S3C2410_UDC_P_ENABLE:
 		pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
-		gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
+		gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
How about following instead?
	gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
	gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
	gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved
for
quoted
quoted
the
udc driver. If it is freed again, it could be requested from someone
else
quoted
quoted
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...
Well, for one because it's part of the gpio-api. You should not call any
other
gpio functions on a pin unless you've successfully requested that pin.
On the other hand this helps debugging and ensures that the same gpio is
not
used by two drivers accident. For example it is also possible to request
gpios
from userspace using the gpio sysfs. So by keeping the gpio requested it
wont
be possible to request it from userspace by accident. And the gpio will
also
be
listed in the gpio debugfs file, which can be helpful for debugging as
well.
- Lars
Hi Lars,

Ok, will apply :)
Thanks.

Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help