Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0048a173 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Kukjin Kim
Browse files

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: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 6d2f42cc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ config EXYNOS4_SETUP_SDHCI_GPIO
	help
	  Common setup code for SDHCI gpio.

config EXYNOS4_SETUP_FIMC
	bool
	help
	  Common setup code for the camera interfaces.

# machine support

menu "EXYNOS4 Machines"
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ obj-y += dev-audio.o
obj-$(CONFIG_EXYNOS4_DEV_PD)		+= dev-pd.o
obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)	+= dev-sysmmu.o

obj-$(CONFIG_EXYNOS4_SETUP_FIMC)	+= setup-fimc.o
obj-$(CONFIG_EXYNOS4_SETUP_I2C1)	+= setup-i2c1.o
obj-$(CONFIG_EXYNOS4_SETUP_I2C2)	+= setup-i2c2.o
obj-$(CONFIG_EXYNOS4_SETUP_I2C3)	+= setup-i2c3.o
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
 *
 * Exynos4 camera interface 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/gpio.h>
#include <plat/gpio-cfg.h>
#include <plat/camport.h>

int exynos4_fimc_setup_gpio(enum s5p_camport_id id)
{
	u32 gpio8, gpio5;
	u32 sfn;
	int ret;

	switch (id) {
	case S5P_CAMPORT_A:
		gpio8 = EXYNOS4_GPJ0(0); /* PCLK, VSYNC, HREF, DATA[0:4] */
		gpio5 = EXYNOS4_GPJ1(0); /* DATA[5:7], CLKOUT, FIELD */
		sfn = S3C_GPIO_SFN(2);
		break;

	case S5P_CAMPORT_B:
		gpio8 = EXYNOS4_GPE0(0); /* DATA[0:7] */
		gpio5 = EXYNOS4_GPE1(0); /* PCLK, VSYNC, HREF, CLKOUT, FIELD */
		sfn = S3C_GPIO_SFN(3);
		break;

	default:
		WARN(1, "Wrong camport id: %d\n", id);
		return -EINVAL;
	}

	ret = s3c_gpio_cfgall_range(gpio8, 8, sfn, S3C_GPIO_PULL_UP);
	if (ret)
		return ret;

	return s3c_gpio_cfgall_range(gpio5, 5, sfn, S3C_GPIO_PULL_UP);
}
+5 −0
Original line number Diff line number Diff line
@@ -53,6 +53,11 @@ config S5PV210_SETUP_SDHCI_GPIO
	help
	  Common setup code for SDHCI gpio.

config S5PV210_SETUP_FIMC
	bool
	help
	  Common setup code for the camera interfaces.

menu "S5PC110 Machines"

config MACH_AQUILA
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ obj-y += dev-audio.o
obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o

obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
obj-$(CONFIG_S5PV210_SETUP_FIMC)	+= setup-fimc.o
obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
obj-$(CONFIG_S5PV210_SETUP_IDE)		+= setup-ide.o
Loading