]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
drm: xilinx: vtc: removing hard coded values for signal polarity
authorSaurabh Sengar <saurabh.singh@xilinx.com>
Fri, 13 Oct 2017 10:12:57 +0000 (15:42 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 15 Mar 2018 14:18:37 +0000 (15:18 +0100)
removing hard coded values for following signal polarity parameters,
and taking from vm.flags instead.
This will help clients driver to program signal polarity as per
drivers need.

- hsync
- vsync
- hblank
- vblank
- field_id

Signed-off-by: Saurabh Sengar <saurabhs@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/gpu/drm/xilinx/xilinx_vtc.c

index 14c40b155d35ea5339b015370c834eb134c24397..0f3a1780fbe95f0e5f5d2eeea92d0f8e34890006 100644 (file)
@@ -272,9 +272,7 @@ struct xilinx_vtc_src_config {
 static void xilinx_vtc_config_polarity(struct xilinx_vtc *vtc,
                                       struct xilinx_vtc_polarity *polarity)
 {
-       u32 reg;
-
-       reg = xilinx_drm_readl(vtc->base, VTC_GPOL);
+       u32 reg = 0;
 
        if (polarity->active_chroma)
                reg |= VTC_CTL_ACP;
@@ -475,13 +473,13 @@ void xilinx_vtc_config_sig(struct xilinx_vtc *vtc,
        xilinx_vtc_config_hori_offset(vtc, &hori_offset);
        /* set up polarity */
        memset(&polarity, 0x0, sizeof(polarity));
-       polarity.hsync = 1;
-       polarity.vsync = 1;
-       polarity.hblank = 1;
-       polarity.vblank = 1;
+       polarity.hsync = !!(vm->flags & DISPLAY_FLAGS_HSYNC_LOW);
+       polarity.vsync = !!(vm->flags & DISPLAY_FLAGS_VSYNC_LOW);
+       polarity.hblank = !!(vm->flags & DISPLAY_FLAGS_HSYNC_LOW);
+       polarity.vblank = !!(vm->flags & DISPLAY_FLAGS_VSYNC_LOW);
        polarity.active_video = 1;
        polarity.active_chroma = 1;
-       polarity.field_id = 1;
+       polarity.field_id = !!(vm->flags & DISPLAY_FLAGS_INTERLACED);
        xilinx_vtc_config_polarity(vtc, &polarity);
 
        /* set up src config */