]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM64: Jetson E: add back camera sensor settings
authorBryan Wu <pengw@nvidia.com>
Thu, 2 Apr 2015 21:57:12 +0000 (14:57 -0700)
committerWinnie Hsu <whsu@nvidia.com>
Tue, 14 Apr 2015 00:51:35 +0000 (17:51 -0700)
T210 ERS (E2220) and Jetson Erista have different camera module but
using same camera sensor OV5693. This patch adds back camera sensor
settings for Jetson Erista and it can support both board with one kernel
image.

Bug 1629720

Change-Id: I954bbd43f68d61e951cbb15b3ad614fc8feac3ee
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/727219
(cherry picked from commit 18e8244a43602ac7136901a6858f1361674f5d8f)
Reviewed-on: http://git-master/r/730231
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
arch/arm64/mach-tegra/board-t210ref-camera.c

index 420800dab49668949165acc9500f9cedde098f51..ea05b8226a87734d5e569a4287c0c480c7c4d886 100644 (file)
@@ -139,6 +139,80 @@ static struct ov5693_regulators ov5693_regs = {
        .dovdd = "vif",
 };
 
+/* Jetson Erista camera board E2149 with dual OV5693 */
+static struct ov5693_v4l2_platform_data t210ref_ov5693_rear_data = {
+       .regulators = &ov5693_regs,
+       .gpio_pwdn = 151, /* TEGRA_GPIO_PS7 */
+};
+
+static struct i2c_board_info t210ref_ov5693_rear_camera_i2c_device = {
+       I2C_BOARD_INFO("ov5693_v4l2", 0x10),
+};
+
+static struct tegra_camera_platform_data
+t210ref_ov5693_rear_camera_platform_data = {
+       .flip_v                 = 0,
+       .flip_h                 = 0,
+       .port                   = TEGRA_CAMERA_PORT_CSI_A,
+       .lanes                  = 2,
+       .continuous_clk         = 0,
+};
+
+static struct soc_camera_link ov5693_rear_iclink = {
+       .bus_id         = 0, /* This must match the .id of tegra_vi01_device */
+       .board_info     = &t210ref_ov5693_rear_camera_i2c_device,
+       .module_name    = "ov5693_v4l2",
+       .i2c_adapter_id = 6, /* VI2 I2C controller */
+       .power          = t210ref_ov5693_power,
+       .priv           = &t210ref_ov5693_rear_camera_platform_data,
+       .dev_priv       = &t210ref_ov5693_rear_data,
+};
+
+static struct platform_device t210ref_ov5693_rear_soc_camera_device = {
+       .name   = "soc-camera-pdrv",
+       .id     = 0,
+       .dev    = {
+               .platform_data = &ov5693_rear_iclink,
+       },
+};
+
+static struct ov5693_v4l2_platform_data t210ref_ov5693_front_data = {
+       .regulators = &ov5693_regs,
+       .gpio_pwdn = 152, /* TEGRA_GPIO_PT0 */
+};
+
+static struct i2c_board_info t210ref_ov5693_front_camera_i2c_device = {
+       I2C_BOARD_INFO("ov5693_v4l2", 0x36),
+};
+
+static struct tegra_camera_platform_data
+t210ref_ov5693_front_camera_platform_data = {
+       .flip_v                 = 0,
+       .flip_h                 = 0,
+       .port                   = TEGRA_CAMERA_PORT_CSI_C,
+       .lanes                  = 2,
+       .continuous_clk         = 0,
+};
+
+static struct soc_camera_link ov5693_front_iclink = {
+       .bus_id         = 0, /* This must match the .id of tegra_vi01_device */
+       .board_info     = &t210ref_ov5693_front_camera_i2c_device,
+       .module_name    = "ov5693_v4l2",
+       .i2c_adapter_id = 6, /* VI2 I2C controller */
+       .power          = t210ref_ov5693_power,
+       .priv           = &t210ref_ov5693_front_camera_platform_data,
+       .dev_priv       = &t210ref_ov5693_front_data,
+};
+
+static struct platform_device t210ref_ov5693_front_soc_camera_device = {
+       .name   = "soc-camera-pdrv",
+       .id     = 1,
+       .dev    = {
+               .platform_data = &ov5693_front_iclink,
+       },
+};
+
+/* T210 ERS (E2220-1170) with six camera sensor board E2128 */
 static struct i2c_board_info t210ref_ov5693_camera_i2c_device = {
        I2C_BOARD_INFO("ov5693_v4l2", 0x36),
 };
@@ -348,12 +422,19 @@ int t210ref_camera_init(void)
 #endif
 
 #if IS_ENABLED(CONFIG_SOC_CAMERA_OV5693)
-       platform_device_register(&t210ref_ov5693_a_soc_camera_device);
-       platform_device_register(&t210ref_ov5693_b_soc_camera_device);
-       platform_device_register(&t210ref_ov5693_c_soc_camera_device);
-       platform_device_register(&t210ref_ov5693_d_soc_camera_device);
-       platform_device_register(&t210ref_ov5693_e_soc_camera_device);
-       platform_device_register(&t210ref_ov5693_f_soc_camera_device);
+       if (of_machine_is_compatible("nvidia,jetson-e")) {
+               platform_device_register(
+                               &t210ref_ov5693_rear_soc_camera_device);
+               platform_device_register(
+                               &t210ref_ov5693_front_soc_camera_device);
+       } else if (of_machine_is_compatible("nvidia,e2220")) {
+               platform_device_register(&t210ref_ov5693_a_soc_camera_device);
+               platform_device_register(&t210ref_ov5693_b_soc_camera_device);
+               platform_device_register(&t210ref_ov5693_c_soc_camera_device);
+               platform_device_register(&t210ref_ov5693_d_soc_camera_device);
+               platform_device_register(&t210ref_ov5693_e_soc_camera_device);
+               platform_device_register(&t210ref_ov5693_f_soc_camera_device);
+       }
 #endif
 
        return 0;