Skip to contentSkip to conversation

ARM: SAMSUNG: Add keypad device support

PATCH Superseded Joonyoung Shim 2 participants 8 messages Jun 11, 2010 – Jun 16, 2010

Subsystems (5)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/3 ARM: SAMSUNG: Add keypad device support

This patch adds samsung keypad device definition for samsung cpus.

---
 arch/arm/plat-samsung/Kconfig                    |    5 ++
 arch/arm/plat-samsung/Makefile                   |    1 +
 arch/arm/plat-samsung/dev-keypad.c               |   58 +++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/devs.h        |    2 +
 arch/arm/plat-samsung/include/plat/keypad.h      |   59 ++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/regs-keypad.h |   49 ++++++++++++++++++
 6 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/dev-keypad.c
 create mode 100644 arch/arm/plat-samsung/include/plat/keypad.h
 create mode 100644 arch/arm/plat-samsung/include/plat/regs-keypad.h
arch/arm/plat-samsung/Kconfig +5 -0
index 2753fb3..bd007e3 100644
@@ -227,6 +227,11 @@ config SAMSUNG_DEV_TS
 	help
 	    Common in platform device definitions for touchscreen device
 
+config SAMSUNG_DEV_KEYPAD
+	bool
+	help
+	  Compile in platform device definitions for keypad
+
 # DMA
 
 config S3C_DMA
arch/arm/plat-samsung/Makefile +1 -0
index b1d82cc..8269d80 100644
@@ -48,6 +48,7 @@ obj-$(CONFIG_S3C_DEV_RTC)	+= dev-rtc.o
 
 obj-$(CONFIG_SAMSUNG_DEV_ADC)	+= dev-adc.o
 obj-$(CONFIG_SAMSUNG_DEV_TS)	+= dev-ts.o
+obj-$(CONFIG_SAMSUNG_DEV_KEYPAD)	+= dev-keypad.o
 
 # DMA support
 
arch/arm/plat-samsung/dev-keypad.c new file +58 -0

58 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/devs.h +2 -0
index e6144e4..6d9f01b 100644
@@ -100,6 +100,8 @@ extern struct platform_device s5pc100_device_iis0;
 extern struct platform_device s5pc100_device_iis1;
 extern struct platform_device s5pc100_device_iis2;
 
+extern struct platform_device samsung_device_keypad;
+
 /* s3c2440 specific devices */
 
 #ifdef CONFIG_CPU_S3C2440
arch/arm/plat-samsung/include/plat/keypad.h new file +59 -0

59 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/regs-keypad.h new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#1 lore raw

PATCH v4 2/3 ARM: S5PV210: Add keypad device helpers

This patch adds the keypad device platform helpers for S5PV210 cpu.

---
 arch/arm/mach-s5pv210/Kconfig            |    5 ++++
 arch/arm/mach-s5pv210/Makefile           |    1 +
 arch/arm/mach-s5pv210/cpu.c              |    4 +++
 arch/arm/mach-s5pv210/include/mach/map.h |    3 ++
 arch/arm/mach-s5pv210/setup-keypad.c     |   34 ++++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-keypad.c
arch/arm/mach-s5pv210/Kconfig +5 -0
index 0761eac..692d01c 100644
@@ -32,6 +32,11 @@ config S5PV210_SETUP_FB_24BPP
 	help
           Common setup code for S5PV210 with an 24bpp RGB display helper.
 
+config S5PV210_SETUP_KEYPAD
+	bool
+	help
+	  Common setup code for keypad.
+
 config S5PV210_SETUP_SDHCI
         bool
         select S5PV210_SETUP_SDHCI_GPIO
arch/arm/mach-s5pv210/Makefile +1 -0
index 30be9a6..aae592a 100644
@@ -31,5 +31,6 @@ obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-onenand.o
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
+obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
arch/arm/mach-s5pv210/cpu.c +4 -0
index 411a4a9..a3034ac 100644
@@ -80,6 +80,10 @@ void __init s5pv210_map_io(void)
 	s3c_device_adc.name	= "s3c64xx-adc";
 #endif
 
+#ifdef CONFIG_SAMSUNG_DEV_KEYPAD
+	samsung_device_keypad.name = "s5pv210-keypad";
+#endif
+
 	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
 
 	/* initialise device information early */
