summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorJihoon Bang <jbang@nvidia.com>2012-06-19 16:12:00 -0700
committerVarun Colbert <vcolbert@nvidia.com>2012-09-10 14:29:24 -0700
commit678708d95daa7d29ad5f49944f1b5385e3f27401 (patch)
tree4912060fee7348e127a9ee123d9e58d6401556f6 /drivers/media
parent30b0fef255afc76c510b8ccb6f3a517cdb82f9c8 (diff)
WAR: gr3d: limit 3d clock when camera is on
As WAR, limit 3d clock frequency and emc clock frequency when camera is on and chip is AP37. 3d clock is set to 361MHz and 437MHz is requested for emc clock with this change. This change allows 3d to request 1.1V in Core instead of 1.3V in AP37. Bug 1001262 Bug 1019309 Change-Id: I9f46f93d8da0fcf5afe05839177bf0d6e43a5840 Signed-off-by: Jihoon Bang <jbang@nvidia.com> Reviewed-on: http://git-master/r/130945 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/tegra/tegra_camera.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/media/video/tegra/tegra_camera.c b/drivers/media/video/tegra/tegra_camera.c
index 03eecf464c48..2b0cd005096c 100644
--- a/drivers/media/video/tegra/tegra_camera.c
+++ b/drivers/media/video/tegra/tegra_camera.c
@@ -2,7 +2,7 @@
* drivers/media/video/tegra/tegra_camera.c
*
* Copyright (C) 2010 Google, Inc.
- * Copyright (C) 2012 Nvidia Corp
+ * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -58,6 +58,25 @@ struct tegra_camera_block {
bool is_enabled;
};
+/*
+ * Declare and define two static variables to provide hint to
+ * gr3d module
+ */
+static int tegra_camera_on;
+static struct tegra_camera_platform_data *pdata;
+
+int is_tegra_camera_on(void)
+{
+ if (pdata) {
+ if (pdata->limit_3d_emc_clk)
+ return tegra_camera_on;
+ else
+ return 0;
+ } else {
+ return 0;
+ }
+}
+
static int tegra_camera_enable_clk(struct tegra_camera_dev *dev)
{
clk_enable(dev->vi_clk);
@@ -227,6 +246,7 @@ static int tegra_camera_power_on(struct tegra_camera_dev *dev)
__func__);
#endif
dev->power_on = 1;
+ tegra_camera_on = dev->power_on;
return ret;
}
@@ -255,6 +275,7 @@ static int tegra_camera_power_off(struct tegra_camera_dev *dev)
}
}
dev->power_on = 0;
+ tegra_camera_on = dev->power_on;
return ret;
}
@@ -425,6 +446,7 @@ static int tegra_camera_probe(struct platform_device *pdev)
mutex_unlock(&dev->tegra_camera_lock);
dev->dev = &pdev->dev;
+ pdata = pdev->dev.platform_data;
/* Get regulator pointer */
#ifdef CONFIG_ARCH_TEGRA_2x_SOC