summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Wu <pengw@nvidia.com>2014-06-20 09:34:59 -0700
committerWinnie Hsu <whsu@nvidia.com>2014-07-31 16:26:21 -0700
commitec622e35c3d4862f07e3da676401e3feefa98ecf (patch)
tree6c067e61f8180d02ca1c9a062e42c5b18500a2d2
parent8a370a3b55ee8750167174238ce316900409f558 (diff)
media: tegra_v4l2_camera: use FRAME_START syncpt
Also use nvhost_syncpt_incr_max_ext(). Bug 1478352 Change-Id: Ib868bd2bd7a070e4c410e48bd51977ac45b7d477 Signed-off-by: Bryan Wu <pengw@nvidia.com> Reviewed-on: http://git-master/r/439471 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
-rw-r--r--drivers/media/video/tegra_v4l2_camera.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/video/tegra_v4l2_camera.c b/drivers/media/video/tegra_v4l2_camera.c
index 8834e27afcee..c1fc8f8388a6 100644
--- a/drivers/media/video/tegra_v4l2_camera.c
+++ b/drivers/media/video/tegra_v4l2_camera.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2012-2014, 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,
@@ -487,7 +487,7 @@ static void tegra_camera_capture_setup_csi_a(struct tegra_camera_dev *pcdev,
(pdata->continuous_clk << 5) |
0x5); /* Clock settle time */
- TC_VI_REG_WT(pcdev, TEGRA_VI_CONT_SYNCPT_CSI_PPA_FRAME_END,
+ TC_VI_REG_WT(pcdev, TEGRA_VI_CONT_SYNCPT_CSI_PPA_FRAME_START,
(0x1 << 8) | /* Enable continuous syncpt */
TEGRA_VI_SYNCPT_CSI_A);
@@ -555,7 +555,7 @@ static void tegra_camera_capture_setup_csi_b(struct tegra_camera_dev *pcdev,
(pdata->continuous_clk << 5) |
0x5); /* Clock settle time */
- TC_VI_REG_WT(pcdev, TEGRA_VI_CONT_SYNCPT_CSI_PPB_FRAME_END,
+ TC_VI_REG_WT(pcdev, TEGRA_VI_CONT_SYNCPT_CSI_PPB_FRAME_START,
(0x1 << 8) | /* Enable continuous syncpt */
TEGRA_VI_SYNCPT_CSI_B);
@@ -857,7 +857,8 @@ static int tegra_camera_capture_start(struct tegra_camera_dev *pcdev,
* wait on VIP VSYNC syncpt.
*/
if (port == TEGRA_CAMERA_PORT_CSI_A) {
- pcdev->syncpt_csi_a++;
+ pcdev->syncpt_csi_a = nvhost_syncpt_incr_max_ext(pcdev->ndev,
+ TEGRA_VI_SYNCPT_CSI_A, 1);
TC_VI_REG_WT(pcdev, TEGRA_CSI_PIXEL_STREAM_PPA_COMMAND,
pdata->continuous_capture?0x0000f001 :0x0000f005);
@@ -867,7 +868,8 @@ static int tegra_camera_capture_start(struct tegra_camera_dev *pcdev,
TEGRA_SYNCPT_CSI_WAIT_TIMEOUT,
NULL);
} else if (port == TEGRA_CAMERA_PORT_CSI_B) {
- pcdev->syncpt_csi_b++;
+ pcdev->syncpt_csi_b = nvhost_syncpt_incr_max_ext(pcdev->ndev,
+ TEGRA_VI_SYNCPT_CSI_B, 1);
TC_VI_REG_WT(pcdev, TEGRA_CSI_PIXEL_STREAM_PPB_COMMAND,
pdata->continuous_capture? 0x0000f001: 0x0000f005);
@@ -877,7 +879,8 @@ static int tegra_camera_capture_start(struct tegra_camera_dev *pcdev,
TEGRA_SYNCPT_CSI_WAIT_TIMEOUT,
NULL);
} else {
- pcdev->syncpt_vi++;
+ pcdev->syncpt_vi = nvhost_syncpt_incr_max_ext(pcdev->ndev,
+ TEGRA_VI_SYNCPT_VI, 1);
TC_VI_REG_WT(pcdev, TEGRA_VI_CAMERA_CONTROL,
0x00000001);
err = nvhost_syncpt_wait_timeout_ext(pcdev->ndev,
@@ -946,6 +949,8 @@ static int tegra_camera_capture_stop(struct tegra_camera_dev *pcdev, int port)
TC_VI_REG_WT(pcdev, TEGRA_VI_CAMERA_CONTROL,
0x00000005);
+ pcdev->syncpt_vi = nvhost_syncpt_incr_max_ext(pcdev->ndev,
+ TEGRA_VI_SYNCPT_VI, 1);
if (tegra_camera_port_is_csi(port))
err = nvhost_syncpt_wait_timeout_ext(pcdev->ndev,
TEGRA_VI_SYNCPT_VI,