arch/arm/mach-s5pv210/include/mach/map.h +3 -0
index 34eb168..e2f6e2a 100644
@@ -32,6 +32,8 @@
 #define S5PV210_PA_SPI0		0xE1300000
 #define S5PV210_PA_SPI1		0xE1400000
 
+#define S5PV210_PA_KEYPAD	(0xE1600000)
+
 #define S5PV210_PA_IIC0		(0xE1800000)
 #define S5PV210_PA_IIC1		(0xFAB00000)
 #define S5PV210_PA_IIC2		(0xE1A00000)
@@ -104,5 +106,6 @@
 #define S3C_PA_WDT		S5PV210_PA_WATCHDOG
 
 #define SAMSUNG_PA_ADC		S5PV210_PA_ADC
+#define SAMSUNG_PA_KEYPAD	S5PV210_PA_KEYPAD
 
 #endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5pv210/setup-keypad.c new file +34 -0
new file mode 100644
index 0000000..f51bf8d
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/mach-s5pv210/setup-keypad.c
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ * Author: Joonyoung Shim <[email protected]>
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include <linux/gpio.h>
+#include <plat/gpio-cfg.h>
+
+void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
+{
+	unsigned int gpio, end;
+
+	/* Set all the necessary GPH3 pins to special-function 3 */
+	end = S5PV210_GPH3(rows);
+	for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+
+	/* Set all the necessary GPH2 pins to special-function 3 */
+	end = S5PV210_GPH2(cols);
+	for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+}
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v4 2/3 ARM: S5PV210: Add keypad device helpers

Review

Quoted 32 lines · Joonyoung Shim

This patch adds the keypad device platform helpers for S5PV210 cpu.

---
 arch/arm/mach-s5pv210/Kconfig            |    5 ++++
 arch/arm/mach-s5pv210/Makefile           |    1 +
 arch/arm/mach-s5pv210/cpu.c              |    4 +++
 arch/arm/mach-s5pv210/include/mach/map.h |    3 ++
 arch/arm/mach-s5pv210/setup-keypad.c     |   34
++++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-keypad.c
arch/arm/mach-s5pv210/Kconfig +5 -0
index 0761eac..692d01c 100644
@@ -32,6 +32,11 @@ config S5PV210_SETUP_FB_24BPP
 	help
           Common setup code for S5PV210 with an 24bpp RGB display helper.
 
+config S5PV210_SETUP_KEYPAD
+	bool
+	help
+	  Common setup code for keypad.
+
 config S5PV210_SETUP_SDHCI
         bool
         select S5PV210_SETUP_SDHCI_GPIO
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

Quoted 15 lines

index 30be9a6..aae592a 100644

arch/arm/mach-s5pv210/Makefile +1 -0
@@ -31,5 +31,6 @@ obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-onenand.o
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
+obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
arch/arm/mach-s5pv210/cpu.c +0 -0
index 411a4a9..a3034ac 100644

arch/arm/mach-s5pv210/cpu.c void __init s5pv210_map_io(void) · line 86

Quoted 7 lines
arch/arm/mach-s5pv210/cpu.c +4 -0
@@ -80,6 +80,10 @@ void __init s5pv210_map_io(void)
 	s3c_device_adc.name	= "s3c64xx-adc";
 #endif
 
+#ifdef CONFIG_SAMSUNG_DEV_KEYPAD
+	samsung_device_keypad.name = "s5pv210-keypad";
+#endif
+

Please use one method. See Kyungmin Park's prev. comments on the subject.

Review

Quoted 25 lines
arch/arm/mach-s5pv210/cpu.c +0 -0
 	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
 
 	/* initialise device information early */
arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/map.h +0 -0

s5pv210/include/mach/map.h
index 34eb168..e2f6e2a 100644

arch/arm/mach-s5pv210/include/mach/map.h +3 -0
@@ -32,6 +32,8 @@
 #define S5PV210_PA_SPI0		0xE1300000
 #define S5PV210_PA_SPI1		0xE1400000
 
+#define S5PV210_PA_KEYPAD	(0xE1600000)
+
 #define S5PV210_PA_IIC0		(0xE1800000)
 #define S5PV210_PA_IIC1		(0xFAB00000)
 #define S5PV210_PA_IIC2		(0xE1A00000)
@@ -104,5 +106,6 @@
 #define S3C_PA_WDT		S5PV210_PA_WATCHDOG
 
 #define SAMSUNG_PA_ADC		S5PV210_PA_ADC
