From: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
To: Bryan O'Donoghue <bod@kernel.org>, Robert Foss <rfoss@kernel.org>,
Todor Tomov <todor.too@gmail.com>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
jeyaprakash.soundrapandian@oss.qualcomm.com,
Vijay Kumar Tumati <vijay.tumati@oss.qualcomm.com>
Subject: Re: [PATCH v15 4/8] phy: qcom-mipi-csi2: Parametrise the common status register offset
Date: Wed, 22 Jul 2026 10:24:35 +0800 [thread overview]
Message-ID: <2512aab8-fbde-4b95-8619-6c32d60ab500@oss.qualcomm.com> (raw)
In-Reply-To: <20260720-kaanapali-camss-v15-4-c0b1c1167c5d@oss.qualcomm.com>
On 7/21/2026 12:50 PM, Hangxiang Ma wrote:
> The CSI2 PHY common status registers are not at a fixed offset from the
> common register block across SoCs: x1e80100 uses 0xb0 while other 3PH
> v2.4.0 parts differ.
>
> Replace the hard-coded 0xb0 in CSIPHY_3PH_CMN_CSI_COMMON_STATUSn() with
> a per-SoC common_status_offset field in struct mipi_csi2phy_device_regs,
> initialising x1e80100 to 0xb0 so behaviour is unchanged. This is a
> no-functional-change preparation for describing other SoC offsets.
>
> Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
> ---
> drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 16 +++++++++++-----
> drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 1 +
> 2 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> index 966d79c98f9b..8cd331cfb4b3 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> @@ -19,7 +19,8 @@
> #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B BIT(0)
> #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID BIT(1)
> #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL10_IRQ_CLEAR_CMD BIT(0)
> -#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, n) ((offset) + 0xb0 + 0x4 * (n))
> +#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, common_status_offset, n) \
> + ((offset) + (common_status_offset) + 0x4 * (n))
>
> #define CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(n) ((0x200 * (n)) + 0x24)
>
> @@ -176,19 +177,23 @@ static void phy_qcom_mipi_csi2_hw_version_read(struct mipi_csi2phy_device *csi2p
> CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 6));
>
> tmp = readl_relaxed(csi2phy->base +
> - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset, 12));
> + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset,
> + regs->common_status_offset, 12));
> csi2phy->hw_version = tmp;
>
> tmp = readl_relaxed(csi2phy->base +
> - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset, 13));
> + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset,
> + regs->common_status_offset, 13));
> csi2phy->hw_version |= (tmp << 8) & 0xFF00;
>
> tmp = readl_relaxed(csi2phy->base +
> - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset, 14));
> + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset,
> + regs->common_status_offset, 14));
> csi2phy->hw_version |= (tmp << 16) & 0xFF0000;
>
> tmp = readl_relaxed(csi2phy->base +
> - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset, 15));
> + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset,
> + regs->common_status_offset, 15));
> csi2phy->hw_version |= (tmp << 24) & 0xFF000000;
>
> dev_dbg_once(csi2phy->dev, "CSIPHY 3PH HW Version = 0x%08x\n", csi2phy->hw_version);
> @@ -375,6 +380,7 @@ const struct mipi_csi2phy_soc_cfg mipi_csi2_dphy_4nm_x1e = {
> .init_seq = lane_regs_x1e80100,
> .lane_array_size = ARRAY_SIZE(lane_regs_x1e80100),
> .common_regs_offset = 0x1000,
> + .common_status_offset = 0xb0,
> },
> .supply_names = (const char **)x1e_supplies,
> .num_supplies = ARRAY_SIZE(x1e_supplies),
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> index 7e55ae007370..d6366f809e51 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> @@ -51,6 +51,7 @@ struct mipi_csi2phy_device_regs {
> const struct mipi_csi2phy_lane_regs *init_seq;
> const int lane_array_size;
> const u32 common_regs_offset;
> + const u32 common_status_offset;
> };
>
> struct mipi_csi2_genpd {
>
Hi Bryan, could you try to add this change into your PHY driver? This
macro format has existed in old arch. We once have such discussion on v5
thread.
https://lore.kernel.org/all/bc6abd24-d56a-4fc0-89e9-8986e8d8b3b7@oss.qualcomm.com/
If not applicable, could I put it in KNP series as a fixing in this
format? It can save us the effort of merging the re-architected version.
We experienced a similar issue with the previous architecture, where
additional fixes were needed to accommodate the new platform
requirements, leading to considerable time and resource investment.
Thanks a lot.
Best regards,
Hangxiang
next prev parent reply other threads:[~2026-07-22 2:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 4:50 [PATCH v15 0/8] media: qcom: camss: Add Kaanapali support Hangxiang Ma
2026-07-21 4:50 ` [PATCH v15 1/8] dt-bindings: phy: qcom,x1e80100-csi2-phy: Add Kaanapali CSI2 PHY Hangxiang Ma
2026-07-21 22:40 ` Bryan O'Donoghue
2026-07-22 6:51 ` Krzysztof Kozlowski
2026-07-22 7:13 ` hangxiang.ma
2026-07-21 4:50 ` [PATCH v15 2/8] media: dt-bindings: Add CAMSS device for Kaanapali Hangxiang Ma
2026-07-21 22:41 ` Bryan O'Donoghue
2026-07-22 1:42 ` hangxiang.ma
2026-07-21 4:50 ` [PATCH v15 3/8] media: qcom: camss: Add Kaanapali compatible camss driver Hangxiang Ma
2026-07-21 4:50 ` [PATCH v15 4/8] phy: qcom-mipi-csi2: Parametrise the common status register offset Hangxiang Ma
2026-07-22 2:24 ` Hangxiang Ma [this message]
2026-07-22 8:07 ` Bryan O'Donoghue
2026-07-22 9:11 ` Hangxiang Ma
2026-07-22 9:43 ` Bryan O'Donoghue
2026-07-21 4:50 ` [PATCH v15 5/8] media: qcom: camss: csiphy: Add support for v2.4.0 two-phase CSIPHY Hangxiang Ma
2026-07-21 4:50 ` [PATCH v15 6/8] media: qcom: camss: csid: Add support for CSID gen4 Hangxiang Ma
2026-07-21 4:50 ` [PATCH v15 7/8] media: qcom: camss: vfe: Add support for VFE gen4 Hangxiang Ma
2026-07-21 4:50 ` [PATCH v15 8/8] media: qcom: camss: tpg: Add support for v2.4.0 TPG Hangxiang Ma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2512aab8-fbde-4b95-8619-6c32d60ab500@oss.qualcomm.com \
--to=hangxiang.ma@oss.qualcomm.com \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jeyaprakash.soundrapandian@oss.qualcomm.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=todor.too@gmail.com \
--cc=vijay.tumati@oss.qualcomm.com \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®