summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorHu He <hhe@nvidia.com>2014-11-25 14:59:07 -0800
committerWinnie Hsu <whsu@nvidia.com>2015-02-09 17:06:22 -0800
commit231a96efcdf47e971ce70412332ad436b1ffb619 (patch)
tree59a9c03c74592fbe7272bed1575a78cef8bc8fc7 /arch/arm
parentc017b032a284d7cb1974f7e80a6c3613089b9c0e (diff)
Kernel: add ov4689 kernel driver
Bug 1600299 Change-Id: I63f4d597bcc8b960407a7291fde6aa2ddb5bec25 Signed-off-by: Ming Wong <miwong@nvidia.com> Reviewed-on: http://git-master/r/674099 Reviewed-by: Winnie Hsu <whsu@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/tegra124-jetson_tk1-pm375-000-c00-00.dts13
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi46
-rw-r--r--arch/arm/configs/tegra12_defconfig1
-rw-r--r--arch/arm/mach-tegra/board-ardbeg-sensors.c44
4 files changed, 102 insertions, 2 deletions
diff --git a/arch/arm/boot/dts/tegra124-jetson_tk1-pm375-000-c00-00.dts b/arch/arm/boot/dts/tegra124-jetson_tk1-pm375-000-c00-00.dts
index 87dbc0fc389e..9d3559b4e0dd 100644
--- a/arch/arm/boot/dts/tegra124-jetson_tk1-pm375-000-c00-00.dts
+++ b/arch/arm/boot/dts/tegra124-jetson_tk1-pm375-000-c00-00.dts
@@ -67,6 +67,19 @@
reg = <0x0 0x80000000 0x0 0x80000000>;
};
+ camera-pcl {
+ profiles {
+ ov4689@2_0036 {
+ use_of_node = "yes";
+ reset-gpios = <&gpio TEGRA_GPIO(BB, 3) 0>;
+ cam1-gpios = <&gpio TEGRA_GPIO(BB, 5) 0>;
+ };
+ };
+ dpd {
+ default-enable;
+ };
+ };
+
spi@7000d400 {
status = "okay";
spi-max-frequency = <25000000>;
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi
index 566180d4cdab..e84ffcc1c87d 100644
--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi
@@ -1,7 +1,7 @@
/*
* arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi
*
- * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -71,6 +71,15 @@
platformdata = "ardbeg_ar0330_front_pdata";
};
};
+ module5: module5@modules {
+ compatible = "sensor,rear";
+ badge_info = "e1633_ov4689";
+
+ sensor {
+ profile = <&ov4689_1>;
+ platformdata = "ardbeg_ov4689_pdata";
+ };
+ };
};
profiles {
imx135_1: imx135@2_0010 {
@@ -295,6 +304,41 @@
CAMERA_END
>;
};
+ ov4689_1: ov4689@2_0036 {
+ index = <6>;
+ chipname = "pcl_OV4689";
+ type = "sensor";
+ guid = "s_OV4689";
+ position = <0>;
+ bustype = "i2c";
+ busnum = <2>;
+ addr = <0x36>;
+ datalen = <2>;
+ pinmuxgrp = <0xFFFF>;
+ gpios = <3>;
+ regulators = "vana", "vdig", "vif";
+ clocks = "mclk";
+ drivername = "ov4689";
+ detect = <0x0002 0x300A 0xFFFF 0x4688>;
+ devid = <0x4689>;
+ poweron = <
+ CAMERA_IND_CLK_SET(10000)
+ CAMERA_GPIO_CLR(221)
+ CAMERA_GPIO_CLR(219)
+ CAMERA_WAITMS(40)
+ CAMERA_REGULATOR_ON(2)
+ CAMERA_GPIO_SET(221)
+ CAMERA_GPIO_SET(219)
+ CAMERA_WAITMS(10)
+ CAMERA_END
+ >;
+ poweroff = <
+ CAMERA_GPIO_CLR(221)
+ CAMERA_IND_CLK_CLR
+ CAMERA_WAITUS(10)
+ CAMERA_END
+ >;
+ };
};
};
};
diff --git a/arch/arm/configs/tegra12_defconfig b/arch/arm/configs/tegra12_defconfig
index 8c8691235c6d..d028d4a23ad5 100644
--- a/arch/arm/configs/tegra12_defconfig
+++ b/arch/arm/configs/tegra12_defconfig
@@ -346,6 +346,7 @@ CONFIG_VIDEO_AR0261=y
CONFIG_VIDEO_AR0330=y
CONFIG_VIDEO_IMX132=y
CONFIG_VIDEO_OV9772=y
+CONFIG_VIDEO_OV4689=y
CONFIG_TORCH_SSL3250A=y
CONFIG_MAX77665_FLASH=y
CONFIG_TORCH_MAX77387=y
diff --git a/arch/arm/mach-tegra/board-ardbeg-sensors.c b/arch/arm/mach-tegra/board-ardbeg-sensors.c
index d89c2e1970f4..c2fd85030283 100644
--- a/arch/arm/mach-tegra/board-ardbeg-sensors.c
+++ b/arch/arm/mach-tegra/board-ardbeg-sensors.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/board-ardbeg-sensors.c
*
- * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -39,6 +39,7 @@
#include <media/ad5823.h>
#include <media/max77387.h>
+#include <media/ov4689.h>
#include <linux/platform_device.h>
#include <media/soc_camera.h>
#include <media/soc_camera_platform.h>
@@ -464,6 +465,34 @@ struct ar0330_platform_data ardbeg_ar0330_data = {
.dev_name = "ar0330",
};
+static int ardbeg_ov4689_power_on(struct ov4689_power_rail *pw)
+{
+ pr_info("%s: ++\n", __func__);
+ /* disable CSIA/B IOs DPD mode to turn on camera for ardbeg */
+ tegra_io_dpd_disable(&csia_io);
+ tegra_io_dpd_disable(&csib_io);
+
+ gpio_set_value(TEGRA_GPIO_PBB5, 0);
+ usleep_range(10, 20);
+ gpio_set_value(TEGRA_GPIO_PBB5, 1);
+ usleep_range(820, 1000);
+
+ return 1;
+}
+
+static int ardbeg_ov4689_power_off(struct ov4689_power_rail *pw)
+{
+ pr_info("%s: ++\n", __func__);
+
+ gpio_set_value(TEGRA_GPIO_PBB5, 0);
+
+ /* put CSIA/B IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csia_io);
+ tegra_io_dpd_enable(&csib_io);
+
+ return 0;
+}
+
static int ardbeg_ar0261_power_on(struct ar0261_power_rail *pw)
{
int err;
@@ -753,6 +782,18 @@ struct imx179_platform_data ardbeg_imx179_data = {
.power_off = ardbeg_imx179_power_off,
};
+struct ov4689_platform_data ardbeg_ov4689_data = {
+ .flash_cap = {
+ .enable = 0,
+ .edge_trig_en = 1,
+ .start_edge = 0,
+ .repeat = 1,
+ .delay_frm = 0,
+ },
+ .power_on = ardbeg_ov4689_power_on,
+ .power_off = ardbeg_ov4689_power_off,
+};
+
static int ardbeg_dw9718_power_on(struct dw9718_power_rail *pw)
{
int err;
@@ -1285,6 +1326,7 @@ static struct camera_data_blob ardbeg_camera_lut[] = {
{"ardbeg_ov5693f_pdata", &ardbeg_ov5693_front_pdata},
{"ardbeg_ar0330_pdata", &ardbeg_ar0330_data},
{"ardbeg_ar0330_front_pdata", &ardbeg_ar0330_front_data},
+ {"ardbeg_ov4689_pdata", &ardbeg_ov4689_data},
{},
};