+#define SAMSUNG_PA_KEYPAD	S5PV210_PA_KEYPAD
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/setup-

arch/arm/mach-s5pv210/setup-keypad.c line 7

Quoted 13 lines

keypad.c
new file mode 100644
index 0000000..f51bf8d

arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/mach-s5pv210/setup-keypad.c
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ * Author: Joonyoung Shim <[email protected]>
+ *
+ *  This program is free software; you can redistribute  it and/or modify

it

arch/arm/mach-s5pv210/setup-keypad.c line 8

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  under  the terms of  the GNU General  Public License as published by

the

arch/arm/mach-s5pv210/setup-keypad.c line 9

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  Free Software Foundation;  either version 2 of the  License, or (at

your

arch/arm/mach-s5pv210/setup-keypad.c line 21

Quoted 12 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +12 -0
+ *  option) any later version.
+ *
+ */
+
+#include <linux/gpio.h>
+#include <plat/gpio-cfg.h>
+
+void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
+{
+	unsigned int gpio, end;
+
+	/* Set all the necessary GPH3 pins to special-function 3 */

What's the special-function 3?
How about 'special function KP_ROWs'?

arch/arm/mach-s5pv210/setup-keypad.c line 28

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
+	end = S5PV210_GPH3(rows);
+	for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+
+	/* Set all the necessary GPH2 pins to special-function 3 */

How about 'special function KP_COLs'?

arch/arm/mach-s5pv210/setup-keypad.c

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +6 -1
+	end = S5PV210_GPH2(cols);
+	for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+}
--

Thanks.

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

#3 lore raw

PATCH v4 2/3 ARM: S5PV210: Add keypad device helpers

Quoted 51 lines · Kukjin Kim

Review

Quoted 31 lines · Joonyoung Shim

This patch adds the keypad device platform helpers for S5PV210 cpu.

---
 arch/arm/mach-s5pv210/Kconfig            |    5 ++++
 arch/arm/mach-s5pv210/Makefile           |    1 +
 arch/arm/mach-s5pv210/cpu.c              |    4 +++
 arch/arm/mach-s5pv210/include/mach/map.h |    3 ++
 arch/arm/mach-s5pv210/setup-keypad.c     |   34
++++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-keypad.c
arch/arm/mach-s5pv210/Kconfig +5 -0
index 0761eac..692d01c 100644
@@ -32,6 +32,11 @@ config S5PV210_SETUP_FB_24BPP
 	help
           Common setup code for S5PV210 with an 24bpp RGB display helper.
 
+config S5PV210_SETUP_KEYPAD
+	bool
+	help
+	  Common setup code for keypad.
+
 config S5PV210_SETUP_SDHCI
         bool
         select S5PV210_SETUP_SDHCI_GPIO
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

Quoted 18 lines

index 30be9a6..aae592a 100644

arch/arm/mach-s5pv210/Makefile +1 -0
@@ -31,5 +31,6 @@ obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-onenand.o
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
+obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
arch/arm/mach-s5pv210/cpu.c +0 -0
index 411a4a9..a3034ac 100644
@@ -80,6 +80,10 @@ void __init s5pv210_map_io(void)
 	s3c_device_adc.name	= "s3c64xx-adc";
 #endif
 
Quoted 7 lines

arch/arm/mach-s5pv210/cpu.c void __init s5pv210_map_io(void) · line 86

Quoted 4 lines
arch/arm/mach-s5pv210/cpu.c +4 -0
+#ifdef CONFIG_SAMSUNG_DEV_KEYPAD
+	samsung_device_keypad.name = "s5pv210-keypad";
+#endif
+

Please use one method. See Kyungmin Park's prev. comments on the subject.

I cannot understand this comment meaning and where is Kyungmin's comments? Please let me know detailed thing.

Quoted 44 lines

Review

Quoted 25 lines
arch/arm/mach-s5pv210/cpu.c +0 -0
 	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
 
 	/* initialise device information early */
arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/map.h +0 -0

s5pv210/include/mach/map.h
index 34eb168..e2f6e2a 100644

arch/arm/mach-s5pv210/include/mach/map.h +3 -0
@@ -32,6 +32,8 @@
 #define S5PV210_PA_SPI0		0xE1300000
 #define S5PV210_PA_SPI1		0xE1400000
 
