summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorWojciech Bieganski <wbieganski@antmicro.com>2014-04-14 15:56:00 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-04-22 08:43:29 +0200
commitadc6a443b7df188545c99cea1c3ebd5c965763b7 (patch)
tree8051536c2bf46c87c584a31c7e343abd2beb37a8 /arch/arm/mach-tegra
parent39989815e732886a763d41b0067eb9ce64a7e84f (diff)
media: added camera settings per decoder
This commit adds settings such as: - values of horizontal/vertical active start, - enabling/disabling internal sync, to the private data of decoders: MAX9526, ADV7180, TVP5150, OV7670 and AS0260. The feature is available through *_tegra_camera_platform_data struct initialised in board-*.c files.
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-apalis_t30.c92
-rw-r--r--arch/arm/mach-tegra/board-colibri_t20.c56
-rw-r--r--arch/arm/mach-tegra/board-colibri_t30.c56
3 files changed, 174 insertions, 30 deletions
diff --git a/arch/arm/mach-tegra/board-apalis_t30.c b/arch/arm/mach-tegra/board-apalis_t30.c
index d26991be9e25..9c5cb6ff606e 100644
--- a/arch/arm/mach-tegra/board-apalis_t30.c
+++ b/arch/arm/mach-tegra/board-apalis_t30.c
@@ -111,23 +111,26 @@ static int tegra_camera_enable(struct nvhost_device *ndev)
return 0;
}
-static struct tegra_camera_platform_data tegra_camera_platform_data = {
+#if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE)
+static struct i2c_board_info camera_i2c_max9526 = {
+ I2C_BOARD_INFO("max9526", 0x20),
+};
+
+static struct tegra_camera_platform_data max9526_tegra_camera_platform_data = {
.disable_camera = tegra_camera_disable,
.enable_camera = tegra_camera_enable,
.flip_h = 0,
.flip_v = 0,
.port = TEGRA_CAMERA_PORT_VIP,
-};
-
-#if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE)
-static struct i2c_board_info camera_i2c_max9526 = {
- I2C_BOARD_INFO("max9526", 0x20),
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
};
static struct soc_camera_link iclink_max9526 = {
.board_info = &camera_i2c_max9526,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &max9526_tegra_camera_platform_data,
.i2c_adapter_id = 2,
};
@@ -145,10 +148,21 @@ static struct i2c_board_info camera_i2c_adv7180 = {
I2C_BOARD_INFO("adv7180", 0x21),
};
+static struct tegra_camera_platform_data adv7180_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_adv7180 = {
.board_info = &camera_i2c_adv7180,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &adv7180_tegra_camera_platform_data,
.i2c_adapter_id = 2,
};
@@ -166,10 +180,21 @@ static struct i2c_board_info camera_i2c_tvp5150soc = {
I2C_BOARD_INFO("tvp5150soc", 0x5d),
};
+static struct tegra_camera_platform_data tvp5150soc_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_tvp5150soc = {
.board_info = &camera_i2c_tvp5150soc,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &tvp5150soc_tegra_camera_platform_data,
.i2c_adapter_id = 2,
};
@@ -187,10 +212,21 @@ static struct i2c_board_info camera_i2c_ov7670soc = {
I2C_BOARD_INFO("ov7670soc", 0x21),
};
+static struct tegra_camera_platform_data ov7670_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_ov7670soc = {
.board_info = &camera_i2c_ov7670soc,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &ov7670_tegra_camera_platform_data,
.i2c_adapter_id = 2,
};
@@ -202,6 +238,39 @@ static struct platform_device soc_camera_ov7670soc = {
},
};
#endif /* CONFIG_SOC_CAMERA_OV7670SOC | CONFIG_SOC_CAMERA_OV7670SOC_MODULE */
+
+#if defined(CONFIG_SOC_CAMERA_AS0260) || defined(CONFIG_SOC_CAMERA_AS0260_MODULE)
+static struct i2c_board_info camera_i2c_as0260soc = {
+ I2C_BOARD_INFO("as0260soc", 0x48),
+};
+
+static struct tegra_camera_platform_data as0260soc_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0,
+ .vip_v_active_start = 0,
+};
+
+static struct soc_camera_link iclink_as0260soc = {
+ .board_info = &camera_i2c_as0260soc,
+ .bus_id = -1, /* This must match the .id of tegra_vi01_device */
+ .priv = &as0260soc_tegra_camera_platform_data,
+ .i2c_adapter_id = 2,
+};
+
+static struct platform_device soc_camera_as0260soc = {
+ .name = "soc-camera-pdrv",
+ .id = 4,
+ .dev = {
+ .platform_data = &iclink_as0260soc,
+ },
+};
+#endif /* CONFIG_SOC_CAMERA_AS0260 | CONFIG_SOC_CAMERA_AS0260_MODULE */
+
#endif /* CONFIG_VIDEO_TEGRA | CONFIG_VIDEO_TEGRA_MODULE */
/* CAN */
@@ -1441,6 +1510,9 @@ static void __init apalis_t30_init(void)
#if defined(CONFIG_SOC_CAMERA_OV7670SOC) || defined(CONFIG_SOC_CAMERA_OV7670SOC_MODULE)
platform_device_register(&soc_camera_ov7670soc);
#endif
+#if defined(CONFIG_SOC_CAMERA_AS0260) || defined(CONFIG_SOC_CAMERA_AS0260_MODULE)
+ platform_device_register(&soc_camera_as0260soc);
+#endif
#endif /* CONFIG_VIDEO_TEGRA | CONFIG_VIDEO_TEGRA_MODULE */
tegra_release_bootloader_fb();
diff --git a/arch/arm/mach-tegra/board-colibri_t20.c b/arch/arm/mach-tegra/board-colibri_t20.c
index 0f07ca4b63ed..5e1a6866430b 100644
--- a/arch/arm/mach-tegra/board-colibri_t20.c
+++ b/arch/arm/mach-tegra/board-colibri_t20.c
@@ -115,23 +115,26 @@ static int tegra_camera_enable(struct nvhost_device *ndev)
return 0;
}
-static struct tegra_camera_platform_data tegra_camera_platform_data = {
+#if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE)
+static struct i2c_board_info camera_i2c_max9526 = {
+ I2C_BOARD_INFO("max9526", 0x20),
+};
+
+static struct tegra_camera_platform_data max9526_tegra_camera_platform_data = {
.disable_camera = tegra_camera_disable,
.enable_camera = tegra_camera_enable,
.flip_h = 0,
.flip_v = 0,
.port = TEGRA_CAMERA_PORT_VIP,
-};
-
-#if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE)
-static struct i2c_board_info camera_i2c_max9526 = {
- I2C_BOARD_INFO("max9526", 0x20),
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
};
static struct soc_camera_link iclink_max9526 = {
.board_info = &camera_i2c_max9526,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &max9526_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};
@@ -149,10 +152,21 @@ static struct i2c_board_info camera_i2c_adv7180 = {
I2C_BOARD_INFO("adv7180", 0x21),
};
+static struct tegra_camera_platform_data adv7180_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_adv7180 = {
.board_info = &camera_i2c_adv7180,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &adv7180_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};
@@ -170,10 +184,21 @@ static struct i2c_board_info camera_i2c_tvp5150soc = {
I2C_BOARD_INFO("tvp5150soc", 0x5d),
};
+static struct tegra_camera_platform_data tvp5150soc_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_tvp5150soc = {
.board_info = &camera_i2c_tvp5150soc,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &tvp5150soc_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};
@@ -191,10 +216,21 @@ static struct i2c_board_info camera_i2c_ov7670soc = {
I2C_BOARD_INFO("ov7670soc", 0x21),
};
+static struct tegra_camera_platform_data ov7670_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_ov7670soc = {
.board_info = &camera_i2c_ov7670soc,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &ov7670_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};
diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c
index 1195cb2847b7..2a8230d48cd9 100644
--- a/arch/arm/mach-tegra/board-colibri_t30.c
+++ b/arch/arm/mach-tegra/board-colibri_t30.c
@@ -111,23 +111,26 @@ static int tegra_camera_enable(struct nvhost_device *ndev)
return 0;
}
-static struct tegra_camera_platform_data tegra_camera_platform_data = {
+#if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE)
+static struct i2c_board_info camera_i2c_max9526 = {
+ I2C_BOARD_INFO("max9526", 0x20),
+};
+
+static struct tegra_camera_platform_data max9526_tegra_camera_platform_data = {
.disable_camera = tegra_camera_disable,
.enable_camera = tegra_camera_enable,
.flip_h = 0,
.flip_v = 0,
.port = TEGRA_CAMERA_PORT_VIP,
-};
-
-#if defined(CONFIG_SOC_CAMERA_MAX9526) || defined(CONFIG_SOC_CAMERA_MAX9526_MODULE)
-static struct i2c_board_info camera_i2c_max9526 = {
- I2C_BOARD_INFO("max9526", 0x20),
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
};
static struct soc_camera_link iclink_max9526 = {
.board_info = &camera_i2c_max9526,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &max9526_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};
@@ -145,10 +148,21 @@ static struct i2c_board_info camera_i2c_adv7180 = {
I2C_BOARD_INFO("adv7180", 0x21),
};
+static struct tegra_camera_platform_data adv7180_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_adv7180 = {
.board_info = &camera_i2c_adv7180,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &adv7180_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};
@@ -166,10 +180,21 @@ static struct i2c_board_info camera_i2c_tvp5150soc = {
I2C_BOARD_INFO("tvp5150soc", 0x5d),
};
+static struct tegra_camera_platform_data tvp5150soc_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_tvp5150soc = {
.board_info = &camera_i2c_tvp5150soc,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &tvp5150soc_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};
@@ -187,10 +212,21 @@ static struct i2c_board_info camera_i2c_ov7670soc = {
I2C_BOARD_INFO("ov7670soc", 0x21),
};
+static struct tegra_camera_platform_data ov7670_tegra_camera_platform_data = {
+ .disable_camera = tegra_camera_disable,
+ .enable_camera = tegra_camera_enable,
+ .flip_h = 0,
+ .flip_v = 0,
+ .port = TEGRA_CAMERA_PORT_VIP,
+ .internal_sync = false,
+ .vip_h_active_start = 0x8F,
+ .vip_v_active_start = 0x12,
+};
+
static struct soc_camera_link iclink_ov7670soc = {
.board_info = &camera_i2c_ov7670soc,
.bus_id = -1, /* This must match the .id of tegra_vi01_device */
- .priv = &tegra_camera_platform_data,
+ .priv = &ov7670_tegra_camera_platform_data,
.i2c_adapter_id = 0,
};