diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2010-01-19 01:30:54 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-19 04:37:18 -0500 |
commit | 1f323cfda5feee4e9c1fc09ededaee849f906468 (patch) | |
tree | 89c288fd8a5fe2c0cad1c39c5b752f162ff69e46 /arch/arm/plat-s3c | |
parent | 9717453c40ba9ffbd8c40968df45498059bfec0e (diff) |
ARM: SAMSUNG: Move GPIO common functions to plat-samsung
This patch moves GPIO common functions (from plat-s3c64xx) into plat-samsung.
and adds the config option to build the plat-samsung/gpiolib for Samsung SoCs.
Signed-off-by: Adityapratap Sharma <aditya.ps@samsung.com>
Signed-off-by: Atul Dahiya <atul.dahiya@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c')
-rw-r--r-- | arch/arm/plat-s3c/include/plat/gpio-core.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/include/plat/gpio-core.h b/arch/arm/plat-s3c/include/plat/gpio-core.h index 32af612767aa..94fed584d5ae 100644 --- a/arch/arm/plat-s3c/include/plat/gpio-core.h +++ b/arch/arm/plat-s3c/include/plat/gpio-core.h | |||
@@ -11,6 +11,11 @@ | |||
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define GPIOCON_OFF (0x00) | ||
15 | #define GPIODAT_OFF (0x04) | ||
16 | |||
17 | #define con_4bit_shift(__off) ((__off) * 4) | ||
18 | |||
14 | /* Define the core gpiolib support functions that the s3c platforms may | 19 | /* Define the core gpiolib support functions that the s3c platforms may |
15 | * need to extend or change depending on the hardware and the s3c chip | 20 | * need to extend or change depending on the hardware and the s3c chip |
16 | * selected at build or found at run time. | 21 | * selected at build or found at run time. |
@@ -80,6 +85,29 @@ extern void s3c_gpiolib_add(struct s3c_gpio_chip *chip); | |||
80 | * and any other necessary functions. | 85 | * and any other necessary functions. |
81 | */ | 86 | */ |
82 | 87 | ||
88 | /** | ||
89 | * samsung_gpiolib_add_4bit_chips - 4bit single register GPIO config. | ||
90 | * @chip: The gpio chip that is being configured. | ||
91 | * @nr_chips: The no of chips (gpio ports) for the GPIO being configured. | ||
92 | * | ||
93 | * This helper deal with the GPIO cases where the control register has 4 bits | ||
94 | * of control per GPIO, generally in the form of: | ||
95 | * 0000 = Input | ||
96 | * 0001 = Output | ||
97 | * others = Special functions (dependant on bank) | ||
98 | * | ||
99 | * Note, since the code to deal with the case where there are two control | ||
100 | * registers instead of one, we do not have a seperate set of function | ||
101 | * (samsung_gpiolib_add_4bit2_chips)for each case. | ||
102 | */ | ||
103 | extern void samsung_gpiolib_add_4bit_chips(struct s3c_gpio_chip *chip, | ||
104 | int nr_chips); | ||
105 | extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip, | ||
106 | int nr_chips); | ||
107 | |||
108 | extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip); | ||
109 | extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip); | ||
110 | |||
83 | #ifdef CONFIG_S3C_GPIO_TRACK | 111 | #ifdef CONFIG_S3C_GPIO_TRACK |
84 | extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; | 112 | extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; |
85 | 113 | ||