+#define S5PV210_PA_KEYPAD	(0xE1600000)
+
 #define S5PV210_PA_IIC0		(0xE1800000)
 #define S5PV210_PA_IIC1		(0xFAB00000)
 #define S5PV210_PA_IIC2		(0xE1A00000)
@@ -104,5 +106,6 @@
 #define S3C_PA_WDT		S5PV210_PA_WATCHDOG
 
 #define SAMSUNG_PA_ADC		S5PV210_PA_ADC
+#define SAMSUNG_PA_KEYPAD	S5PV210_PA_KEYPAD
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/setup-

arch/arm/mach-s5pv210/setup-keypad.c line 7

Quoted 13 lines

keypad.c
new file mode 100644
index 0000000..f51bf8d

arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/mach-s5pv210/setup-keypad.c
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ * Author: Joonyoung Shim <[email protected]>
+ *
+ *  This program is free software; you can redistribute  it and/or modify

it

arch/arm/mach-s5pv210/setup-keypad.c line 8

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  under  the terms of  the GNU General  Public License as published by

the

arch/arm/mach-s5pv210/setup-keypad.c line 9

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  Free Software Foundation;  either version 2 of the  License, or (at

your

Quoted 14 lines

arch/arm/mach-s5pv210/setup-keypad.c line 21

Quoted 12 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +12 -0
+ *  option) any later version.
+ *
+ */
+
+#include <linux/gpio.h>
+#include <plat/gpio-cfg.h>
+
+void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
+{
+	unsigned int gpio, end;
+
+	/* Set all the necessary GPH3 pins to special-function 3 */

What's the special-function 3?

I refered s3c_gpio_cfgpin() comments of
arch/arm/plat-samsung/include/plat/gpio-cfg.h

I think this is enough comments but if you want more specific comments still, i can add it.

Thanks.

Quoted 30 lines

How about 'special function KP_ROWs'?

arch/arm/mach-s5pv210/setup-keypad.c line 28

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
+	end = S5PV210_GPH3(rows);
+	for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+
+	/* Set all the necessary GPH2 pins to special-function 3 */

How about 'special function KP_COLs'?

arch/arm/mach-s5pv210/setup-keypad.c

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +6 -1
+	end = S5PV210_GPH2(cols);
+	for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+}
--

Thanks.

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

#4 lore raw

PATCH v4 2/3 ARM: S5PV210: Add keypad device helpers

Quoted 63 lines · Joonyoung Shim
Quoted 15 lines · Kukjin Kim
Quoted 14 lines · Joonyoung Shim

This patch adds the keypad device platform helpers for S5PV210 cpu.

---
 arch/arm/mach-s5pv210/Kconfig            |    5 ++++
 arch/arm/mach-s5pv210/Makefile           |    1 +
 arch/arm/mach-s5pv210/cpu.c              |    4 +++
 arch/arm/mach-s5pv210/include/mach/map.h |    3 ++
 arch/arm/mach-s5pv210/setup-keypad.c     |   34
++++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-keypad.c
Quoted 7 lines

arch/arm/mach-s5pv210/Kconfig config S5PV210_SETUP_FB_24BPP · line 33

Quoted 7 lines
arch/arm/mach-s5pv210/Kconfig +0 -0
index 0761eac..692d01c 100644
@@ -32,6 +32,11 @@ config S5PV210_SETUP_FB_24BPP
 	help
           Common setup code for S5PV210 with an 24bpp RGB display

helper.

Quoted 11 lines

Review

Quoted 10 lines
arch/arm/mach-s5pv210/Kconfig +5 -0
+config S5PV210_SETUP_KEYPAD
+	bool
+	help
+	  Common setup code for keypad.
+
 config S5PV210_SETUP_SDHCI
         bool
         select S5PV210_SETUP_SDHCI_GPIO
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

Quoted 4 lines

arch/arm/mach-s5pv210/Makefile obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-

Quoted 4 lines

index 30be9a6..aae592a 100644

arch/arm/mach-s5pv210/Makefile +0 -0
@@ -31,5 +31,6 @@ obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-

onenand.o

Quoted 14 lines
Quoted 14 lines
arch/arm/mach-s5pv210/Makefile +1 -0
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
+obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
arch/arm/mach-s5pv210/cpu.c +0 -0
index 411a4a9..a3034ac 100644
@@ -80,6 +80,10 @@ void __init s5pv210_map_io(void)
 	s3c_device_adc.name	= "s3c64xx-adc";
 #endif
 
