Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2148235iof; Tue, 7 Jun 2022 21:21:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQVWkZDYVoUs1u/1WHrclionc+fMcx/tT34IZ4rzlfgcYhZPvkTOmmGjMUaxH4nBsfOZfm X-Received: by 2002:a63:ef41:0:b0:3fb:c201:797d with SMTP id c1-20020a63ef41000000b003fbc201797dmr29281191pgk.104.1654662081279; Tue, 07 Jun 2022 21:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654662081; cv=none; d=google.com; s=arc-20160816; b=ITc/YRQvnFD7v3KqofKFJxSMSY7s6acAYwpzRHqsYF1HSlV7YgKLJZHtGPKKHxL/ze nUJDOHeD4KIl/wHC2vjInXgKNrxZ1kmqFMZyX1N67TKzkqwyKipUoU613uqaTjnARZLA SqTAFLa74ClQg9gQBwRpfZ+wfKGHVT2wgrOt4Mb4y5NZxixf2xGa1mhpZEV3OaG/4HS8 y8qgggEuKzNES9mGXFXIFU0nbCftV2VdWxQx50f3u7pPetzu1mV0sQk2rEuqBmLfN9cd 47tbrfREwg6WMtYpdbCg2aP5w0KqZfX3dfyZ3B9n46e7pN7zai4GFBmFJXZgeN+EpC/O fNDw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s9FQlQcIbK9ypSujLUrEtJRlR8U2z0+w2PSdfUicIAk=; b=L0BQ83jop4NFfXK3O/Gq8YPYm6GYNSjpznnURQiG9HfcQ4LpSdsSlAlU+hl5xAkslb Wgx6D06sPJl+pcaWoGHM4kIKPpXP3tIS8oXrErCCel6wmRnbbm3oXmuARzQNPwvJ9xbj jTGkAWd2HgK0zBICh5cY1uJe/JFR8pgCVrZ/w2cga9B4aWAusY2CjlUxLi6Abr4HM/at myds8ZlH4rOhsiybXii5T7dpFp7hQIhr18bKErA0oC9eG2BoEwPUbqNoJ/MomzBioids fNAH7lVhfPgxmcAiXzZvpO20/FZKA/ZyUNkPH4ERpQJaMvP3iwN6vwSKtULG+KDqJXON hwZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kPccrwz6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p5-20020a17090ad30500b001cab382d4e3si71285pju.49.2022.06.07.21.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:21:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kPccrwz6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42496281874; Tue, 7 Jun 2022 20:52:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385076AbiFGWpT (ORCPT + 99 others); Tue, 7 Jun 2022 18:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380319AbiFGVam (ORCPT ); Tue, 7 Jun 2022 17:30:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26E69229B74; Tue, 7 Jun 2022 12:02:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 86D3B617E4; Tue, 7 Jun 2022 19:02:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 912E8C385A2; Tue, 7 Jun 2022 19:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628569; bh=brWqBySsTGrjDuMpp7++td+H+52jN/Qy6jJTsXAgFRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kPccrwz6CTtiMyMEGTPe46Cn9Scf+7wFcvlacXKIxzOJ7JBHnag3uWlkjATh2ip+j 7VXVM7BJ/O9TH2Wx9XYY+w1S93YCEJthv9c4jx8P5yw46ckLNiOnurysKdbypRWHwX 72o4quSempaUuZTnNiFnobgBBE9coM5KkjXepUGM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pin-Yen Lin , Robert Foss , Sasha Levin Subject: [PATCH 5.18 378/879] drm/bridge: it6505: Send DPCD SET_POWER to downstream Date: Tue, 7 Jun 2022 18:58:16 +0200 Message-Id: <20220607165013.842501152@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Pin-Yen Lin [ Upstream commit 46ca7da7f1e8592af6059419176dd58c10dcdb5b ] Send DPCD SET_POWER command to downstream in .atomic_disable to make the downstream monitor enter the power down mode, so the device suspend won't be affected. Fixes: b5c84a9edcd418 ("drm/bridge: add it6505 driver") Signed-off-by: Pin-Yen Lin Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220425134424.1150965-1-treapking@chromium.org Reviewed-by: Robert Foss Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/ite-it6505.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index f2f101220ade..c54664677172 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -737,8 +737,9 @@ static int it6505_drm_dp_link_probe(struct drm_dp_aux *aux, return 0; } -static int it6505_drm_dp_link_power_up(struct drm_dp_aux *aux, - struct it6505_drm_dp_link *link) +static int it6505_drm_dp_link_set_power(struct drm_dp_aux *aux, + struct it6505_drm_dp_link *link, + u8 mode) { u8 value; int err; @@ -752,18 +753,20 @@ static int it6505_drm_dp_link_power_up(struct drm_dp_aux *aux, return err; value &= ~DP_SET_POWER_MASK; - value |= DP_SET_POWER_D0; + value |= mode; err = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value); if (err < 0) return err; - /* - * According to the DP 1.1 specification, a "Sink Device must exit the - * power saving state within 1 ms" (Section 2.5.3.1, Table 5-52, "Sink - * Control Field" (register 0x600). - */ - usleep_range(1000, 2000); + if (mode == DP_SET_POWER_D0) { + /* + * According to the DP 1.1 specification, a "Sink Device must + * exit the power saving state within 1 ms" (Section 2.5.3.1, + * Table 5-52, "Sink Control Field" (register 0x600). + */ + usleep_range(1000, 2000); + } return 0; } @@ -2624,7 +2627,8 @@ static enum drm_connector_status it6505_detect(struct it6505 *it6505) if (it6505_get_sink_hpd_status(it6505)) { it6505_aux_on(it6505); it6505_drm_dp_link_probe(&it6505->aux, &it6505->link); - it6505_drm_dp_link_power_up(&it6505->aux, &it6505->link); + it6505_drm_dp_link_set_power(&it6505->aux, &it6505->link, + DP_SET_POWER_D0); it6505->auto_train_retry = AUTO_TRAIN_RETRY; if (it6505->dpcd[0] == 0) { @@ -2960,8 +2964,11 @@ static void it6505_bridge_atomic_disable(struct drm_bridge *bridge, DRM_DEV_DEBUG_DRIVER(dev, "start"); - if (it6505->powered) + if (it6505->powered) { it6505_video_disable(it6505); + it6505_drm_dp_link_set_power(&it6505->aux, &it6505->link, + DP_SET_POWER_D3); + } } static enum drm_connector_status -- 2.35.1