Skip to content

Commit 444d0db

Browse files
pcornuBenjamin-Gaignard
authored andcommitted
drm/stm: ltdc: Cleanup signal polarity defines
The GCR_PCPOL/DEPOL/VSPOL/HSPOL defines are sufficient to describe the HS, VS, DE & PC signal polarities. Signed-off-by: Philippe CORNU <philippe.cornu@st.com> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/1500552357-29487-3-git-send-email-philippe.cornu@st.com
1 parent af5125d commit 444d0db

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

drivers/gpu/drm/stm/ltdc.c

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@
104104

105105
#define GCR_LTDCEN BIT(0) /* LTDC ENable */
106106
#define GCR_DEN BIT(16) /* Dither ENable */
107-
#define GCR_PCPOL BIT(28) /* Pixel Clock POLarity */
108-
#define GCR_DEPOL BIT(29) /* Data Enable POLarity */
109-
#define GCR_VSPOL BIT(30) /* Vertical Synchro POLarity */
110-
#define GCR_HSPOL BIT(31) /* Horizontal Synchro POLarity */
107+
#define GCR_PCPOL BIT(28) /* Pixel Clock POLarity-Inverted */
108+
#define GCR_DEPOL BIT(29) /* Data Enable POLarity-High */
109+
#define GCR_VSPOL BIT(30) /* Vertical Synchro POLarity-High */
110+
#define GCR_HSPOL BIT(31) /* Horizontal Synchro POLarity-High */
111111

112112
#define GC1R_WBCH GENMASK(3, 0) /* Width of Blue CHannel output */
113113
#define GC1R_WGCH GENMASK(7, 4) /* Width of Green Channel output */
@@ -174,14 +174,6 @@
174174

175175
#define LXCFBLNR_CFBLN GENMASK(10, 0) /* Color Frame Buffer Line Number */
176176

177-
#define HSPOL_AL 0 /* Horizontal Sync POLarity Active Low */
178-
#define VSPOL_AL 0 /* Vertical Sync POLarity Active Low */
179-
#define DEPOL_AL 0 /* Data Enable POLarity Active Low */
180-
#define PCPOL_IPC 0 /* Input Pixel Clock */
181-
#define HSPOL_AH GCR_HSPOL /* Horizontal Sync POLarity Active High */
182-
#define VSPOL_AH GCR_VSPOL /* Vertical Sync POLarity Active High */
183-
#define DEPOL_AH GCR_DEPOL /* Data Enable POLarity Active High */
184-
#define PCPOL_IIPC GCR_PCPOL /* Inverted Input Pixel Clock */
185177
#define CONSTA_MAX 0xFF /* CONSTant Alpha MAX= 1.0 */
186178
#define BF1_PAXCA 0x600 /* Pixel Alpha x Constant Alpha */
187179
#define BF1_CA 0x400 /* Constant Alpha */
@@ -459,20 +451,20 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
459451

460452
clk_enable(ldev->pixel_clk);
461453

462-
/* Configures the HS, VS, DE and PC polarities. */
463-
val = HSPOL_AL | VSPOL_AL | DEPOL_AL | PCPOL_IPC;
454+
/* Configures the HS, VS, DE and PC polarities. Default Active Low */
455+
val = 0;
464456

465457
if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
466-
val |= HSPOL_AH;
458+
val |= GCR_HSPOL;
467459

468460
if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
469-
val |= VSPOL_AH;
461+
val |= GCR_VSPOL;
470462

471463
if (vm.flags & DISPLAY_FLAGS_DE_HIGH)
472-
val |= DEPOL_AH;
464+
val |= GCR_DEPOL;
473465

474466
if (vm.flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
475-
val |= PCPOL_IIPC;
467+
val |= GCR_PCPOL;
476468

477469
reg_update_bits(ldev->regs, LTDC_GCR,
478470
GCR_HSPOL | GCR_VSPOL | GCR_DEPOL | GCR_PCPOL, val);

0 commit comments

Comments
 (0)