Quoted 7 lines

arch/arm/mach-s5pv210/cpu.c void __init s5pv210_map_io(void) · line 86

Quoted 4 lines
arch/arm/mach-s5pv210/cpu.c +4 -0
+#ifdef CONFIG_SAMSUNG_DEV_KEYPAD
+	samsung_device_keypad.name = "s5pv210-keypad";
+#endif
+

Please use one method. See Kyungmin Park's prev. comments on the subject.

Quoted 3 lines

I cannot understand this comment meaning and where is Kyungmin's comments? Please let me know detailed thing.

Please refer to below URLs.

Kyungmin Park's comment:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/015634.html

Ben Dooks' comment:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/016519.html

And you can find similar case in the CFCON and TSADC patches for Samsung SoCs.

Quoted 59 lines
Quoted 44 lines

Review

Quoted 25 lines
arch/arm/mach-s5pv210/cpu.c +0 -0
 	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
 
 	/* initialise device information early */
arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/map.h +0 -0

s5pv210/include/mach/map.h
index 34eb168..e2f6e2a 100644

arch/arm/mach-s5pv210/include/mach/map.h +3 -0
@@ -32,6 +32,8 @@
 #define S5PV210_PA_SPI0		0xE1300000
 #define S5PV210_PA_SPI1		0xE1400000
 
+#define S5PV210_PA_KEYPAD	(0xE1600000)
+
 #define S5PV210_PA_IIC0		(0xE1800000)
 #define S5PV210_PA_IIC1		(0xFAB00000)
 #define S5PV210_PA_IIC2		(0xE1A00000)
@@ -104,5 +106,6 @@
 #define S3C_PA_WDT		S5PV210_PA_WATCHDOG
 
 #define SAMSUNG_PA_ADC		S5PV210_PA_ADC
+#define SAMSUNG_PA_KEYPAD	S5PV210_PA_KEYPAD
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/setup-

arch/arm/mach-s5pv210/setup-keypad.c line 7

Quoted 13 lines

keypad.c
new file mode 100644
index 0000000..f51bf8d

arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/mach-s5pv210/setup-keypad.c
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ * Author: Joonyoung Shim <[email protected]>
+ *
+ *  This program is free software; you can redistribute  it and/or modify

it

arch/arm/mach-s5pv210/setup-keypad.c line 8

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  under  the terms of  the GNU General  Public License as published by

the

arch/arm/mach-s5pv210/setup-keypad.c line 9

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  Free Software Foundation;  either version 2 of the  License, or (at

your

Quoted 14 lines

arch/arm/mach-s5pv210/setup-keypad.c line 21

Quoted 12 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +12 -0
+ *  option) any later version.
+ *
+ */
+
+#include <linux/gpio.h>
+#include <plat/gpio-cfg.h>
+
+void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
+{
+	unsigned int gpio, end;
+
+	/* Set all the necessary GPH3 pins to special-function 3 */

What's the special-function 3?

Quoted 6 lines

I refered s3c_gpio_cfgpin() comments of
arch/arm/plat-samsung/include/plat/gpio-cfg.h

I think this is enough comments but if you want more specific comments still, i can add it.

Hmm..just minor comment to easily reading.

Quoted 25 lines

Thanks.

Quoted 23 lines

How about 'special function KP_ROWs'?

arch/arm/mach-s5pv210/setup-keypad.c line 28

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
+	end = S5PV210_GPH3(rows);
+	for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+
+	/* Set all the necessary GPH2 pins to special-function 3 */

How about 'special function KP_COLs'?

arch/arm/mach-s5pv210/setup-keypad.c

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +6 -1
+	end = S5PV210_GPH2(cols);
+	for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+}
--

Thanks.

Thanks.

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

#5 lore raw

PATCH v4 2/3 ARM: S5PV210: Add keypad device helpers

Quoted 65 lines · Kukjin Kim
Quoted 53 lines · Joonyoung Shim
Quoted 15 lines · Kukjin Kim
Quoted 14 lines · Joonyoung Shim

This patch adds the keypad device platform helpers for S5PV210 cpu.

