From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEBF7CA1002 for ; Tue, 2 Sep 2025 00:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J7O4AGiqUs3tHZIvwAiyJrPlZHFsdxc001nt+QV8Cn8=; b=jAypubE6UJbD5+ MSZ1pKtYNy6ak/JPpxsbimrLNWy6BRD3sAZRrLrHc7CFW+QJZ35uRzym6zQZC+oMyeEusYDfIorif 8tgFZcf61XxAKVD6zz9mpvfcUgJijyylH4eJ66fKMmKP4X4WlUcJIeJ957TV+BbIKydZ7U/BKRRQ9 raVv4LyJlnai8QfAjBJ/Y1BsWemT8H25UtxZMJT8UVlwOPUWM8E6fOPzFtSMDDT+A2VdyK2+OGI0+ KqVGLS+JiKD/C/vxFxyojGrLjRA3+fj7eLXwihQQULTNK/l4hm5iViW4iqaicInCF++ew+ld6DNyq W2DSoQvvFBGv/c/UiKAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1utFGj-0000000EZDd-2Ufe; Tue, 02 Sep 2025 00:53:05 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1utBez-0000000DttD-42Xy; Mon, 01 Sep 2025 21:01:55 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 064D3451CC; Mon, 1 Sep 2025 21:01:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id D3B51C4CEFE; Mon, 1 Sep 2025 21:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756760512; bh=wzR4Qs8i+nZbzUbJH0z7ZvWkf0jeanCfOT0T/c8WVY0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=KrgHM3SeV6URt8G9/vWzTXxnVaHDOEDBGUPwCbk7K1eEHgAgdOerbADZGKoiSS6RL ZptWcoQffh2gYydUz7q9XmrChuVYEZiw0p1WmgXOjI1fd5pubZFShhklnpGV8/JNxt D3y/eXTCuGtQDrEdLkzW7mLoMvcPAitpcsf8ezg+vTRRDBMcSXD3SbFA/6GCHMd0/x dGexMiigs+HM2hgJN3711Iy3gQvRNKp+VHs6R87Ojc5xrtxCALry2iW9Dp0kVzReXr tCViXTT02Xfk0VDLstipWaaWHVTAtTLNNa3isN0lmBNU4afHDhzRXNdDaOAJERCDf1 PAjSfTf+9Er8w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0C16CA1007; Mon, 1 Sep 2025 21:01:52 +0000 (UTC) From: Michael Riesch via B4 Relay Date: Mon, 01 Sep 2025 22:47:45 +0200 Subject: [PATCH v3 4/7] phy: rockchip: phy-rockchip-inno-csidphy: allow writes to grf register 0 MIME-Version: 1.0 Message-Id: <20250616-rk3588-csi-dphy-v3-4-a5ccd5f1f438@collabora.com> References: <20250616-rk3588-csi-dphy-v3-0-a5ccd5f1f438@collabora.com> In-Reply-To: <20250616-rk3588-csi-dphy-v3-0-a5ccd5f1f438@collabora.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Kever Yang , Jagan Teki , Sebastian Reichel , Diederik de Haas , Neil Armstrong , Heiko Stuebner , Collabora Kernel Team Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Michael Riesch X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1756759662; l=1635; i=michael.riesch@collabora.com; s=20250410; h=from:subject:message-id; bh=l+DL7hvrQb52Alb7OjVyKnZ7Z6pkTmglNXwtSvoPg4M=; b=VBFa5PVV+22ZkBz4mEv89SE3mpULD6Gqp49UwNptsIWrtomhKNQUoNYSe2JnT756e/eyHOWH6 Vftcu8BdJF/Dil2nAXwnqCv++Sxfomn8BmTNbQv4p96wHKkSqjH2reL X-Developer-Key: i=michael.riesch@collabora.com; a=ed25519; pk=+MWX1fffLFZtTPG/I6XdYm/+OSvpRE8D9evQaWbiN04= X-Endpoint-Received: by B4 Relay for michael.riesch@collabora.com/20250410 with auth_id=371 X-Original-From: Michael Riesch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250901_140154_089958_DE09A37E X-CRM114-Status: GOOD ( 13.45 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: michael.riesch@collabora.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Michael Riesch The driver for the Rockchip MIPI CSI-2 DPHY uses GRF register offset value 0 to sort out undefined registers. However, the RK3588 CSIDPHY GRF this offset is perfectly fine (in fact, register 0 is the only one in this register file). Introduce a boolean variable to indicate valid registers and allow writes to register 0. Reviewed-by: Neil Armstrong Signed-off-by: Michael Riesch --- drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c index 2ab99e1d47eb..75533d071025 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c @@ -87,10 +87,11 @@ struct dphy_reg { u32 offset; u32 mask; u32 shift; + u8 valid; }; #define PHY_REG(_offset, _width, _shift) \ - { .offset = _offset, .mask = BIT(_width) - 1, .shift = _shift, } + { .offset = _offset, .mask = BIT(_width) - 1, .shift = _shift, .valid = 1, } static const struct dphy_reg rk1808_grf_dphy_regs[] = { [GRF_DPHY_CSIPHY_FORCERXMODE] = PHY_REG(RK1808_GRF_PD_VI_CON_OFFSET, 4, 0), @@ -145,7 +146,7 @@ static inline void write_grf_reg(struct rockchip_inno_csidphy *priv, const struct dphy_drv_data *drv_data = priv->drv_data; const struct dphy_reg *reg = &drv_data->grf_regs[index]; - if (reg->offset) + if (reg->valid) regmap_write(priv->grf, reg->offset, HIWORD_UPDATE(value, reg->mask, reg->shift)); } -- 2.39.5 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy