summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-05-16 11:26:11 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-06-21 15:45:51 +0200
commit1319d0d5fd1c5070984917157d03acb7e54a4364 (patch)
treedb379e64ccbe59ab3b4092b68d92fef068850182
parentd671ea1f72528990881aa7b75c022a3c89a64a0e (diff)
apalis-tk1: support 2nd ov5640 with sccb_id of 0x3d on csi_3
This commit adds support for the 2nd CSI Camera Module 5MP OV5640 with SCCB_ID of 0x3d connected to Apalis TK1 Mezzanine V2.0A on X7 aka CSI_3_CSI-2/4x. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Dominik Sliwa <dominik.sliwa@toradex.com>
-rw-r--r--arch/arm/mach-tegra/board-apalis-tk1-sensors.c47
1 files changed, 44 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/board-apalis-tk1-sensors.c b/arch/arm/mach-tegra/board-apalis-tk1-sensors.c
index 4064fe7ca8a5..2b89d6881763 100644
--- a/arch/arm/mach-tegra/board-apalis-tk1-sensors.c
+++ b/arch/arm/mach-tegra/board-apalis-tk1-sensors.c
@@ -345,6 +345,46 @@ static struct platform_device apalis_tk1_ov5640_soc_camera_device = {
.platform_data = &ov5640_iclink,
},
};
+
+/* 2nd OV5640, assuming its SCCB_ID got moved from 0x3c to 0x3d */
+static int apalis_tk1_ov5640_power2(struct device *dev, int enable)
+ {
+ if(enable) {
+ tegra_io_dpd_disable(&csib_io);
+ } else {
+ tegra_io_dpd_enable(&csib_io);
+ }
+ return 0;
+ }
+
+static struct i2c_board_info apalis_tk1_ov5640_camera_i2c_device2 = {
+ I2C_BOARD_INFO("ov5640", 0x3d),
+};
+
+static struct tegra_camera_platform_data apalis_tk1_ov5640_camera_platform_data2 = {
+ .flip_v = 0,
+ .flip_h = 0,
+ .port = TEGRA_CAMERA_PORT_CSI_B,
+ .lanes = 2,
+ .continuous_clk = 1,
+};
+
+static struct soc_camera_link ov5640_iclink2 = {
+ .bus_id = 0, /* This must match the .id of tegra_vi01_device */
+ .board_info = &apalis_tk1_ov5640_camera_i2c_device2,
+ .module_name = "ov5640",
+ .i2c_adapter_id = 2,
+ .power = apalis_tk1_ov5640_power2,
+ .priv = &apalis_tk1_ov5640_camera_platform_data2,
+};
+
+static struct platform_device apalis_tk1_ov5640_soc_camera_device2 = {
+ .name = "soc-camera-pdrv",
+ .id = 6,
+ .dev = {
+ .platform_data = &ov5640_iclink2,
+ },
+};
#endif
#if IS_ENABLED(CONFIG_SOC_CAMERA_TC358743)
@@ -381,7 +421,7 @@ static struct soc_camera_link tc358743_iclink_a = {
static struct platform_device apalis_tk1_tc358743_soc_camera_device_a = {
.name = "soc-camera-pdrv",
- .id = 6,
+ .id = 7,
.dev = {
.platform_data = &tc358743_iclink_a,
},
@@ -421,7 +461,7 @@ static struct soc_camera_link tc358743_iclink_b = {
static struct platform_device apalis_tk1_tc358743_soc_camera_device_b = {
.name = "soc-camera-pdrv",
- .id = 7,
+ .id = 8,
.dev = {
.platform_data = &tc358743_iclink_b,
},
@@ -463,7 +503,7 @@ static struct soc_camera_link adv7280_iclink_c = {
static struct platform_device apalis_tk1_adv7280_soc_camera_device_c = {
.name = "soc-camera-pdrv",
- .id = 8,
+ .id = 9,
.dev = {
.platform_data = &adv7280_iclink_c,
},
@@ -1683,6 +1723,7 @@ static int apalis_tk1_camera_init(void)
#if IS_ENABLED(CONFIG_SOC_CAMERA_OV5640)
platform_device_register(&apalis_tk1_ov5640_soc_camera_device);
+ platform_device_register(&apalis_tk1_ov5640_soc_camera_device2);
#endif
#if IS_ENABLED(CONFIG_SOC_CAMERA_TC358743)