---
 arch/arm/mach-s5pv210/Kconfig            |    5 ++++
 arch/arm/mach-s5pv210/Makefile           |    1 +
 arch/arm/mach-s5pv210/cpu.c              |    4 +++
 arch/arm/mach-s5pv210/include/mach/map.h |    3 ++
 arch/arm/mach-s5pv210/setup-keypad.c     |   34
++++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/setup-keypad.c
Quoted 7 lines

arch/arm/mach-s5pv210/Kconfig config S5PV210_SETUP_FB_24BPP · line 33

Quoted 7 lines
arch/arm/mach-s5pv210/Kconfig +0 -0
index 0761eac..692d01c 100644
@@ -32,6 +32,11 @@ config S5PV210_SETUP_FB_24BPP
 	help
           Common setup code for S5PV210 with an 24bpp RGB display

helper.

Quoted 10 lines

Review

Quoted 9 lines
arch/arm/mach-s5pv210/Kconfig +5 -0
+config S5PV210_SETUP_KEYPAD
+	bool
+	help
+	  Common setup code for keypad.
+
 config S5PV210_SETUP_SDHCI
         bool
         select S5PV210_SETUP_SDHCI_GPIO
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

Quoted 4 lines

arch/arm/mach-s5pv210/Makefile obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-

Quoted 4 lines

index 30be9a6..aae592a 100644

arch/arm/mach-s5pv210/Makefile +0 -0
@@ -31,5 +31,6 @@ obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-

onenand.o

Quoted 14 lines
Quoted 14 lines
arch/arm/mach-s5pv210/Makefile +1 -0
 obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
+obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
arch/arm/mach-s5pv210/cpu.c +0 -0
index 411a4a9..a3034ac 100644
@@ -80,6 +80,10 @@ void __init s5pv210_map_io(void)
 	s3c_device_adc.name	= "s3c64xx-adc";
 #endif
 
Quoted 9 lines
Quoted 6 lines

arch/arm/mach-s5pv210/cpu.c void __init s5pv210_map_io(void) · line 86

Quoted 4 lines
arch/arm/mach-s5pv210/cpu.c +4 -0
+#ifdef CONFIG_SAMSUNG_DEV_KEYPAD
+	samsung_device_keypad.name = "s5pv210-keypad";
+#endif
+

Please use one method. See Kyungmin Park's prev. comments on the subject.

I cannot understand this comment meaning and where is Kyungmin's comments? Please let me know detailed thing.

Please refer to below URLs.

Quoted 8 lines

Kyungmin Park's comment:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/015634.html

Ben Dooks' comment:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/016519.html

And you can find similar case in the CFCON and TSADC patches for Samsung SoCs.

OK. I see and will use wrapper function.

Quoted 57 lines
Quoted 57 lines
Quoted 57 lines

Review

Quoted 25 lines
arch/arm/mach-s5pv210/cpu.c +0 -0
 	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
 
 	/* initialise device information early */
arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/map.h +0 -0

s5pv210/include/mach/map.h
index 34eb168..e2f6e2a 100644

arch/arm/mach-s5pv210/include/mach/map.h +3 -0
@@ -32,6 +32,8 @@
 #define S5PV210_PA_SPI0		0xE1300000
 #define S5PV210_PA_SPI1		0xE1400000
 
+#define S5PV210_PA_KEYPAD	(0xE1600000)
+
 #define S5PV210_PA_IIC0		(0xE1800000)
 #define S5PV210_PA_IIC1		(0xFAB00000)
 #define S5PV210_PA_IIC2		(0xE1A00000)
@@ -104,5 +106,6 @@
 #define S3C_PA_WDT		S5PV210_PA_WATCHDOG
 
 #define SAMSUNG_PA_ADC		S5PV210_PA_ADC
+#define SAMSUNG_PA_KEYPAD	S5PV210_PA_KEYPAD
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/setup-

arch/arm/mach-s5pv210/setup-keypad.c line 7

Quoted 13 lines

keypad.c
new file mode 100644
index 0000000..f51bf8d

arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/mach-s5pv210/setup-keypad.c
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ * Author: Joonyoung Shim <[email protected]>
+ *
+ *  This program is free software; you can redistribute  it and/or modify

it

arch/arm/mach-s5pv210/setup-keypad.c line 8

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  under  the terms of  the GNU General  Public License as published by

the

arch/arm/mach-s5pv210/setup-keypad.c line 9

