media: rcar-vin: Handle data-enable polarity
authorJacopo Mondi <jacopo+renesas@jmondi.org>
Mon, 9 Jul 2018 14:19:21 +0000 (10:19 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 24 Jul 2018 18:59:36 +0000 (14:59 -0400)
Handle data-enable signal polarity. If the polarity is not specifically
requested to be active low, use the active high default.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/rcar-vin/rcar-dma.c

index 1de5981..9146f63 100644 (file)
 /* Video n Data Mode Register 2 bits */
 #define VNDMR2_VPS             (1 << 30)
 #define VNDMR2_HPS             (1 << 29)
+#define VNDMR2_CES             (1 << 28)
 #define VNDMR2_FTEV            (1 << 17)
 #define VNDMR2_VLV(n)          ((n & 0xf) << 12)
 
@@ -698,6 +699,10 @@ static int rvin_setup(struct rvin_dev *vin)
                /* Vsync Signal Polarity Select */
                if (!(vin->parallel->mbus_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW))
                        dmr2 |= VNDMR2_VPS;
+
+               /* Data Enable Polarity Select */
+               if (vin->parallel->mbus_flags & V4L2_MBUS_DATA_ENABLE_LOW)
+                       dmr2 |= VNDMR2_CES;
        }
 
        /*