<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
  </head>
  <body>
    <p>Hi,<br>
    </p>
    <p>Quote "<br>
    </p>
    <pre class="moz-quote-pre" wrap="">I'm not really sure why we need the first patch of this series here?
That patch only seem to undo what you did in patch 1
</pre>
    <p>
      "</p>
    <p>And another question (probably could be a stupid one):</p>
    <p>in "<i>[PATCH v2 2/2] drm/sun4i: tcon: improve DCLK polarity
        handling</i>" I see you deleted:</p>
    <pre class="moz-quote-pre" wrap="">-              clk_set_phase(tcon->dclk, 0);

</pre>
    <p>Is safe to assume that phase register will be always set to 0?</p>
    <p>Or maybe will be safer manually set it to 0 in every condition to
      avoid surprises (dirt values due to previous condition)?</p>
    <p><br>
    </p>
    <p>Marjan<br>
    </p>
    <pre class="moz-quote-pre" wrap="">
</pre>
    <div class="moz-cite-prefix">Il 08/01/2021 10:23, Maxime Ripard ha
      scritto:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20210108092355.7p5uakxt7lpdu3bn@gilmour">
      <pre class="moz-quote-pre" wrap="">Hi,

Thanks for those patches

On Thu, Jan 07, 2021 at 03:30:32AM +0100, Giulio Benetti wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">From: Giulio Benetti <a class="moz-txt-link-rfc2396E" href="mailto:giulio.benetti@micronovasrl.com"><giulio.benetti@micronovasrl.com></a>

It turned out(Maxime suggestion) that bit 26 of SUN4I_TCON0_IO_POL_REG is
dedicated to invert DCLK polarity and this makes thing really easier than
before. So let's handle DCLK polarity by adding
SUN4I_TCON0_IO_POL_DCLK_POSITIVE as bit 26 and activating according to
bus_flags the same way is done for all the other signals.

Cc: Maxime Ripard <a class="moz-txt-link-rfc2396E" href="mailto:maxime@cerno.tech"><maxime@cerno.tech></a>
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Suggested-by would be nice here :)

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Signed-off-by: Giulio Benetti <a class="moz-txt-link-rfc2396E" href="mailto:giulio.benetti@micronovasrl.com"><giulio.benetti@micronovasrl.com></a>
---
 drivers/gpu/drm/sun4i/sun4i_tcon.c | 20 +-------------------
 drivers/gpu/drm/sun4i/sun4i_tcon.h |  1 +
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 52598bb0fb0b..30171ccd87e5 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -569,26 +569,8 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
        if (info->bus_flags & DRM_BUS_FLAG_DE_LOW)
                val |= SUN4I_TCON0_IO_POL_DE_NEGATIVE;
 
-       /*
-        * On A20 and similar SoCs, the only way to achieve Positive Edge
-        * (Rising Edge), is setting dclk clock phase to 2/3(240°).
-        * By default TCON works in Negative Edge(Falling Edge),
-        * this is why phase is set to 0 in that case.
-        * Unfortunately there's no way to logically invert dclk through
-        * IO_POL register.
-        * The only acceptable way to work, triple checked with scope,
-        * is using clock phase set to 0° for Negative Edge and set to 240°
-        * for Positive Edge.
-        * On A33 and similar SoCs there would be a 90° phase option,
-        * but it divides also dclk by 2.
-        * Following code is a way to avoid quirks all around TCON
-        * and DOTCLOCK drivers.
-        */
        if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
-               clk_set_phase(tcon->dclk, 0);
-
-       if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
-               clk_set_phase(tcon->dclk, 240);
+               val |= SUN4I_TCON0_IO_POL_DCLK_POSITIVE;
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
I'm not really sure why we need the first patch of this series here?
That patch only seem to undo what you did in patch 1

Maxime
</pre>
    </blockquote>
  </body>
</html>