diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2011-03-10 07:49:31 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-03-11 01:49:00 -0500 |
commit | 0048a17348645f18cf209483e1f8e46a6dbec971 (patch) | |
tree | 449450e1f255d363b37b5aabaa0e567be7bfab78 /arch/arm | |
parent | 6d2f42cc275ba72a47ce6933b18480163ecf2740 (diff) |
ARM: S5P: Add platform helpers for camera GPIO configuration
Add functions for configuration of the parallel camera
bus pins on S5PV210 and Exynos4 SoC.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-exynos4/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/setup-fimc.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-fimc.c | 43 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/camport.h | 28 |
7 files changed, 127 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index 82195a9a4c61..8d7398fdd05c 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig | |||
@@ -76,6 +76,11 @@ config EXYNOS4_SETUP_SDHCI_GPIO | |||
76 | help | 76 | help |
77 | Common setup code for SDHCI gpio. | 77 | Common setup code for SDHCI gpio. |
78 | 78 | ||
79 | config EXYNOS4_SETUP_FIMC | ||
80 | bool | ||
81 | help | ||
82 | Common setup code for the camera interfaces. | ||
83 | |||
79 | # machine support | 84 | # machine support |
80 | 85 | ||
81 | menu "EXYNOS4 Machines" | 86 | menu "EXYNOS4 Machines" |
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile index 56e367b48fbb..69a4a28dc95e 100644 --- a/arch/arm/mach-exynos4/Makefile +++ b/arch/arm/mach-exynos4/Makefile | |||
@@ -41,6 +41,7 @@ obj-y += dev-audio.o | |||
41 | obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o | 41 | obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o |
42 | obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o | 42 | obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o |
43 | 43 | ||
44 | obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o | ||
44 | obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o | 45 | obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o |
45 | obj-$(CONFIG_EXYNOS4_SETUP_I2C2) += setup-i2c2.o | 46 | obj-$(CONFIG_EXYNOS4_SETUP_I2C2) += setup-i2c2.o |
46 | obj-$(CONFIG_EXYNOS4_SETUP_I2C3) += setup-i2c3.o | 47 | obj-$(CONFIG_EXYNOS4_SETUP_I2C3) += setup-i2c3.o |
diff --git a/arch/arm/mach-exynos4/setup-fimc.c b/arch/arm/mach-exynos4/setup-fimc.c new file mode 100644 index 000000000000..6a45078d9d12 --- /dev/null +++ b/arch/arm/mach-exynos4/setup-fimc.c | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
3 | * | ||
4 | * Exynos4 camera interface GPIO configuration. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/gpio.h> | ||
12 | #include <plat/gpio-cfg.h> | ||
13 | #include <plat/camport.h> | ||
14 | |||
15 | int exynos4_fimc_setup_gpio(enum s5p_camport_id id) | ||
16 | { | ||
17 | u32 gpio8, gpio5; | ||
18 | u32 sfn; | ||
19 | int ret; | ||
20 | |||
21 | switch (id) { | ||
22 | case S5P_CAMPORT_A: | ||
23 | gpio8 = EXYNOS4_GPJ0(0); /* PCLK, VSYNC, HREF, DATA[0:4] */ | ||
24 | gpio5 = EXYNOS4_GPJ1(0); /* DATA[5:7], CLKOUT, FIELD */ | ||
25 | sfn = S3C_GPIO_SFN(2); | ||
26 | break; | ||
27 | |||
28 | case S5P_CAMPORT_B: | ||
29 | gpio8 = EXYNOS4_GPE0(0); /* DATA[0:7] */ | ||
30 | gpio5 = EXYNOS4_GPE1(0); /* PCLK, VSYNC, HREF, CLKOUT, FIELD */ | ||
31 | sfn = S3C_GPIO_SFN(3); | ||
32 | break; | ||
33 | |||
34 | default: | ||
35 | WARN(1, "Wrong camport id: %d\n", id); | ||
36 | return -EINVAL; | ||
37 | } | ||
38 | |||
39 | ret = s3c_gpio_cfgall_range(gpio8, 8, sfn, S3C_GPIO_PULL_UP); | ||
40 | if (ret) | ||
41 | return ret; | ||
42 | |||
43 | return s3c_gpio_cfgall_range(gpio5, 5, sfn, S3C_GPIO_PULL_UP); | ||
44 | } | ||
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index d7fd031f6015..7f015bbba853 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig | |||
@@ -53,6 +53,11 @@ config S5PV210_SETUP_SDHCI_GPIO | |||
53 | help | 53 | help |
54 | Common setup code for SDHCI gpio. | 54 | Common setup code for SDHCI gpio. |
55 | 55 | ||
56 | config S5PV210_SETUP_FIMC | ||
57 | bool | ||
58 | help | ||
59 | Common setup code for the camera interfaces. | ||
60 | |||
56 | menu "S5PC110 Machines" | 61 | menu "S5PC110 Machines" |
57 | 62 | ||
58 | config MACH_AQUILA | 63 | config MACH_AQUILA |
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index ff1a0db57a2f..11f17907b4e8 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile | |||
@@ -31,6 +31,7 @@ obj-y += dev-audio.o | |||
31 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o | 31 | obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o |
32 | 32 | ||
33 | obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o | 33 | obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o |
34 | obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o | ||
34 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o | 35 | obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o |
35 | obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o | 36 | obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o |
36 | obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o | 37 | obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o |
diff --git a/arch/arm/mach-s5pv210/setup-fimc.c b/arch/arm/mach-s5pv210/setup-fimc.c new file mode 100644 index 000000000000..54cc5b11be0b --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-fimc.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
3 | * | ||
4 | * S5PV210 camera interface GPIO configuration. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/gpio.h> | ||
12 | #include <plat/gpio-cfg.h> | ||
13 | #include <plat/camport.h> | ||
14 | |||
15 | int s5pv210_fimc_setup_gpio(enum s5p_camport_id id) | ||
16 | { | ||
17 | u32 gpio8, gpio5; | ||
18 | int ret; | ||
19 | |||
20 | switch (id) { | ||
21 | case S5P_CAMPORT_A: | ||
22 | gpio8 = S5PV210_GPE0(0); | ||
23 | gpio5 = S5PV210_GPE1(0); | ||
24 | break; | ||
25 | |||
26 | case S5P_CAMPORT_B: | ||
27 | gpio8 = S5PV210_GPJ0(0); | ||
28 | gpio5 = S5PV210_GPJ1(0); | ||
29 | break; | ||
30 | |||
31 | default: | ||
32 | WARN(1, "Wrong camport id: %d\n", id); | ||
33 | return -EINVAL; | ||
34 | } | ||
35 | |||
36 | ret = s3c_gpio_cfgall_range(gpio8, 8, S3C_GPIO_SFN(2), | ||
37 | S3C_GPIO_PULL_UP); | ||
38 | if (ret) | ||
39 | return ret; | ||
40 | |||
41 | return s3c_gpio_cfgall_range(gpio5, 5, S3C_GPIO_SFN(2), | ||
42 | S3C_GPIO_PULL_UP); | ||
43 | } | ||
diff --git a/arch/arm/plat-s5p/include/plat/camport.h b/arch/arm/plat-s5p/include/plat/camport.h new file mode 100644 index 000000000000..71688c8ba288 --- /dev/null +++ b/arch/arm/plat-s5p/include/plat/camport.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
3 | * | ||
4 | * S5P series camera interface helper functions | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef PLAT_S5P_CAMPORT_H_ | ||
12 | #define PLAT_S5P_CAMPORT_H_ __FILE__ | ||
13 | |||
14 | enum s5p_camport_id { | ||
15 | S5P_CAMPORT_A, | ||
16 | S5P_CAMPORT_B, | ||
17 | }; | ||
18 | |||
19 | /* | ||
20 | * The helper functions to configure GPIO for the camera parallel bus. | ||
21 | * The camera port can be multiplexed with any FIMC entity, even multiple | ||
22 | * FIMC entities are allowed to be attached to a single port simultaneously. | ||
23 | * These functions are to be used in the board setup code. | ||
24 | */ | ||
25 | int s5pv210_fimc_setup_gpio(enum s5p_camport_id id); | ||
26 | int exynos4_fimc_setup_gpio(enum s5p_camport_id id); | ||
27 | |||
28 | #endif | ||