Message ID | 20230710090929.1873646-1-wenst@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4895623vqx; Mon, 10 Jul 2023 02:28:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGEl8j1Gftwmd8WLdZnhT10js5fs2zyHfewH5CZSbywPUviHBAX2WeUfco18hQU23SHjX5H X-Received: by 2002:a9d:6ac5:0:b0:6b7:2366:3497 with SMTP id m5-20020a9d6ac5000000b006b723663497mr12086613otq.18.1688981316033; Mon, 10 Jul 2023 02:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688981315; cv=none; d=google.com; s=arc-20160816; b=Zn2x5yesch9tO2Lryiq24T/2HVldtsGfaVy+/du4gfq/EpwUrv+yflRwyhzHymkiYK zRMBrjLoWhHCTm07zihudT/fP+f+O6aOsCDibXbz+Rtnt+9Qx8yzxe9ke9og/8Vz+Mya 7QbiyJk9pT6TtjNf9IOKh5jIaayXuxB9fz+ltcsjc7+QY5k31S425eW9A/C7SjlFwYs4 +7FIh9jaexMcz5UGRz3NBWy2aPBLEIgBqlBhZxBJMOySALHyIY0gIc7HaM+NyVyMmHQK lNRe11854deCDINTNYhVnDuUR3v4FWytk4smf8GPv4jt+EFMfB6Fp7wI9gewzyXSvxmv Jy9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+G6rw6Lzr4S57ts7YP1ylMlTPk8hLpi7yHWyU7B67Pk=; fh=UWzJOSVkeahw58LAo8I8udpg08360vHK6zT/LVneSs0=; b=qy4nqU7df0ifdd7ZpSyNg5qdChQRZK9+yR0yM6yeScATmILdEP8kwZQ2u0YPhZRWhJ BKAsDoBPfqYGYO3kncf69C2Exx6ahHPNbBGB1q4jEuOKWajZ6ENaIUSUeOvK3tQJUKIh B2SJ/8IHQjlFWH92pJb/jKyWa7Jhbz402SRTvjFczjf/b6U4To+SppW79sNtAq+TPdCt s1N1Yh8opnHx96SysWkQHJVIiV7Qa44sbuMyr/S5DiBbtKpWm2x2UEs4uB6SdcPEB90u 6t/BTDajdkKH67OCP9CkaktdECiPT94BFG1mqbiErT2ymdx+h5G7Xl83acZtmLMV3C20 Dkvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WA5KTELE; 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=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x186-20020a6386c3000000b0053fb768afcdsi8736903pgd.465.2023.07.10.02.28.23; Mon, 10 Jul 2023 02:28:35 -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=@chromium.org header.s=google header.b=WA5KTELE; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231358AbjGJJK6 (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Mon, 10 Jul 2023 05:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbjGJJKu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 10 Jul 2023 05:10:50 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76FA4127 for <linux-kernel@vger.kernel.org>; Mon, 10 Jul 2023 02:10:49 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3a1ebb79579so3263154b6e.3 for <linux-kernel@vger.kernel.org>; Mon, 10 Jul 2023 02:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1688980248; x=1691572248; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+G6rw6Lzr4S57ts7YP1ylMlTPk8hLpi7yHWyU7B67Pk=; b=WA5KTELETcwWf6w/I55emKwkPdPD6iqH5cMo+ztoYJPOEhyW0/lxNunr71IJJgEdb0 2BuAPcAN8UtUjVLClL3O/XIk22Ql1QD0X5B5mVXbPp4K8te5CPBCi5/r5a9c/0yAbs0M TXWfi6YXFEVwT9ToCZShEm1GhLQTa1PFXALAI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688980248; x=1691572248; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+G6rw6Lzr4S57ts7YP1ylMlTPk8hLpi7yHWyU7B67Pk=; b=BNCknR9mbVHnsaI0VnUjNW9ZZh5H+Pm5UHJkSrv/WTAVtRMpu27tUFX4K5jH18hodX txt5SGdcjDnSUwfteFqEJweBKIjxaPQlbEbSjCqG7pqiupoMcgbpLO8oOLbjopFdsOyD DxHXlsSsrZirWAOMu0y5dDucS61ngliT/Q6zjWX6R/MTF/v4zQn274gcKHQ5Drzyu01Y 3kaRXrP6RjOjXbaPSWwNXjcMUOxTXsNNoYn0Mtd/mimzhbuLOU0B00yiUIQVRGork14a qbkvAAb0hZlerOtncMLaRc1WG+IAbnudYmYHQHfb0RKGQ9pRmIkC4KblftbRXENfd+iW GfoQ== X-Gm-Message-State: ABy/qLbr2fNH9e2k3jr7UBahtBAKcwRCqXNUe8ButecrFnTk9rHksUtC enKD1rn0l/2N2oOyhTw6RQQfxA== X-Received: by 2002:a05:6358:52ca:b0:135:3f00:b8de with SMTP id z10-20020a05635852ca00b001353f00b8demr11516209rwz.17.1688980248710; Mon, 10 Jul 2023 02:10:48 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:be97:1d05:f9b6:36a6]) by smtp.gmail.com with ESMTPSA id w27-20020a637b1b000000b0053f06d09725sm6997574pgc.32.2023.07.10.02.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:10:48 -0700 (PDT) From: Chen-Yu Tsai <wenst@chromium.org> To: Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, Xin Ji <xji@analogixsemi.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Chen-Yu Tsai <wenst@chromium.org>, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4g?= =?utf-8?b?UHJhZG8=?= <nfraprado@collabora.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] drm/bridge: anx7625: Use common macros for DP power sequencing commands Date: Mon, 10 Jul 2023 17:09:27 +0800 Message-ID: <20230710090929.1873646-1-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771025271972200152 X-GMAIL-MSGID: 1771025271972200152 |
Series |
[RESEND] drm/bridge: anx7625: Use common macros for DP power sequencing commands
|
|
Commit Message
Chen-Yu Tsai
July 10, 2023, 9:09 a.m. UTC
The DRM DP code has macros for the DP power sequencing commands. Use them in the anx7625 driver instead of raw numbers. Fixes: 548b512e144f ("drm/bridge: anx7625: send DPCD command to downstream") Fixes: 27f26359de9b ("drm/bridge: anx7625: Set downstream sink into normal status") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> --- Collected tags and rebased on v6.5-rc1. drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Mon, 10 Jul 2023, Chen-Yu Tsai <wenst@chromium.org> wrote: > The DRM DP code has macros for the DP power sequencing commands. Use > them in the anx7625 driver instead of raw numbers. > > Fixes: 548b512e144f ("drm/bridge: anx7625: send DPCD command to downstream") > Fixes: 27f26359de9b ("drm/bridge: anx7625: Set downstream sink into normal status") > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> > Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > --- > Collected tags and rebased on v6.5-rc1. > > drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > index 8b985efdc086..9db3784cb554 100644 > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -931,8 +931,8 @@ static void anx7625_dp_start(struct anx7625_data *ctx) > > dev_dbg(dev, "set downstream sink into normal\n"); > /* Downstream sink enter into normal mode */ > - data = 1; > - ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); > + data = DP_SET_POWER_D0; > + ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); So you have code to implement the drm dp aux abstractions, why aren't you using drm_dp_dpcd_writeb() and friends here? BR, Jani. > if (ret < 0) > dev_err(dev, "IO error : set sink into normal mode fail\n"); > > @@ -971,8 +971,8 @@ static void anx7625_dp_stop(struct anx7625_data *ctx) > > dev_dbg(dev, "notify downstream enter into standby\n"); > /* Downstream monitor enter into standby mode */ > - data = 2; > - ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); > + data = DP_SET_POWER_D3; > + ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); > if (ret < 0) > DRM_DEV_ERROR(dev, "IO error : mute video fail\n");
On Mon, Jul 10, 2023 at 6:32 PM Jani Nikula <jani.nikula@linux.intel.com> wrote: > > On Mon, 10 Jul 2023, Chen-Yu Tsai <wenst@chromium.org> wrote: > > The DRM DP code has macros for the DP power sequencing commands. Use > > them in the anx7625 driver instead of raw numbers. > > > > Fixes: 548b512e144f ("drm/bridge: anx7625: send DPCD command to downstream") > > Fixes: 27f26359de9b ("drm/bridge: anx7625: Set downstream sink into normal status") > > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> > > Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > --- > > Collected tags and rebased on v6.5-rc1. > > > > drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > > index 8b985efdc086..9db3784cb554 100644 > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -931,8 +931,8 @@ static void anx7625_dp_start(struct anx7625_data *ctx) > > > > dev_dbg(dev, "set downstream sink into normal\n"); > > /* Downstream sink enter into normal mode */ > > - data = 1; > > - ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); > > + data = DP_SET_POWER_D0; > > + ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); > > So you have code to implement the drm dp aux abstractions, why aren't > you using drm_dp_dpcd_writeb() and friends here? I didn't write the original code. Nor do I do much DP stuff. IIRC someone pointed out to me these had proper macros, so I converted them. Would you accept a follow-up patch to convert the AUX transfers to the DRM abstractions? ChenYu > BR, > Jani. > > > > if (ret < 0) > > dev_err(dev, "IO error : set sink into normal mode fail\n"); > > > > @@ -971,8 +971,8 @@ static void anx7625_dp_stop(struct anx7625_data *ctx) > > > > dev_dbg(dev, "notify downstream enter into standby\n"); > > /* Downstream monitor enter into standby mode */ > > - data = 2; > > - ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); > > + data = DP_SET_POWER_D3; > > + ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); > > if (ret < 0) > > DRM_DEV_ERROR(dev, "IO error : mute video fail\n"); > > -- > Jani Nikula, Intel Open Source Graphics Center
On Tue, 11 Jul 2023, Chen-Yu Tsai <wenst@chromium.org> wrote: > On Mon, Jul 10, 2023 at 6:32 PM Jani Nikula <jani.nikula@linux.intel.com> wrote: >> >> On Mon, 10 Jul 2023, Chen-Yu Tsai <wenst@chromium.org> wrote: >> > The DRM DP code has macros for the DP power sequencing commands. Use >> > them in the anx7625 driver instead of raw numbers. >> > >> > Fixes: 548b512e144f ("drm/bridge: anx7625: send DPCD command to downstream") >> > Fixes: 27f26359de9b ("drm/bridge: anx7625: Set downstream sink into normal status") >> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> >> > Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> >> > --- >> > Collected tags and rebased on v6.5-rc1. >> > >> > drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- >> > 1 file changed, 4 insertions(+), 4 deletions(-) >> > >> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c >> > index 8b985efdc086..9db3784cb554 100644 >> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c >> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c >> > @@ -931,8 +931,8 @@ static void anx7625_dp_start(struct anx7625_data *ctx) >> > >> > dev_dbg(dev, "set downstream sink into normal\n"); >> > /* Downstream sink enter into normal mode */ >> > - data = 1; >> > - ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); >> > + data = DP_SET_POWER_D0; >> > + ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); >> >> So you have code to implement the drm dp aux abstractions, why aren't >> you using drm_dp_dpcd_writeb() and friends here? > > I didn't write the original code. Nor do I do much DP stuff. IIRC someone > pointed out to me these had proper macros, so I converted them. > > Would you accept a follow-up patch to convert the AUX transfers to the > DRM abstractions? I believe they would be welcome, but I'm personally not familiar with the driver in question. BR, Jani.
On Tue, Jul 11, 2023 at 3:23 PM Jani Nikula <jani.nikula@linux.intel.com> wrote: > > On Tue, 11 Jul 2023, Chen-Yu Tsai <wenst@chromium.org> wrote: > > On Mon, Jul 10, 2023 at 6:32 PM Jani Nikula <jani.nikula@linux.intel.com> wrote: > >> > >> On Mon, 10 Jul 2023, Chen-Yu Tsai <wenst@chromium.org> wrote: > >> > The DRM DP code has macros for the DP power sequencing commands. Use > >> > them in the anx7625 driver instead of raw numbers. > >> > > >> > Fixes: 548b512e144f ("drm/bridge: anx7625: send DPCD command to downstream") > >> > Fixes: 27f26359de9b ("drm/bridge: anx7625: Set downstream sink into normal status") > >> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> > >> > Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > >> > --- > >> > Collected tags and rebased on v6.5-rc1. > >> > > >> > drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- > >> > 1 file changed, 4 insertions(+), 4 deletions(-) > >> > > >> > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > >> > index 8b985efdc086..9db3784cb554 100644 > >> > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > >> > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > >> > @@ -931,8 +931,8 @@ static void anx7625_dp_start(struct anx7625_data *ctx) > >> > > >> > dev_dbg(dev, "set downstream sink into normal\n"); > >> > /* Downstream sink enter into normal mode */ > >> > - data = 1; > >> > - ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); > >> > + data = DP_SET_POWER_D0; > >> > + ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); > >> > >> So you have code to implement the drm dp aux abstractions, why aren't > >> you using drm_dp_dpcd_writeb() and friends here? > > > > I didn't write the original code. Nor do I do much DP stuff. IIRC someone > > pointed out to me these had proper macros, so I converted them. > > > > Would you accept a follow-up patch to convert the AUX transfers to the > > DRM abstractions? > > I believe they would be welcome, but I'm personally not familiar with > the driver in question. OK. I take it you are not blocking this patch then? ChenYu
On Mon, 10 Jul 2023 17:09:27 +0800, Chen-Yu Tsai wrote: > The DRM DP code has macros for the DP power sequencing commands. Use > them in the anx7625 driver instead of raw numbers. > > Applied, thanks! [1/1] drm/bridge: anx7625: Use common macros for DP power sequencing commands https://cgit.freedesktop.org/drm/drm-misc/commit/?id=2ba776f903cb Rob
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 8b985efdc086..9db3784cb554 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -931,8 +931,8 @@ static void anx7625_dp_start(struct anx7625_data *ctx) dev_dbg(dev, "set downstream sink into normal\n"); /* Downstream sink enter into normal mode */ - data = 1; - ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); + data = DP_SET_POWER_D0; + ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); if (ret < 0) dev_err(dev, "IO error : set sink into normal mode fail\n"); @@ -971,8 +971,8 @@ static void anx7625_dp_stop(struct anx7625_data *ctx) dev_dbg(dev, "notify downstream enter into standby\n"); /* Downstream monitor enter into standby mode */ - data = 2; - ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data); + data = DP_SET_POWER_D3; + ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data); if (ret < 0) DRM_DEV_ERROR(dev, "IO error : mute video fail\n");