public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE
@ 2018-01-20 18:50 Giulio Benetti
  2018-01-20 18:50 ` [PATCH 2/2] drm/sun4i: Handle DRM_MODE_FLAG_**SYNC_POSITIVE correctly Giulio Benetti
  2018-01-22  8:45 ` [PATCH 1/2] drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE Maxime Ripard
  0 siblings, 2 replies; 23+ messages in thread
From: Giulio Benetti @ 2018-01-20 18:50 UTC (permalink / raw)
  To: linux-arm-kernel

Can't set dclk polarity on sun4i.

Handle both positive and negative dclk polarity,
according to bus_flags.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index f4284b5..6121210 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -17,6 +17,7 @@
 #include <drm/drm_encoder.h>
 #include <drm/drm_modes.h>
 #include <drm/drm_of.h>
+#include <drm/drm_panel.h>
 
 #include <uapi/drm/drm_mode.h>
 
@@ -173,6 +174,9 @@ static void sun4i_tcon0_mode_set_common(struct sun4i_tcon *tcon,
 static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
 				     const struct drm_display_mode *mode)
 {
+	struct drm_panel *panel = tcon->panel;
+	struct drm_connector *connector = panel->connector;
+	struct drm_display_info display_info = connector->display_info;
 	unsigned int bp, hsync, vsync;
 	u8 clk_delay;
 	u32 val = 0;
@@ -226,8 +230,13 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
 	if (!(mode->flags & DRM_MODE_FLAG_PVSYNC))
 		val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
 
+	if(display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
+		val |= SUN4I_TCON0_IO_POL_DCLK_PHASE(1);
+
 	regmap_update_bits(tcon->regs, SUN4I_TCON0_IO_POL_REG,
-			   SUN4I_TCON0_IO_POL_HSYNC_POSITIVE | SUN4I_TCON0_IO_POL_VSYNC_POSITIVE,
+			   SUN4I_TCON0_IO_POL_HSYNC_POSITIVE |
+			   SUN4I_TCON0_IO_POL_VSYNC_POSITIVE |
+			   SUN4I_TCON0_IO_POL_DCLK_PHASE(3),
 			   val);
 
 	/* Map output pins to channel 0 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-02-28 15:56 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-20 18:50 [PATCH 1/2] drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE Giulio Benetti
2018-01-20 18:50 ` [PATCH 2/2] drm/sun4i: Handle DRM_MODE_FLAG_**SYNC_POSITIVE correctly Giulio Benetti
2018-01-22  8:51   ` Maxime Ripard
2018-01-22 20:27     ` Giulio Benetti
2018-01-24 17:38       ` Giulio Benetti
2018-01-24 19:37         ` Giulio Benetti
2018-01-25 15:21           ` Maxime Ripard
2018-01-25 16:50             ` Giulio Benetti
2018-01-26 14:56               ` Maxime Ripard
2018-01-26 15:55                 ` Giulio Benetti
2018-01-27 22:07                   ` Giulio Benetti
2018-02-01 10:14                     ` Maxime Ripard
2018-02-01 16:09                       ` Giulio Benetti
2018-02-05 14:21                         ` Maxime Ripard
2018-01-29 12:53                   ` Maxime Ripard
2018-02-07 10:39           ` Maxime Ripard
2018-02-07 12:49             ` Giulio Benetti
2018-02-08 20:40               ` Maxime Ripard
2018-02-09 10:13                 ` Chen-Yu Tsai
2018-02-15 18:05                 ` Giulio Benetti
2018-02-16 15:50                   ` Maxime Ripard
2018-02-28 15:56                     ` Giulio Benetti
2018-01-22  8:45 ` [PATCH 1/2] drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox