Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2838496rwb; Sun, 15 Jan 2023 23:32:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXsmuxDfL3OPIVBbOmXMngxykzLwA8esyK9UM5DYnZfLZ527M5a8WrJu0sstfdoSLqPB0dfm X-Received: by 2002:a05:6a20:af88:b0:b7:3047:948e with SMTP id ds8-20020a056a20af8800b000b73047948emr9556840pzb.16.1673854349882; Sun, 15 Jan 2023 23:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673854349; cv=none; d=google.com; s=arc-20160816; b=0/WvlvBh5qEZ/5VZQ0uC8Rix2alNcXY8c7FIewmRr80IF9jK/db8bT/faCmdaOfzt2 IIr2MfgdCaNjD9WDbmCcLx4YZkd00gxFa2yb9Yjryh9Bk3GXTdpURko8LdBdAl+T8nXA vEnuzVEqsqM/onxSL2O0mef0f/SmpEhlGPhsgMvA2ICF677QTHRXcjX2HIUf1lcT9k/q fl5nTA2qMx6VwnF+xtM7BdhFtos23+8DiT7DxvVjBePsWeNAHwj90qNNHjPZVf72RqH/ 0ThWFWr02yPuOFH01waoymc1VaDwLr8MnKuBakrvk/dO6G5UWF4jMbPdXp7hWaSE4Pyk tI+w== 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=Ni4uZerb82m6sG9PyWeah+pcBmtj9ALkxTiSi64ZLJA=; b=qlo+EJi/Htu4lX2rFxc76p8/VBvwQkSFBMEL6qgQTfuuafYyR8EvrzBmGc41iKuma8 nM0iESbmIFL79nn+qU8QQq14bN5DIJxXVFhkY47MqzuCKNDP7yuYMSUqSDaduv/k9R2f Uor3Ypt4h+EDHin1FigwkC4v8SPgViIfTUlDZ0WglnoWa22Az4ZBAsR33iTdltGK2Nfq 9OwwX+xbPmdUkZ/l/+U/WDujQ5/+DMCbJiLBjCbnsTkdTyMuBZ03olUcFnzA0PTAetTH PQCcELBp3KhRdgoOIDWysd9uDjanUGtlT1azJIh9fUYZDFchg8vjy6heuopOfw8pQrFh tSTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eZ0C9Mzd; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w185-20020a6382c2000000b0046eed3142cesi6208945pgd.350.2023.01.15.23.32.23; Sun, 15 Jan 2023 23:32:29 -0800 (PST) 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=eZ0C9Mzd; 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 S231786AbjAPHYQ (ORCPT + 51 others); Mon, 16 Jan 2023 02:24:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbjAPHYM (ORCPT ); Mon, 16 Jan 2023 02:24:12 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8762C650 for ; Sun, 15 Jan 2023 23:24:11 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id q23-20020a17090a065700b002290913a521so10775564pje.5 for ; Sun, 15 Jan 2023 23:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ni4uZerb82m6sG9PyWeah+pcBmtj9ALkxTiSi64ZLJA=; b=eZ0C9MzdHljfc0iZikOy6ACBmYGakhCzHaNk+ISGQS/AYhTbmGS85Ocf4VdKXS6J6g I8zU46FOzy8IxXnyZ7mDRivZNDcKEQIcnAXAcjLCxGynqMBM3tHGhMxMG7EjLWC8rewr r81qcBuGrWNd2j42VFSgoeflk+AUpWpe9KCFg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Ni4uZerb82m6sG9PyWeah+pcBmtj9ALkxTiSi64ZLJA=; b=HUKZs2HEI3/rdWfaD0aAT9hxA+FBwhzV9tZsAmFLkfcnWB3lOeVQ257hFcxzgkwKIu ebCnRatgFaUWaI7TINVPvKcGs9xyDqsp00IHy5pvMdsZ/cMcgZC9Iyag2eIkIux5vJ7r +ml2F3dowmoITewkfG8Rc6Ir1mB6rkYT6OXJMnmYn8/QqeZ3FYGylYn7dWqvKJQ/SUfY 9RM0VDUc/XW30ac1z2/zT6y6Y8kwybvSXzqLereVXC9ezL4UdFOk1OJsKGG4XopvO8e0 WyKTGu9IAGpqYF/kjI4C2uCRWZfeX+oolHdjFghGtCJKIhxQLJPhFOdG35cZXvt7EVgG vVTg== X-Gm-Message-State: AFqh2krm9lLQTpCRir4DIMcsQIa0U2vYsrs3P3ApnGhU1X87Ak8FAY9G vpmJOy4YaQ5aheuR3MEcfcq25w== X-Received: by 2002:a17:902:b608:b0:192:babc:20df with SMTP id b8-20020a170902b60800b00192babc20dfmr55147480pls.58.1673853851445; Sun, 15 Jan 2023 23:24:11 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:1d4f:b969:9e53:5eb0]) by smtp.gmail.com with ESMTPSA id s1-20020a170902ea0100b001913c5fc051sm7415541plg.274.2023.01.15.23.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 23:24:11 -0800 (PST) From: Chen-Yu Tsai To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter Cc: Chen-Yu Tsai , Xin Ji , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/bridge: anx7625: Use common macros for DP power sequencing commands Date: Mon, 16 Jan 2023 15:24:06 +0800 Message-Id: <20230116072406.3971025-1-wenst@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog MIME-Version: 1.0 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_NONE, SPF_HELO_NONE,SPF_PASS 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 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 --- This is a minor cleanup. No functional changes. 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 808dbf79d209..7e1fb93a6ce4 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -935,8 +935,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"); @@ -975,8 +975,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"); -- 2.39.0.314.g84b9a713c41-goog