dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Xin Ji <xji@analogixsemi.com>
To: Robert Foss <robert.foss@linaro.org>
Cc: dri-devel@lists.freedesktop.org, Jonas Karlman <jonas@kwiboo.se>,
	David Airlie <airlied@linux.ie>,
	qwen@analogixsemi.com, Neil Armstrong <narmstrong@baylibre.com>,
	linux-kernel@vger.kernel.org,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	mliu@analogixsemi.com,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	hsinyi@chromium.org, bliang@analogixsemi.com
Subject: Re: [PATCH] drm/bridge: anx7625: Set HPD irq detect window to 2ms
Date: Tue, 6 Sep 2022 10:57:53 +0800	[thread overview]
Message-ID: <20220906025753.GA642918@anxtwsw-Precision-3640-Tower> (raw)
In-Reply-To: <CAG3jFyum5M8iGdW++c7rayUn4ogJ6izWaX7VaqMfV7ShAe_kRQ@mail.gmail.com>

On Mon, Sep 05, 2022 at 06:48:06PM +0200, Robert Foss wrote:
> Hi Xin,
> 
> On Sat, 3 Sept 2022 at 15:09, Xin Ji <xji@analogixsemi.com> wrote:
> >
> > Some panels trigger HPD irq due to noise, the HPD debounce
> > may be 1.8ms, exceeding the default irq detect window, ~1.4ms.
> > This patch set HPD irq detection window to 2ms to
> > tolerate the HPD noise.
> >
> > Signed-off-by: Xin Ji <xji@analogixsemi.com>
> > ---
> >  drivers/gpu/drm/bridge/analogix/anx7625.c | 14 ++++++++++++++
> >  drivers/gpu/drm/bridge/analogix/anx7625.h |  6 ++++++
> >  2 files changed, 20 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > index c74b5df4cade..0c323b5a1c99 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> > @@ -1440,6 +1440,20 @@ static void anx7625_start_dp_work(struct anx7625_data *ctx)
> >
> >  static int anx7625_read_hpd_status_p0(struct anx7625_data *ctx)
> >  {
> > +       int ret;
> > +
> > +       /* Set irq detect window to 2ms */
> > +       ret = anx7625_reg_write(ctx, ctx->i2c.tx_p2_client,
> > +                               HPD_DET_TIMER_BIT0_7, HPD_TIME & 0xFF);
> > +       ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client,
> > +                                HPD_DET_TIMER_BIT8_15,
> > +                                (HPD_TIME >> 8) & 0xFF);
> > +       ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client,
> > +                                HPD_DET_TIMER_BIT16_23,
> > +                                (HPD_TIME >> 16) & 0xFF);
> 
> Does the HPD debounce timer register need to be written for every HPD
> status read?
Hi Robert Foss, yes, it is better to set it in every HPD status check, because the
HPD may be affected by noise, once the chip detect HPD is low, the timer
register will be automatically set to 1.4ms, so the driver better set it
in each check loop.

Thanks,
Xin
> 
> > +       if (ret < 0)
> > +               return ret;
> > +
> >         return anx7625_reg_read(ctx, ctx->i2c.rx_p0_client, SYSTEM_STSTUS);
> >  }
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.h b/drivers/gpu/drm/bridge/analogix/anx7625.h
> > index e257a84db962..14f33d6be289 100644
> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.h
> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.h
> > @@ -132,6 +132,12 @@
> >  #define I2S_SLAVE_MODE 0x08
> >  #define AUDIO_LAYOUT   0x01
> >
> > +#define HPD_DET_TIMER_BIT0_7   0xea
> > +#define HPD_DET_TIMER_BIT8_15  0xeb
> > +#define HPD_DET_TIMER_BIT16_23 0xec
> > +/* HPD debounce time 2ms for 27M clock */
> > +#define HPD_TIME               54000
> > +
> >  #define AUDIO_CONTROL_REGISTER 0xe6
> >  #define TDM_TIMING_MODE 0x08
> >
> > --
> > 2.25.1
> >

  reply	other threads:[~2022-09-06  2:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03 13:08 [PATCH] drm/bridge: anx7625: Set HPD irq detect window to 2ms Xin Ji
2022-09-05 16:48 ` Robert Foss
2022-09-06  2:57   ` Xin Ji [this message]
2022-09-06 12:10     ` 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=20220906025753.GA642918@anxtwsw-Precision-3640-Tower \
    --to=xji@analogixsemi.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=bliang@analogixsemi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hsinyi@chromium.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mliu@analogixsemi.com \
    --cc=narmstrong@baylibre.com \
    --cc=qwen@analogixsemi.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;
as well as URLs for NNTP newsgroup(s).