diff options
author | Hyunwoong Kim <khw0178.kim@samsung.com> | 2010-08-02 19:34:39 +0900 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2011-11-16 21:48:21 -0800 |
commit | a6892024c26ca56b080ff85adf832d5286696e71 (patch) | |
tree | c69fd8b5e5c9675c3b7698133aa366e913d66583 | |
parent | 35a6e029db706e4c4f63bbe017a7aba294c8186b (diff) | |
download | kernel_samsung_crespo-a6892024c26ca56b080ff85adf832d5286696e71.zip kernel_samsung_crespo-a6892024c26ca56b080ff85adf832d5286696e71.tar.gz kernel_samsung_crespo-a6892024c26ca56b080ff85adf832d5286696e71.tar.bz2 |
S5PC110: HERRING: Added FIMC set up files and Modified machine files
Change-Id: Icffb4c9c6fbc2ee5a5027b54b0738b4352b0dc0e
Signed-off-by: Hyunwoong Kim <khw0178.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-s5pv210/Kconfig | 31 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/include/mach/map.h | 12 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-fimc0.c | 135 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-fimc1.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-fimc2.c | 21 |
6 files changed, 211 insertions, 12 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index f7341c0..a45901f 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -183,6 +183,7 @@ config MACH_S5PC110_CRESPO select S3C_DEV_WDT select S3C_DEV_I2C1 select S3C_DEV_I2C2 + select S5P_SETUP_MIPIPHY help Machine support for Samsung CRESPO S5PC110(MCP) is one of package option of S5PV210 @@ -194,19 +195,25 @@ config S5PV210_SETUP_FB help Common setup code for FIMD controller. -config ANDROID_PMEM_MEMSIZE_PMEM - int "The size of PMEM (android)" - depends on ANDROID_PMEM && MACH_S5PC110_CRESPO - default "16384" +config S5PV210_SETUP_FIMC0 + bool + depends on VIDEO_FIMC + default y + help + Common setup code for FIMC controller 0. -config ANDROID_PMEM_MEMSIZE_PMEM_GPU1 - int "The size of PMEM for GPU" - depends on ANDROID_PMEM && MACH_S5PC110_CRESPO - default "10240" +config S5PV210_SETUP_FIMC1 + bool + depends on VIDEO_FIMC + default y + help + Common setup code for FIMC controller 1. -config ANDROID_PMEM_MEMSIZE_PMEM_ADSP - int "The size of PMEM for ADSP" - depends on ANDROID_PMEM && MACH_S5PC110_CRESPO - default "1024" +config S5PV210_SETUP_FIMC2 + bool + depends on VIDEO_FIMC + default y + help + Common setup code for FIMC controller 2. endif diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index abd4975..dd6e337 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile @@ -39,3 +39,6 @@ obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.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 +obj-$(CONFIG_S5PV210_SETUP_FIMC0) += setup-fimc0.o +obj-$(CONFIG_S5PV210_SETUP_FIMC1) += setup-fimc1.o +obj-$(CONFIG_S5PV210_SETUP_FIMC2) += setup-fimc2.o diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index c14f594..4f11280 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h @@ -88,6 +88,18 @@ #define S5PV210_SZ_LCD SZ_1M #define S5P_SZ_LCD S5PV210_SZ_LCD +#define S5PV210_SZ_FIMC0 SZ_1M +#define S5P_SZ_FIMC0 S5PV210_SZ_FIMC0 +#define S5PV210_SZ_FIMC1 SZ_1M +#define S5P_SZ_FIMC1 S5PV210_SZ_FIMC1 +#define S5PV210_SZ_FIMC2 SZ_1M +#define S5P_SZ_FIMC2 S5PV210_SZ_FIMC2 + +#define S5PV210_PA_IPC (0xFB700000) +#define S5P_PA_IPC S5PV210_PA_IPC +#define S5PV210_SZ_IPC SZ_1M +#define S5P_SZ_IPC S5PV210_SZ_IPC + #define S5PV210_PA_VIC0 0xF2000000 #define S5PV210_PA_VIC1 0xF2100000 #define S5PV210_PA_VIC2 0xF2200000 diff --git a/arch/arm/mach-s5pv210/setup-fimc0.c b/arch/arm/mach-s5pv210/setup-fimc0.c new file mode 100644 index 0000000..f4f3c38 --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-fimc0.c @@ -0,0 +1,135 @@ +/* linux/arch/arm/mach-s5pv210/setup-fimc0.c + * + * Copyright (c) 2010 Samsung Electronics Co., Ltd. + * http://www.samsung.com/ + * + * Base FIMC 0 gpio configuration + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/gpio.h> +#include <linux/clk.h> +#include <linux/err.h> +#include <linux/platform_device.h> +#include <linux/io.h> +#include <plat/clock.h> +#include <plat/gpio-cfg.h> +#include <plat/map-s5p.h> +#include <mach/regs-gpio.h> +#include <mach/map.h> +#include <mach/pd.h> +#include <plat/regs-fimc.h> + +struct platform_device; /* don't need the contents */ + +void s3c_fimc0_cfg_gpio(struct platform_device *pdev) +{ + int i = 0; + + /* CAM A port(b0010) : PCLK, VSYNC, HREF, DATA[0-4] */ + for (i=0; i < 8; i++) { + s3c_gpio_cfgpin(S5PV210_GPE0(i), S3C_GPIO_SFN(2)); + s3c_gpio_setpull(S5PV210_GPE0(i), S3C_GPIO_PULL_NONE); + } + /* CAM A port(b0010) : DATA[5-7], CLKOUT(MIPI CAM also), FIELD */ + for (i=0; i < 4; i++) { + s3c_gpio_cfgpin(S5PV210_GPE1(i), S3C_GPIO_SFN(2)); + s3c_gpio_setpull(S5PV210_GPE1(i), S3C_GPIO_PULL_NONE); + } + +#if defined(CONFIG_MACH_SMDKC110) || defined(CONFIG_MACH_SMDKV210) + s3c_gpio_cfgpin(S5PV210_GPE1(4), S5PV210_GPE1_4_CAM_A_FIELD); + s3c_gpio_setpull(S5PV210_GPE1(4), S3C_GPIO_PULL_NONE); + + /* CAM B port(b0011) : DATA[0-7] */ + for (i=0; i < 8; i++) { + s3c_gpio_cfgpin(S5PV210_GPJ0(i), S3C_GPIO_SFN(3)); + s3c_gpio_setpull(S5PV210_GPJ0(i), S3C_GPIO_PULL_NONE); + } + /* CAM B port(b0011) : PCLK, VSYNC, HREF, FIELD, CLCKOUT */ + for (i=0; i < 5; i++) { + s3c_gpio_cfgpin(S5PV210_GPJ1(i), S3C_GPIO_SFN(3)); + s3c_gpio_setpull(S5PV210_GPJ1(i), S3C_GPIO_PULL_NONE); + } +#endif + + /* note : driver strength to max is unnecessary */ +} + +int s3c_fimc_clk_on(struct platform_device *pdev, struct clk *clk) +{ + struct clk *sclk_fimc_lclk = NULL; + struct clk *mout_fimc_lclk = NULL; + struct clk *mout_mpll = NULL; + int ret; + + mout_mpll = clk_get(&pdev->dev, "mout_mpll"); + if (IS_ERR(mout_mpll)) { + dev_err(&pdev->dev, "failed to get mout_mpll\n"); + goto err_clk1; + } + + mout_fimc_lclk = clk_get(&pdev->dev, "mout_fimc_lclk"); + if (IS_ERR(mout_fimc_lclk)) { + dev_err(&pdev->dev, "failed to get mout_fimc_lclk\n"); + goto err_clk2; + } + + sclk_fimc_lclk = clk_get(&pdev->dev, "fimc"); + if (IS_ERR(sclk_fimc_lclk)) { + dev_err(&pdev->dev, "failed to get sclk_fimc_lclk\n"); + goto err_clk3; + } + + clk_set_parent(mout_fimc_lclk, mout_mpll); + clk_set_rate(sclk_fimc_lclk, 166750000); + + /* be able to handle clock on/off only with this clock */ + clk = clk_get(&pdev->dev, "fimc"); + if (IS_ERR(clk)) { + dev_err(&pdev->dev, "failed to get interface clock\n"); + goto err_clk3; + } + + clk_put(mout_mpll); + clk_put(mout_fimc_lclk); + + ret = s5pv210_pd_enable("fimc_pd"); + if (ret < 0) { + dev_err(&pdev->dev, "failed to enable fimc power domain\n"); + goto err_clk3; + } + + clk_enable(clk); + + return 0; + +err_clk3: + clk_put(mout_fimc_lclk); + +err_clk2: + clk_put(mout_mpll); + +err_clk1: + return -EINVAL; +} + +int s3c_fimc_clk_off(struct platform_device *pdev, struct clk *clk) +{ + int ret; + + clk_disable(clk); + clk_put(clk); + + clk = NULL; + ret = s5pv210_pd_disable("fimc_pd"); + if (ret < 0) + dev_err(&pdev->dev, "failed to disable fimc power domain\n"); + + return 0; +} diff --git a/arch/arm/mach-s5pv210/setup-fimc1.c b/arch/arm/mach-s5pv210/setup-fimc1.c new file mode 100644 index 0000000..5ec1301 --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-fimc1.c @@ -0,0 +1,21 @@ +/* linux/arch/arm/mach-s5pv210/setup-fimc1.c + * + * Copyright (c) 2010 Samsung Electronics Co., Ltd. + * http://www.samsung.com/ + * + * Base FIMC 1 gpio configuration + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device; /* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/gpio-cfg.h> + +void s3c_fimc1_cfg_gpio(struct platform_device *pdev) { } diff --git a/arch/arm/mach-s5pv210/setup-fimc2.c b/arch/arm/mach-s5pv210/setup-fimc2.c new file mode 100644 index 0000000..aaa6f6e --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-fimc2.c @@ -0,0 +1,21 @@ +/* linux/arch/arm/mach-s5pv210/setup-fimc2.c + * + * Copyright (c) 2010 Samsung Electronics Co., Ltd. + * http://www.samsung.com/ + * + * Base FIMC 2 gpio configuration + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device; /* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/gpio-cfg.h> + +void s3c_fimc2_cfg_gpio(struct platform_device *pdev) { } |