Quoted 1 line
arch/arm/mach-s5pv210/setup-keypad.c new file +1 -0
+ *  Free Software Foundation;  either version 2 of the  License, or (at

your

arch/arm/mach-s5pv210/setup-keypad.c line 21

Quoted 12 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +12 -0
+ *  option) any later version.
+ *
+ */
+
+#include <linux/gpio.h>
+#include <plat/gpio-cfg.h>
+
+void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
+{
+	unsigned int gpio, end;
+
+	/* Set all the necessary GPH3 pins to special-function 3 */

What's the special-function 3?

Quoted 8 lines
Quoted 6 lines

I refered s3c_gpio_cfgpin() comments of
arch/arm/plat-samsung/include/plat/gpio-cfg.h

I think this is enough comments but if you want more specific comments still, i can add it.

Hmm..just minor comment to easily reading.

OK. I will add it.

Quoted 33 lines
Quoted 23 lines

Thanks.

Quoted 21 lines

How about 'special function KP_ROWs'?

arch/arm/mach-s5pv210/setup-keypad.c line 28

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +7 -0
+	end = S5PV210_GPH3(rows);
+	for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+
+	/* Set all the necessary GPH2 pins to special-function 3 */

How about 'special function KP_COLs'?

arch/arm/mach-s5pv210/setup-keypad.c

Quoted 7 lines
arch/arm/mach-s5pv210/setup-keypad.c new file +6 -1
+	end = S5PV210_GPH2(cols);
+	for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+}
--

Thanks.

Thanks.

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

#6 lore raw

PATCH v4 3/3 input: samsung-keypad - Add samsung keypad driver

In reply to Joonyoung Shim

This patch adds support for keypad driver running on Samsung cpus. This driver is tested on GONI and Aquila board using S5PC110 cpu.

---
 drivers/input/keyboard/Kconfig          |    9 +
 drivers/input/keyboard/Makefile         |    1 +
 drivers/input/keyboard/samsung-keypad.c |  400 +++++++++++++++++++++++++++++++
 3 files changed, 410 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/keyboard/samsung-keypad.c
drivers/input/keyboard/Kconfig +9 -0
index d8fa5d7..bf6a50f 100644
@@ -342,6 +342,15 @@ config KEYBOARD_PXA930_ROTARY
 	  To compile this driver as a module, choose M here: the
 	  module will be called pxa930_rotary.
 
+config KEYBOARD_SAMSUNG
+	tristate "Samsung keypad support"
+	depends on SAMSUNG_DEV_KEYPAD
+	help
+	  Say Y here if you want to use the Samsung keypad.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called samsung-keypad.
+
 config KEYBOARD_STOWAWAY
 	tristate "Stowaway keyboard"
 	select SERIO
drivers/input/keyboard/Makefile +1 -0
index 4596d0c..8f973ed 100644
@@ -32,6 +32,7 @@ obj-$(CONFIG_KEYBOARD_OPENCORES)	+= opencores-kbd.o
 obj-$(CONFIG_KEYBOARD_PXA27x)		+= pxa27x_keypad.o
 obj-$(CONFIG_KEYBOARD_PXA930_ROTARY)	+= pxa930_rotary.o
 obj-$(CONFIG_KEYBOARD_QT2160)		+= qt2160.o
+obj-$(CONFIG_KEYBOARD_SAMSUNG)		+= samsung-keypad.o
 obj-$(CONFIG_KEYBOARD_SH_KEYSC)		+= sh_keysc.o
 obj-$(CONFIG_KEYBOARD_STOWAWAY)		+= stowaway.o
 obj-$(CONFIG_KEYBOARD_SUNKBD)		+= sunkbd.o
drivers/input/keyboard/samsung-keypad.c new file +400 -0

400 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#7 lore raw

PATCH v4 3/3 input: samsung-keypad - Add samsung keypad driver

Quoted 12 lines · Joonyoung Shim

This patch adds support for keypad driver running on Samsung cpus. This driver is tested on GONI and Aquila board using S5PC110 cpu.

---
 drivers/input/keyboard/Kconfig          |    9 +
 drivers/input/keyboard/Makefile         |    1 +
 drivers/input/keyboard/samsung-keypad.c |  400 +++++++++++++++++++++++++++++++
 3 files changed, 410 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/keyboard/samsung-keypad.c

Hi,

Dmitry and Kukjin, any feedback on this?