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 AF25934D90E; Fri, 21 Nov 2025 13:44:58 +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=1763732698; cv=none; b=lQXOJOT4TsZM+qp1itXBziZgU7fsQCVqfU69oOg0rHwsEhKoGg5/c6zRibJXDwunh4KBAxjIN0eLJyzHa+DgW5kHoScc7Uf4rCn86cBwYSdTUhAF4jb4yotH/xqaffFuAxzmBHU34u4+PdrKNQpf24KDECkYgD7HBg8/2T5DyAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763732698; c=relaxed/simple; bh=PqsdcOHQhogSMQcmxE1b2S21Hd5C02xn7L3Ur5ZHmfQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RBNmUF89WARFlgZVirR37Kid+MG4MD43WuDd/jKajK0RbtRuJEan7G2i6lG+lsmyL5gaHhrm5AArXHyNgCLbI15DyO3kKBZ3UOM34KWp9BdS7UfLQPYlAB31p6m6iJl3PihAAkreSEg8hq41F/+d5vEp6j2vXupA0/00X14GFvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lywXrcde; 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="lywXrcde" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1DA2C4CEF1; Fri, 21 Nov 2025 13:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763732698; bh=PqsdcOHQhogSMQcmxE1b2S21Hd5C02xn7L3Ur5ZHmfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lywXrcdez62n+qL15Qw0HA8mARzkWW3+/IHE18zKV7azbDf+P5bqN6gM3bRpJHhaV n+nHWpTJZ4td7J9RRrac40urDV5ragqgOOt1vemlSwaa1j0X8LM0SwD7n9REx3OXKX q6uWCAw/8AKAnYa3g/LRgszgmLX2zBDQZnuOE9Uc= 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 6.6 213/529] phy: rockchip: phy-rockchip-inno-csidphy: allow writes to grf register 0 Date: Fri, 21 Nov 2025 14:08:32 +0100 Message-ID: <20251121130238.593235911@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121130230.985163914@linuxfoundation.org> References: <20251121130230.985163914@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 6.6-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 98c92d6c482fe..279e19e7546b6 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.51.0