Skip to contentSkip to conversation

ARM: S5P6440: Add S5P6440 GPIO support

PATCH Applied Kukjin Kim 2 participants 2 messages Jan 15, 2010 – Jan 18, 2010

Subsystems (3)

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

PATCH v2 1/1 ARM: S5P6440: Add S5P6440 GPIO support

This patch adds Samsung's S5P6440 GPIO support.

Changes since v1:

Address comments from Ben

---
 arch/arm/mach-s5p6440/Makefile                 |    2 +-
 arch/arm/mach-s5p6440/include/mach/gpio-core.h |   40 +++
 arch/arm/mach-s5p6440/include/mach/regs-gpio.h |   54 ++++
 arch/arm/mach-s5p6440/s5p6440-gpio.c           |  325 ++++++++++++++++++++++++
 arch/arm/plat-s5p/Kconfig                      |    4 +
 5 files changed, 424 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-s5p6440/include/mach/regs-gpio.h
 create mode 100644 arch/arm/mach-s5p6440/s5p6440-gpio.c
arch/arm/mach-s5p6440/Makefile +1 -1
index a3ffda9..a79b130 100644
@@ -12,7 +12,7 @@ obj-				:=
 
 # Core support for S5P6440 system
 
-obj-$(CONFIG_CPU_S5P6440)	+= cpu.o
+obj-$(CONFIG_CPU_S5P6440)	+= cpu.o s5p6440-gpio.o
 
 # machine support
 
arch/arm/mach-s5p6440/include/mach/gpio-core.h +40 -0
index ff7fb30..b6368df 100644
@@ -16,4 +16,44 @@
 /* currently we just include the platform support */
 #include <plat/gpio-core.h>
 
+#define con_4bit_shift(__off) ((__off) * 4)
+
+/* various helper functions added which are specific to PLAT_S5P platform */
+
+/**
+ * s5p6440_gpiolib_set_cfg - S5P style GPIO configuration
+ * @chip: The gpio chip that is being configured.
+ * @nr_chips: no of chips (gpio ports) for the GPIO being configured.
+*/
+extern void s5p6440_gpiolib_set_cfg(struct s3c_gpio_cfg *chipcfg, int nr_chips);
+
+/**
+ * samsung_gpiolib_add_4bit_chips - 4bit single register GPIO config.
+ * @chip: The gpio chip that is being configured.
+ * @nr_chips: The no of chips (gpio ports) for the GPIO being configured.
+ *
+ * This helper deal with the GPIO cases where the control register has 4 bits
+ * of control per GPIO, generally in the form of:
+ * 0000 = Input
+ * 0001 = Output
+ * others = Special functions (dependant on bank)
+ *
+ * Note, since the code to deal with the case where there are two control
+ * registers instead of one, we do not have a seperate set of function
+ * (samsung_gpiolib_add_4bit2_chips)for each case.
+ */
+extern void samsung_gpiolib_add_4bit_chips(struct s3c_gpio_chip *chip,
+					   int nr_chips);
+extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip,
+					    int nr_chips);
+
+/**
+ * s5p6440_gpio_setcfg_4bit_rbank - S5P64XX 4bit single register GPIO config.
+ * @chip: The gpio chip that is being configured (always R).
+ * @off: The offset for the GPIO being configured.
+ * @cfg: The configuration value to set.
+ *
+ */
+extern int s5p6440_gpio_setcfg_4bit_rbank(struct s3c_gpio_chip *chip,
+					  unsigned int off, unsigned int cfg);
 #endif /* __ASM_ARCH_GPIO_CORE_H */
arch/arm/mach-s5p6440/include/mach/regs-gpio.h new file +54 -0

54 lines not on this page · raw message

arch/arm/mach-s5p6440/s5p6440-gpio.c new file +325 -0

325 lines not on this page · raw message

arch/arm/plat-s5p/Kconfig +4 -0
index 7e08b40..9d8686c 100644
@@ -14,6 +14,10 @@ config PLAT_S5P
 	select NO_IOPORT
 	select ARCH_REQUIRE_GPIOLIB
 	select S3C_GPIO_TRACK
+	select SAMSUNG_GPIOLIB
+	select S3C_GPIO_CFG_S3C64XX
+	select S3C_GPIO_PULL_UPDOWN
+	select S3C_GPIO_CFG_S3C24XX
 	select PLAT_SAMSUNG
 	select SAMSUNG_CLKSRC
 	select SAMSUNG_IRQ_VIC_TIMER
Signature · 1 line
1.6.2.5
Applied
#1 lore raw

Applied to next-samsung-gpio1

Signature · 4 lines
Ben

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