media: tegra_camera: Enable Null sensor
kdivvela [Tue, 6 Sep 2011 11:20:05 +0000 (16:20 +0530)]
Enable pd2vi_clk in case of Null sensor

Bug 870406

Reviewed-on: http://git-master/r/50822
(cherry picked from commit 4eaca0ed7652aacf1bf56d1f7ad1ff1bd39c73a9)

Change-Id: Ie508e3addf4e757201bed9499dbba2887a8d423f
Reviewed-on: http://git-master/r/55199
Tested-by: Krupal Divvela <kdivvela@nvidia.com>
Reviewed-by: Prayas Mohanty <pmohanty@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: Rdc286d25cf01b6bae9e50accf618cb96e17c5bd9

drivers/media/video/tegra/tegra_camera.c
include/media/tegra_camera.h

index 2d4baa5..95d477e 100644 (file)
@@ -140,11 +140,15 @@ static int tegra_camera_clk_set_rate(struct tegra_camera_clk_info *info)
        clk_set_rate(clk, info->rate);
 
        if (info->clk_id == TEGRA_CAMERA_VI_CLK) {
-               u32 val;
+               u32 val = 0x2;
                void __iomem *car = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
                void __iomem *apb_misc = IO_ADDRESS(TEGRA_APB_MISC_BASE);
 
-               writel(0x2, car + offset);
+               if (info->flag == TEGRA_CAMERA_ENABLE_PD2VI_CLK) {
+                       val |= TEGRA_CAMERA_PD2VI_CLK_SEL_VI_SENSOR_CLK;
+               }
+
+               writel(val, car + offset);
 
                val = readl(apb_misc + 0x42c);
                writel(val | 0x1, apb_misc + 0x42c);
index 240f2ad..d7d08bd 100644 (file)
  */
 #ifndef TEGRA_CAMERA_H
 #define TEGRA_CAMERA_H
+
+/* this is to enable VI pattern generator (Null Sensor) */
+#define TEGRA_CAMERA_ENABLE_PD2VI_CLK 0x1
+
 enum {
        TEGRA_CAMERA_MODULE_ISP = 0,
        TEGRA_CAMERA_MODULE_VI,