Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4281434rwb; Tue, 6 Sep 2022 05:30:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR4mvbmbvzbjO3zsAbVWxtch8qFQjXPVv2tOS+/9zmr7GeFSuXXFuiHTMNk7r/Xn25bxzd08 X-Received: by 2002:a17:907:97d5:b0:730:9eac:d965 with SMTP id js21-20020a17090797d500b007309eacd965mr38662529ejc.353.1662467400219; Tue, 06 Sep 2022 05:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662467400; cv=none; d=google.com; s=arc-20160816; b=FxzOT6UU1DGfFDca+qUUnEumNZtmXXaZYNT9SpJ2HcEoXwwhY58Jg0HqDBPMn9iGJt 8tm2TNUXpAuaTOr4FfxsG3I4HetMi6mwyA1iCCT3OAMRx4mv6JnrJFp7cN+aUWCie9PG ef2+/qrXy6RFopbLP6a40WZFU26y18p8F3g1kYbOpvHf6R3BJcEftayJLuNuiqy+FuL1 1iw7NokVCOwKGRjcqkDyk60yTpt5swsHuzMjaoGYHZ9ipFzB3laSUsVHrJLfTA/occPv mg/7HARtWsPVn4LYEagaJZMdV7uy02oth2/FiXqzpmUeLeSVKOT+/2bJuGn0gzi8Q1oK OLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vCwl8j+RWcYnHs2Ge4KIIN5Weh4JvqT5rY25vxWNLag=; b=bAQrqTIhGQsInY9JNeOI8nOn5IvKIlFqrL0IvlOSQ9QsBA1G/LufHRM6jpF/eFFYcm /lwmG5jOVCJsmKWI0PFxh5sxYs8JwwMLI92fKbrZcOZbwRzRaB+mfNBKEFHONPfl/V2U NxKAGOQLD3R5+6cK8I44V+1r34e4VFBrAXEE1qj5X8c5b1XRUZvjdmPMFERWSnK8Jryq Wy+xSN0Lu0KsbmmBA/Ek1kgK/aA2h1/OPiqhkrpEA/HZex3vKd+McsquFg8hbwuXxXW5 0gJ6HNCPcDLvLNQJH8iiUWCSW3hmOI6HxsIWobOZnhQA8AXFIDGBLRnB84Mbs8LvM2Hr 572A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lOa6WYPs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc40-20020a17090716a800b0073d68a7d1c8si10209231ejc.656.2022.09.06.05.29.27; Tue, 06 Sep 2022 05:30:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lOa6WYPs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233387AbiIFMKV (ORCPT + 99 others); Tue, 6 Sep 2022 08:10:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233269AbiIFMKT (ORCPT ); Tue, 6 Sep 2022 08:10:19 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2052402DF for ; Tue, 6 Sep 2022 05:10:17 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id qh18so22714905ejb.7 for ; Tue, 06 Sep 2022 05:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=vCwl8j+RWcYnHs2Ge4KIIN5Weh4JvqT5rY25vxWNLag=; b=lOa6WYPsC1uUBdMQKtoUl2jwn4GzkujrcdNHqpHHagPEkQznc0SQeaek3uPXhsII9/ aWPQmIh2WGQPv77i4xNjBsSWZ8abLLQe+5DF3vYb4xuKgBVSFgzLmamx19gqzj+Qfi5q Em92ghJNH10uPXU62B69AYerZ6D/8jZbKnj1kmFla5ZL8FK6XqyPf+4kqZ9++hn2PlII Bsp9dHsaKTze2hAOo6NLT/sGZytLyUlAODLhJn49VeVWs3KkglxqcPf4RNCiGsruzntX fVgwOzbzHgjK3Tzqz8Jj55H+wD8Fk8kC8PuzcwFx1aHhT/B65klc5BVwIi/sDedtJuY1 gkaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=vCwl8j+RWcYnHs2Ge4KIIN5Weh4JvqT5rY25vxWNLag=; b=ub5NFLGOXDObH5vBFTmD/3AuQpSdNcPYbKFFImnPRYG7uZRwDsl+/wfJbLJDSNhM+3 +6VKyX3/UUVns3JwQSuGqRzYY0d/bbKumrDx3i+TAeFkbK9azcZe76JIzZxdeRMb91yM q4VbuHo5wvbWkwFtS66DUwG2mEwEw8lqedGHvEAosmKrCZ/X8jxH0DOjHfR6r2wEwWdv U3nQvmm+miGcvOMQqjAwRvnKyLRAiMskUt4+EUehyWb4vmok/WXyeJqgVBMLBFehzOe8 HJstogPqa7MwkDEJxMNKrxKhwXN+YB3LcwX6ZSSlGxK9CExtaQksy636Lc1pWABYU+T5 wVhQ== X-Gm-Message-State: ACgBeo2+E0iurLLbmsz7IyRy4w5sjMnFuXKIn6brT/BhTsciFq5h+Gpi RC2q7aTl9WoCE5oYd3qC/Kr9jm7+ly2VLNq/xUDEfNaja3U= X-Received: by 2002:a17:906:eece:b0:76f:5c6:2340 with SMTP id wu14-20020a170906eece00b0076f05c62340mr2662494ejb.383.1662466215963; Tue, 06 Sep 2022 05:10:15 -0700 (PDT) MIME-Version: 1.0 References: <20220903130833.541463-1-xji@analogixsemi.com> <20220906025753.GA642918@anxtwsw-Precision-3640-Tower> In-Reply-To: <20220906025753.GA642918@anxtwsw-Precision-3640-Tower> From: Robert Foss Date: Tue, 6 Sep 2022 14:10:05 +0200 Message-ID: Subject: Re: [PATCH] drm/bridge: anx7625: Set HPD irq detect window to 2ms To: Xin Ji Cc: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , bliang@analogixsemi.com, qwen@analogixsemi.com, mliu@analogixsemi.com, hsinyi@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Sept 2022 at 04:58, Xin Ji wrote: > > 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 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 > > > --- > > > 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 > > > Reviewed-by: Robert Foss Applied to drm-misc-next.