From: Marek Vasut <marex@denx.de>
To: Jonathan Liu <net147@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Maxime Ripard <maxime@cerno.tech>,
Jagan Teki <jagan@amarulasolutions.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <narmstrong@baylibre.com>,
Robert Foss <robert.foss@linaro.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm: bridge: icn6211: Adjust clock phase using SYS_CTRL_1
Date: Mon, 23 May 2022 15:15:47 +0200 [thread overview]
Message-ID: <868d010c-9fca-3fac-7657-faaa2f271c14@denx.de> (raw)
In-Reply-To: <20220523130144.444225-1-net147@gmail.com>
On 5/23/22 15:01, Jonathan Liu wrote:
> The code from [1] sets SYS_CTRL_1 to different values depending on the
> desired clock phase (0, 1/4, 1/2 or 3/4). A clock phase of 0 aligns the
> positive edge of the clock with the pixel data while other values delay
> the clock by a fraction of the clock period. A clock phase of 1/2 aligns
> the negative edge of the clock with the pixel data.
>
> The driver currently hard codes SYS_CTRL_1 to 0x88 which corresponds to
> aligning the positive edge of the clock with the pixel data. This won't
> work correctly for panels that require aligning the negative edge of the
> clock with the pixel data.
>
> Adjust the clock phase to 0 if DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE is
> present in bus_flags, otherwise adjust the clock phase to 1/2 as
> appropriate for DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE.
>
> [1] https://github.com/tdjastrzebski/ICN6211-Configurator
>
> Signed-off-by: Jonathan Liu <net147@gmail.com>
> ---
> V2: Use GENMASK and FIELD_PREP macros
> ---
> drivers/gpu/drm/bridge/chipone-icn6211.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c
> index 47dea657a752..f1538fb5f8a9 100644
> --- a/drivers/gpu/drm/bridge/chipone-icn6211.c
> +++ b/drivers/gpu/drm/bridge/chipone-icn6211.c
> @@ -9,6 +9,8 @@
> #include <drm/drm_print.h>
> #include <drm/drm_mipi_dsi.h>
>
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> #include <linux/delay.h>
> #include <linux/gpio/consumer.h>
> #include <linux/i2c.h>
> @@ -26,6 +28,11 @@
> #define PD_CTRL(n) (0x0a + ((n) & 0x3)) /* 0..3 */
> #define RST_CTRL(n) (0x0e + ((n) & 0x1)) /* 0..1 */
> #define SYS_CTRL(n) (0x10 + ((n) & 0x7)) /* 0..4 */
> +#define SYS_CTRL_1_CLK_PHASE_MSK GENMASK(5, 4)
This should be GENMASK(7, 6) , no ?
next prev parent reply other threads:[~2022-05-23 13:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 13:01 Jonathan Liu
2022-05-23 13:15 ` Marek Vasut [this message]
2022-05-23 13:20 ` Jonathan Liu
2022-05-23 13:25 ` Marek Vasut
2022-05-26 12:08 ` Robert Foss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=868d010c-9fca-3fac-7657-faaa2f271c14@denx.de \
--to=marex@denx.de \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@linux.ie \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime@cerno.tech \
--cc=narmstrong@baylibre.com \
--cc=net147@gmail.com \
--cc=robert.foss@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®