diff options
author | Piotr Zierhoffer <pzierhoffer@antmicro.com> | 2013-05-10 15:38:02 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2013-06-12 21:43:55 +0200 |
commit | f1526398b7420c3f1f6892d35235142b4e04a4e3 (patch) | |
tree | 62a005633b0f348d1feff6fdea431f5fe46a1f1b /drivers/media/video | |
parent | e9ecaa3464f1fda91321d358ae7c77da710748e1 (diff) |
tegra_v4l2: support for interlaced fields
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/tegra_v4l2_camera.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/video/tegra_v4l2_camera.c b/drivers/media/video/tegra_v4l2_camera.c index 0139268f4997..efc450064160 100644 --- a/drivers/media/video/tegra_v4l2_camera.c +++ b/drivers/media/video/tegra_v4l2_camera.c @@ -235,6 +235,10 @@ #define TEGRA_CSI_PIXEL_STREAM_B_EXPECTED_FRAME 0x08cc #define TEGRA_CSI_DSI_MIPI_CAL_CONFIG 0x08d0 +#define IS_INTERLACED ((pcdev->field == V4L2_FIELD_INTERLACED)\ + || (pcdev->field == V4L2_FIELD_INTERLACED_BT)\ + || (pcdev->field == V4L2_FIELD_INTERLACED_TB)) + #define TC_VI_REG_RD(DEV, REG) readl(DEV->vi_base + REG) #define TC_VI_REG_WT(DEV, REG, VAL) writel(VAL, DEV->vi_base + REG) @@ -559,7 +563,7 @@ static void tegra_camera_capture_setup_vip(struct tegra_camera_dev *pcdev, (icd->user_width << 16) | TEGRA_VIP_H_ACTIVE_START); TC_VI_REG_WT(pcdev, TEGRA_VI_VIP_V_ACTIVE, - ( ( (pcdev->field == V4L2_FIELD_INTERLACED) ? (icd->user_height/2) : (icd->user_height) ) << 16) | + ( ( IS_INTERLACED ? (icd->user_height/2) : (icd->user_height) ) << 16) | TEGRA_VIP_V_ACTIVE_START); /* @@ -659,7 +663,7 @@ static void tegra_camera_capture_setup(struct tegra_camera_dev *pcdev) output_format); // if the video is interlaced, then take two frames - frame_count = (pcdev->field == V4L2_FIELD_INTERLACED) ? 2 : 1; + frame_count = IS_INTERLACED ? 2 : 1; /* * Set up frame size. Bits 31:16 are the number of lines, and @@ -796,7 +800,7 @@ static int tegra_camera_capture_start(struct tegra_camera_dev *pcdev, TEGRA_SYNCPT_VI_WAIT_TIMEOUT, NULL); - if (pcdev->field == V4L2_FIELD_INTERLACED) { + if (IS_INTERLACED) { TC_VI_REG_WT(pcdev, TEGRA_VI_CAMERA_CONTROL, 0x00000005); // start & stop @@ -1568,6 +1572,12 @@ static int tegra_camera_try_fmt(struct soc_camera_device *icd, case V4L2_FIELD_NONE: pix->field = V4L2_FIELD_NONE; break; + case V4L2_FIELD_INTERLACED_BT: + pix->field = V4L2_FIELD_INTERLACED_BT; + break; + case V4L2_FIELD_INTERLACED_TB: + pix->field = V4L2_FIELD_INTERLACED_TB; + break; case V4L2_FIELD_INTERLACED: pix->field = V4L2_FIELD_INTERLACED; break; |