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 30B24DDAB; Tue, 11 Nov 2025 01:27:54 +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=1762824474; cv=none; b=AnnZ7Q4UpMcqlIhWLy5oTT+Akw0BvKwevurrHQk0t03et/njTOOvOGxachDPCVvsWPUtky7/Z8NsnBvfBkYHoskl3oToGWmpVh7wB/p9G67vNKu5X1VpzIEm4HVjq9ZZio7YGs4BE+OPxwVWZ3CyRitsuFiA5Pf1maqgDzS9osw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762824474; c=relaxed/simple; bh=Ca2ft1mwyrcdgnM2gaUBtDkpeUeRRVgcJzGMy+0zbm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r/7rTGcsE/wPZD9BGQ61kS8Vmz4iXZrJwH0XRqnOidRKmhu4EiA18UJmkrYjJpwi0Qv3FxAeYluZ1FYfQIFgjB5Q308y/mWCUCAwDsNBp8RkHFy3U8wK8oOlfLCqzg7fwrmkzGkysu8Twj5TQN2PfzVEmCKLAmZrDNLY1kxBoPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LdfuNdL/; 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="LdfuNdL/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFB1CC116D0; Tue, 11 Nov 2025 01:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762824474; bh=Ca2ft1mwyrcdgnM2gaUBtDkpeUeRRVgcJzGMy+0zbm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LdfuNdL/m0K3+9xBt+0TH67TrBfINEwFy4KCffeZZ+A+R/KKYWIXbOb+GUBDacrv8 4hbiLez/7foBK2sP+OSIL7bND773hWtHshnTh9OUUka5kaj8WWelY7zMVKTL3kP5jL 7DPCU5jWMaWt5j4U+m/zn5QpKKNBvE5oh2mD4JQo= 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.17 507/849] phy: rockchip: phy-rockchip-inno-csidphy: allow writes to grf register 0 Date: Tue, 11 Nov 2025 09:41:17 +0900 Message-ID: <20251111004548.686529912@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111004536.460310036@linuxfoundation.org> References: <20251111004536.460310036@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.17-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 2ab99e1d47ebe..75533d0710250 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