From mboxrd@z Thu Jan 1 00:00:00 1970 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 1E2183101DD; Wed, 3 Dec 2025 16:02:53 +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=1764777774; cv=none; b=KuE0WvPJDH6kZmZYSFbyfzI76wrP/cO10GmNK0QzcH+2NhMMhue/jFpv4l/rcro2XVYsu0aY40xq2qZrMA4+qYS9L2xVTRBjPl7lsQE2GBrYygW/YjXAqtm1QaUfvDZrMxA/Jg5NeBFPdBg+yb+Mijc8MIuhVIG0x5B8Zy2gb74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764777774; c=relaxed/simple; bh=0y8DBJWniQxXtYmgEN8yF1+BvUzSZnb8qqUk3MHehok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fFruXE+fLZ6pi6kSCzxhOAAHEN7k07Q2PQWBLIdMDdAwZBzTBRZrxv9sbN5SrrEHcvhJR+vrtmnTTU9qyvNZSnMRqtG2iO5s30E1qA/V2BrdTHqe8SdFuNL56pfjSbHDeHZ9SqEYIuVL9m84zfTUb5Ob/7dHUZrjgkiSzOHp57M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NL6l2hY0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NL6l2hY0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A852C4CEF5; Wed, 3 Dec 2025 16:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764777773; bh=0y8DBJWniQxXtYmgEN8yF1+BvUzSZnb8qqUk3MHehok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NL6l2hY09UT8C5RfhkXEfpukt5JHzVK88MzMDtPRIUeBNwZw2WmUGg6D87bPz3k/C T4lV3Hr/pvH1XjnvT1sHNYv6ayRaGI+CFtu+GAfDIdd1FhanuwplVhS9sIreXTICWh 8XQSy/mUsV+4+HVjS4MhejnlnRy6LanDYcdC81m4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Neil Armstrong , Michael Riesch , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 143/392] phy: rockchip: phy-rockchip-inno-csidphy: allow writes to grf register 0 Date: Wed, 3 Dec 2025 16:24:53 +0100 Message-ID: <20251203152419.349348482@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152414.082328008@linuxfoundation.org> References: <20251203152414.082328008@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Riesch [ Upstream commit 8c7c19466c854fa86b82d2148eaa9bf0e6531423 ] 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 Link: https://lore.kernel.org/r/20250616-rk3588-csi-dphy-v4-4-a4f340a7f0cf@collabora.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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 ca13a604ab4ff..286b38cc6f442 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c @@ -82,10 +82,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), @@ -134,7 +135,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.51.0