gpu: ipu-v3: vdic: include AUTO field order bit in ipu_vdi_set_field_order
authorSteve Longerbeam <slongerbeam@gmail.com>
Sun, 21 May 2017 22:02:10 +0000 (15:02 -0700)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 8 Jun 2017 06:57:20 +0000 (08:57 +0200)
The field order selection in VDIC_C register uses different bits
depending on whether the VDIC is receiving from a CSI ("AUTO") or
from memory ("MAN"). Since the VDIC cannot receive from both CSI
and memory at the same time, set or clear both field order bits to
cover both cases.

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/ipu-v3/ipu-vdi.c

index f27bf5a12ebc1479363c6fa57822dc9c2e2ca6cc..a66389366af7b8bb50343fbd6b40c4a89be02b2e 100644 (file)
@@ -88,9 +88,9 @@ void ipu_vdi_set_field_order(struct ipu_vdi *vdi, v4l2_std_id std, u32 field)
 
        reg = ipu_vdi_read(vdi, VDI_C);
        if (top_field_0)
-               reg &= ~VDI_C_TOP_FIELD_MAN_1;
+               reg &= ~(VDI_C_TOP_FIELD_MAN_1 | VDI_C_TOP_FIELD_AUTO_1);
        else
-               reg |= VDI_C_TOP_FIELD_MAN_1;
+               reg |= VDI_C_TOP_FIELD_MAN_1 | VDI_C_TOP_FIELD_AUTO_1;
        ipu_vdi_write(vdi, reg, VDI_C);
 
        spin_unlock_irqrestore(&vdi->lock, flags);