Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1394321lqh; Mon, 6 May 2024 06:37:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUePoRCC/Z3T7ZvKLvuPyS75YMIObheaHHF8yL5ilPDf323uwIor02C+5zrLYKFyoWrQM1xJk583AJRii2shSe8s9PS7D4k7xuDQyctgg== X-Google-Smtp-Source: AGHT+IEo8b8RtJrkm1PMP0MEqShTCd0ZcWdzUs3n0gFEydsElweMG82aVX945M4t4O2AR6lydoDL X-Received: by 2002:a17:903:2306:b0:1e5:47ac:e760 with SMTP id d6-20020a170903230600b001e547ace760mr10938381plh.29.1715002667035; Mon, 06 May 2024 06:37:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715002667; cv=pass; d=google.com; s=arc-20160816; b=JZXeuB1uMTmIojyoXJIsam2BhwJy0dHC9kkkGxPLoEWS1V1YDneKSeQRJ/nMhmCQhX 9NIxzZAN68cJIYoi1gUWP0P2JoD8SesgxsL3VdC44PSIU4SHp8aUpW+Yd/ZKxdKWzXqZ 086njrcMJMYlNMQXgj9rcCUhDjOsbmt3qF643mu2AnFpmbbFV7r6jBEo9rDxCKnZ8Bfu pTXzmQIjfLZUW1K4w/VwD2Z4lg0AP0JDs/wWQYDoDk0H1fKTgzs5GkyCiFGADz1crto4 i26oShFbyMz81YTxupzuJ9LOGPcaYOWTIDT0JQcx0bVAbr6D7nY6JqBRi5M2BgOPr+Fh kNJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ntC+Vfux6EY7gajVp/vbM+k8iM8zuBDqDds5zq5Lbk4=; fh=SuRMajwH7N2ZLVBLirbkCwTFKIhKCObxyHKAw4nU6hQ=; b=Bph7EV1siPnQoogRuzQdaYAZEIlc9fAXQaFyitC001HXqFw8HAO9xgw5GFEoqGqdK9 GTUEpoOOSr/bOmQpEL1RWEAurIpk2fUJrbQrJlD6R732ZEkFXFCYj68LhxDNOzkzMbHn MBLtwKadeQJRdmXfMILj8USugHKO+sPgZMrjosaqBuiK1KFXphUGcOCYORPCVBHkflmn SZ7iAd9CQ9i4qbxH5GkoMNGSdz+hs2IDHsCF/1yNZG74aoIfqLPPV1Qr8xzG/dOTROnV LDNPNzcUn48UPZ2fAjKnHeJ3x1JZMw/kQgRa+ib8L1Bebc5AV7YskmNIhfjRECBSJ/QY EsEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HhS1pLRn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169901-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k14-20020a170902c40e00b001eb77576815si8741907plk.497.2024.05.06.06.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 06:37:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169901-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HhS1pLRn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169901-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AC184282145 for ; Mon, 6 May 2024 13:37:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF97E8172E; Mon, 6 May 2024 13:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HhS1pLRn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2104B811FE for ; Mon, 6 May 2024 13:35:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002533; cv=none; b=rYJiPjCyFUZVA/kw5KI3TGUkr0Hn6k4gydeQv/uDLM4vC/EJ6C94poA69sdID3PxnTmrvD0907/HbzAblXVdQG4GuHeQvcF7FtoihuzAr6TX8VTGyLIUrsDufTf4o/lZK0T+qRJ0cGdv/2JIWhd/Mrd3pc1FqDJkCs355yWB+EQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002533; c=relaxed/simple; bh=46hAq1PCM2INpFGrPzb+MElX1JVQQ10d/aQq2p0zy48=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L9Wwro/mFSmpqZrhA3/D70EBf8zOYSzV1sA7nY50H+m4I0SSZ+6oygjOpD0wR+HhFaYFmOWkTMQi0PXkELM01cPh5vTRmWRzlXvyYNVIWVY4mSpbKKe1wXgXiD36DM1OuM/t9hETUA/lX4X9xK0rf00BnwbNosao193i4oygNbo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HhS1pLRn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38788C116B1; Mon, 6 May 2024 13:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715002532; bh=46hAq1PCM2INpFGrPzb+MElX1JVQQ10d/aQq2p0zy48=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HhS1pLRn3qUNaKrsNVT+K3AvOvWmUzJ0dJTt14Q3gc7LX6ZSjiLZhmPzq9sacIq5P /RuAtzhq0ZYAnOqzx2hTZ/yk+AZsaWrRdnFmw2WsVQRNx3FfrS5mSPRv6rk9XxiZrf a9GXaqorKyymQxJ6ML4AW9XWEWW3GSYFu6mVTkvH806yeep8NpVXVyJWtQFuWUdo3f 97KnrhIsWEpmtjcirMjoc1QspIcLEK6NcDmc9JJjfEpY+FH591lsfQeFzko/lZq4az Jy+6R4jHiSUjuLmQyzHEG+b3lO/XOTDNpdwIHugcjbOIDpggKMW20VEnEYzgY4gvb1 4hlAD6+2n6Yqw== From: Michael Walle Date: Mon, 06 May 2024 15:34:35 +0200 Subject: [PATCH 06/20] drm/bridge: tc358775: redefine LV_MX() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240506-tc358775-fix-powerup-v1-6-545dcf00b8dd@kernel.org> References: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> In-Reply-To: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sam Ravnborg , Vinay Simha BN , Tony Lindgren Cc: Daniel Semkowicz , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.4 Drop the FLD_VAL macro, just use bit shifts. This is a preparation patch to switch to regmap and to remove the FLD_VAL(). While at it, reformat the LV_x enum. Signed-off-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c index 720c0d63fd6a..7ae86e8d4c72 100644 --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -124,39 +124,15 @@ #define LV_MX1619 0x0490 /* Bit 16 to 19 */ #define LV_MX2023 0x0494 /* Bit 20 to 23 */ #define LV_MX2427 0x0498 /* Bit 24 to 27 */ -#define LV_MX(b0, b1, b2, b3) (FLD_VAL(b0, 4, 0) | FLD_VAL(b1, 12, 8) | \ - FLD_VAL(b2, 20, 16) | FLD_VAL(b3, 28, 24)) +#define LV_MX(b0, b1, b2, b3) \ + (((b3) << 24) | ((b2) << 16) | ((b1) << 8) | (b0)) /* Input bit numbers used in mux registers */ enum { - LVI_R0, - LVI_R1, - LVI_R2, - LVI_R3, - LVI_R4, - LVI_R5, - LVI_R6, - LVI_R7, - LVI_G0, - LVI_G1, - LVI_G2, - LVI_G3, - LVI_G4, - LVI_G5, - LVI_G6, - LVI_G7, - LVI_B0, - LVI_B1, - LVI_B2, - LVI_B3, - LVI_B4, - LVI_B5, - LVI_B6, - LVI_B7, - LVI_HS, - LVI_VS, - LVI_DE, - LVI_L0 + LVI_R0, LVI_R1, LVI_R2, LVI_R3, LVI_R4, LVI_R5, LVI_R6, LVI_R7, + LVI_G0, LVI_G1, LVI_G2, LVI_G3, LVI_G4, LVI_G5, LVI_G6, LVI_G7, + LVI_B0, LVI_B1, LVI_B2, LVI_B3, LVI_B4, LVI_B5, LVI_B6, LVI_B7, + LVI_HS, LVI_VS, LVI_DE, LVI_L0 }; #define LVCFG 0x049C /* LVDS Configuration */ -- 2.39.2