From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796188814; b=OeScEIgsMSUfdUK8UL/tfH9MrMGv43CFc78nSRoNrZd6xChpFIItR6xFRYKir6pddQzm ZriW4mU8dLwRHGzSe+byrRoAaQiZZRw1BB0GovCq5S0frbegnzBVcwq+Sjwkq+THTUGsA B57OBLfG4HzKLda4zlcXX9GEh7I2FW8LobRlpROljsFhRRmNJjfWgQ/67re3tW/5O+Bhl P4SnjABN8o4K1htEdXMo1bx+9AEWqWEbg1ELFH1uFqSf4YsgKVjbIBpzUo1ZTRfhCN6Je D9ZxBEoeOCKx4NJYsJhoExnxO9otSER5MmvvUw90yOj/4KCZSnn73LhxJAo8UWKCDcw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796188814; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:Content-Language:Autocrypt:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=jwnmW6DmW8OFSLKPnUppBS6skDJXw7uqKbIdoHyMWtU=; b=RdvYTLcaI6EiHzs05UlUMkNIMGClzI9tCNWY28MGwhda9rRkZ43dR7ekYonoPhNWdrVw ZXOF/ca/sFFyy7/Lo+CxaIgR4tZDZruScw3aze2OSbhmsrpT/oRlMMmbMcuXn8PzXVfqm fV94pGR0sGrfKS5ViatHu+DhmlMmUdgX3vbLZfRw8EEV58ICprd9qZR3YaqAt+bWIt3Wg ziod1j9u3bT8bVdg1Ui6mCo/MZ2GWtibPZgjRRT+IVB7wlDGVzbsYyZanxIzRKU6f9BCs KUJO0nW+flvObfWf+n6ApOQ0XFTXVRLRNyCqg6liJmFxpGj5SR2QLqHqoWYcG513bug== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M7FEtCIs; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71B2D606A31A; Wed, 2 Dec 2026 05:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M7FEtCIs Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E7E81F00896; Wed, 2 Dec 2026 05:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796188814; bh=jwnmW6DmW8OFSLKPnUppBS6skDJXw7uqKbIdoHyMWtU=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=M7FEtCIsiNyL734PNnQ2tMFt5PH1aY9Yexu7JA/x9LwAbl7nmPYjxmHf+O4xbL2c9 yNtbLluRkMmIqMYAmxUZKcFEqPK1DvJ4y9NvnOCR++kuFROFm7SKF2epscSNgMW4kE a4wpkv4eMqmclpDYEadnXsuXPsv/DeFfcjUsMmZf2sR2TWBPbNOxDUj8LFTEu++C2o oXKeP6vROee33D15itVjbBKLK+GkQOYVeiGekw/qXLG9xmSZqx52yvtqbADs3ECA12 P5zFs6Wn1Hw1iiCDllTyyOEPDkJMsjEe4hHR1mbu7dAsmf2WPZJufzQXPNtRoomv4n ubU5J9NHC/k2A== Message-ID: <29bdc9ed-8625-4717-90d4-f77d4b148a80@kernel.org> Date: Wed, 2 Dec 2026 05:20:09 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/5] phy: qcom-mipi-csi2: restructure D-PHY into core.c and dphy-regs.h To: Anusha Arun Nandi Cc: Vinod Koul , Neil Armstrong , Manivannan Sadhasivam , gjorgji.rosikopulos@oss.qualcomm.com, hariram.purushothaman@oss.qualcomm.com, akapatra@quicinc.com, jigarkumar.zala@oss.qualcomm.com, linux-phy@lists.infradead.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20261201210207.1049452-1-anusha.nandi@oss.qualcomm.com> <20261201210207.1049452-4-anusha.nandi@oss.qualcomm.com> From: Bryan O'Donoghue Content-Language: en-GB Autocrypt: addr=bod@kernel.org; keydata= xsFNBGRJNSgBEADD7Vm2ZFa+v+JGJ2QYTJqQAkqis/uOHkhdFNXqpBarVBd47QU/DMNU5Rxg jedMQEmHoeDbJ6UOpjbrUQ63c5sgG1JbroHJJctwsEI75OOlekMuebEbjIJBLfgENGwPBMHv piv5TgCWr0VgYaXfp2eh2LINFywzqj823HiDPibQAXDrjzvF1ogksi/6cQZs8d4if8YQkLOr YISFouG+eR0nN1I7mUfIddXOWu6lJeTyqbWVurv58k2ekIXKaOC9ixLHFbcfYV0hOgRaTwQC B8CYF9nfqZla19iItfsN9QxN+ZdQjcRoYipp6HPCMfJlKH7GfaFcW93LKc4DKJ2lVL+pg/OQ lythZbjRPY492NG9kZ65aYstCs90uhMUEVVPuGUw7wBEku+6IEwZfrbMVKeWzLlPyM4Hv9hM 8ktxSmxWsPTPqpBC8eyeAQLalMELAyVcZlkaCtEcbj7w4l/JkYz+4l37obG8ZD+B34udBUUz MsAJ8foDFrBh2MOFA3hxD6G90D23mmWsri7pnKA2tZs92aQX7Ee+FbCyg6g5ln62Sq83ZDbf 53DdBs55EVpBadeInWmXhzCHPQx06H+CwTEjShTYIaMmBfrewvYUDKvFTC5iKQhAEUgt6i94 JsbG7NoeqcxkUMcBOEUQ3uCQG1D70ugspgXc0wd3Rimiq6535wAR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jbouoK+/RAMsXkk8jba6rPfuuXPaDjCyyKn6zSVHETnHW 3AJbgVY50T8STpnxayBQvWbCvu+6NOEjXCbyaOJig+5l0zlGN9XHjdANXC5HnwmyaGRL9YDq Jh2nVXVJDincOdQRdKcJjYLqaOAoWrYWSDi1iZGspHBTDrnOvfMQzzHY In-Reply-To: <20261201210207.1049452-4-anusha.nandi@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 01/12/2026 21:02, Anusha Arun Nandi wrote: > Restructure phy-qcom-mipi-csi2-3ph-dphy.c: its functions > (csi2phy_dev_to_regs(), hw_version_read()/reset()/settle_cnt_calc()/ > gen2_config_lanes()/lanes_enable()/lanes_disable()) and the D-PHY > hw_ops table move into phy-qcom-mipi-csi2-core.c, while its register > data (lane_regs_x1e80100[] and the x1e80100 soc_cfg plus its clk/ > supply/genpd name arrays) moves into a new > phy-qcom-mipi-csi2-dphy-regs.h. There is no longer a separate > code-bearing D-PHY source file: core.c now holds every PHY-framework > and D-PHY register-programming function plus the hw_ops table that > binds them, and the new header holds nothing but const data, #included > at the top of core.c. The per-SoC soc_cfg reaches the hw_ops table > through an extern in the shared phy-qcom-mipi-csi2.h. > This keeps the maintainability and readability. > > The CSIPHY_3PH_CMN_* common-control register macros and the > CSIPHY_DEFAULT_PARAMS/_SETTLE_CNT_LOWER_BYTE/_SKEW_CAL param_type > values both move into that shared header too, since the new > dphy-regs.h's register tables need the param_type values and > core.c's register-write/read functions need the CTRL/STATUS offset > macros, the mipi_csi2_dphy_4nm_x1e extern drops out of the shared > header, since the soc_cfg object is now static and consumed only by > core.c. > > No functional change: register addresses, values, and param_type > tags are unchanged. I don't see much justification for this move. > Co-developed-by: Jigarkumar Zala > Signed-off-by: Jigarkumar Zala > Signed-off-by: Anusha Arun Nandi > --- > drivers/phy/qualcomm/Makefile | 3 +- > .../phy/qualcomm/phy-qcom-mipi-csi2-core.c | 232 ++++++++++++++++- > ...-dphy.c => phy-qcom-mipi-csi2-dphy-regs.h} | 238 +----------------- > drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 21 +- > 4 files changed, 249 insertions(+), 245 deletions(-) > rename drivers/phy/qualcomm/{phy-qcom-mipi-csi2-3ph-dphy.c => phy-qcom-mipi-csi2-dphy-regs.h} (56%) > > diff --git a/drivers/phy/qualcomm/Makefile b/drivers/phy/qualcomm/Makefile > index 4b5e6640a6fa..bae82e18c674 100644 > --- a/drivers/phy/qualcomm/Makefile > +++ b/drivers/phy/qualcomm/Makefile > @@ -7,8 +7,7 @@ obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA) += phy-qcom-ipq806x-sata.o > obj-$(CONFIG_PHY_QCOM_M31_USB) += phy-qcom-m31.o > obj-$(CONFIG_PHY_QCOM_M31_EUSB) += phy-qcom-m31-eusb2.o > > -phy-qcom-mipi-csi2-objs += phy-qcom-mipi-csi2-core.o \ > - phy-qcom-mipi-csi2-3ph-dphy.o > +phy-qcom-mipi-csi2-objs += phy-qcom-mipi-csi2-core.o > obj-$(CONFIG_PHY_QCOM_MIPI_CSI2) += phy-qcom-mipi-csi2.o > > obj-$(CONFIG_PHY_QCOM_PCIE2) += phy-qcom-pcie2.o > diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c > index 8bebc943a771..8a89ece01261 100644 > --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c > +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c > @@ -9,20 +9,233 @@ > #include > #include > #include > +#include > #include > #include > -#include > #include > #include > #include > #include > +#include > #include > -#include > #include > -#include > #include > +#include > > #include "phy-qcom-mipi-csi2.h" > +/* D-PHY register tables and per-SoC soc_cfg objects (pure data). */ > +#include "phy-qcom-mipi-csi2-dphy-regs.h" Data that was previously kept in a .c file now migrates to a .h file with one user.. > + > +#define CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(n) ((0x200 * (n)) + 0x24) > + > +/* > + * 3 phase CSI has 19 common status regs with only 0-10 being used > + * and 11-18 being reserved. > + */ > +#define CSI_COMMON_STATUS_NUM 11 > +/* > + * There are a number of common control registers > + * The offset to clear the CSIPHY IRQ status starts @ 22 > + * So to clear CSI_COMMON_STATUS0 this is CSI_COMMON_CONTROL22, STATUS1 is > + * CONTROL23 and so on > + */ > +#define CSI_CTRL_STATUS_INDEX 22 > + > +/* > + * There are 43 COMMON_CTRL registers with regs after # 33 being reserved > + */ > +#define CSI_CTRL_MAX 33 > + > +static inline const struct mipi_csi2phy_device_regs * > +csi2phy_dev_to_regs(struct mipi_csi2phy_device *csi2phy) > +{ > + return &csi2phy->soc_cfg->reg_info; > +} > + > +static void phy_qcom_mipi_csi2_hw_version_read(struct mipi_csi2phy_device *csi2phy) > +{ > + const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy); > + u32 tmp; > + > + writel(CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID, csi2phy->base + > + 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)); > + csi2phy->hw_version = tmp; > + > + tmp = readl_relaxed(csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset, 13)); > + csi2phy->hw_version |= (tmp << 8) & 0xFF00; > + > + tmp = readl_relaxed(csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset, 14)); > + csi2phy->hw_version |= (tmp << 16) & 0xFF0000; > + > + tmp = readl_relaxed(csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->common_regs_offset, 15)); > + csi2phy->hw_version |= (tmp << 24) & 0xFF000000; > + > + dev_dbg_once(csi2phy->dev, "CSIPHY 3PH HW Version = 0x%08x\n", csi2phy->hw_version); > +} > + > +/* > + * phy_qcom_mipi_csi2_reset - Perform software reset on CSIPHY module > + * @csi2phy: CSIPHY device > + */ > +static void phy_qcom_mipi_csi2_reset(struct mipi_csi2phy_device *csi2phy) > +{ > + const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy); > + > + writel(CSIPHY_3PH_CMN_CSI_COMMON_CTRL0_PHY_SW_RESET, > + csi2phy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 0)); > + usleep_range(5000, 8000); > + writel(0x0, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 0)); > +} > + > +static void > +phy_qcom_mipi_csi2_lanes_disable(struct mipi_csi2phy_device *csi2phy, > + struct mipi_csi2phy_stream_cfg *cfg) > +{ > + const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy); > + > + writel(0, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 5)); > + > + writel(0, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 6)); > +} > + > +/* > + * phy_qcom_mipi_csi2_settle_cnt_calc - Calculate settle count value > + * > + * Helper function to calculate settle count value. This is > + * based on the CSI2 T_hs_settle parameter which in turn > + * is calculated based on the CSI2 transmitter link frequency. > + * > + * Return settle count. > + */ > +static u8 phy_qcom_mipi_csi2_settle_cnt_calc(s64 link_freq, u32 timer_clk_rate) > +{ > + u32 t_hs_prepare_max_ps; > + u32 timer_period_ps; > + u32 t_hs_settle_ps; > + u8 settle_cnt; > + u32 ui_ps; > + > + ui_ps = div64_u64(PSEC_PER_SEC, link_freq); > + ui_ps /= 2; > + t_hs_prepare_max_ps = 85000 + 6 * ui_ps; > + t_hs_settle_ps = t_hs_prepare_max_ps; > + > + timer_period_ps = div_u64(PSEC_PER_SEC, timer_clk_rate); > + > + if ((t_hs_settle_ps / timer_period_ps) < 6) > + return 0; > + > + settle_cnt = t_hs_settle_ps / timer_period_ps - 6; > + > + return settle_cnt; > +} > + > +static void > +phy_qcom_mipi_csi2_gen2_config_lanes(struct mipi_csi2phy_device *csi2phy, > + u8 settle_cnt) > +{ > + const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy); > + const struct mipi_csi2phy_lane_regs *r = regs->init_seq; > + int i, array_size = regs->lane_array_size; > + u32 val; > + > + for (i = 0; i < array_size; i++, r++) { > + switch (r->param_type) { > + case CSIPHY_SETTLE_CNT_LOWER_BYTE: > + val = settle_cnt & 0xff; > + break; > + case CSIPHY_SKEW_CAL: > + /* TODO: support application of skew from dt flag */ > + continue; > + default: > + val = r->reg_data; > + break; > + } > + writel(val, csi2phy->base + r->reg_addr); > + if (r->delay_us) > + udelay(r->delay_us); > + } > +} > + > +static int phy_qcom_mipi_csi2_lanes_enable(struct mipi_csi2phy_device *csi2phy, > + struct mipi_csi2phy_stream_cfg *cfg) > +{ > + const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy); > + struct mipi_csi2phy_lanes_cfg *lane_cfg = &cfg->lane_cfg; > + u8 settle_cnt; > + u8 val; > + int i; > + > + if (cfg->link_freq <= 0) > + return -EINVAL; > + > + settle_cnt = phy_qcom_mipi_csi2_settle_cnt_calc(cfg->link_freq, csi2phy->timer_clk_rate); > + if (!settle_cnt) > + return -ENODEV; > + > + /* > + * CSI_COMMON_CTRL5 is a physical lane power-up bitmap: > + * - Bits [0,2,4,6] → D-PHY data lanes(LN0, LN2, LN4, LN6) > + * - Bits [1,3,5] → C-PHY trio lanes(LN1, LN3, LN5) > + * - Bit [7] → D-PHY clock lane(LNCK) dedicated clock enable > + */ > + val = BIT(lane_cfg->clk.pos); > + for (i = 0; i < cfg->num_data_lanes; i++) > + val |= BIT(lane_cfg->data[i].pos * 2); > + > + writel(val, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 5)); > + > + /* Lane configuration for polarity @ CSIPHY-base + CTRL9 */ > + for (i = 0; i < cfg->num_data_lanes; i++) { > + if (lane_cfg->data[i].pol) { > + u8 pos = lane_cfg->data[i].pos; > + > + writel(BIT(2), csi2phy->base + CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(pos * 2)); > + } > + } > + > + if (lane_cfg->clk.pol) > + writel(BIT(2), csi2phy->base + CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(lane_cfg->clk.pos)); > + > + val = CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B; > + writel(val, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 6)); > + > + val = 0x02; > + writel(val, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 7)); > + > + val = 0x00; > + writel(val, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 0)); > + > + phy_qcom_mipi_csi2_gen2_config_lanes(csi2phy, settle_cnt); > + > + /* IRQ_MASK registers - disable all interrupts */ > + for (i = CSI_COMMON_STATUS_NUM; i < CSI_CTRL_STATUS_INDEX; i++) { > + writel(0, csi2phy->base + > + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, i)); > + } > + > + return 0; > +} > + > +const struct mipi_csi2phy_hw_ops phy_qcom_mipi_csi2_ops_3ph_1_0 = { > + .hw_version_read = phy_qcom_mipi_csi2_hw_version_read, > + .reset = phy_qcom_mipi_csi2_reset, > + .lanes_enable = phy_qcom_mipi_csi2_lanes_enable, > + .lanes_disable = phy_qcom_mipi_csi2_lanes_disable, > +}; > > static int > phy_qcom_mipi_csi2_set_clock_rates(struct mipi_csi2phy_device *csi2phy, > @@ -239,11 +452,10 @@ static int phy_qcom_mipi_csi2_attach_pm_domains(struct mipi_csi2phy_device *csi2 > > /* Single power-domain devices are already attached by the bus core. */ > if (csi2phy->soc_cfg->num_genpds == 1) > - return dev_pm_domain_attach(csi2phy->dev, 0); > + return dev_pm_domain_attach(csi2phy->dev, false); ? Your patch said "no functional change" but then you're changing this. > > - pd_names = devm_kzalloc(csi2phy->dev, > - sizeof(char *) * csi2phy->soc_cfg->num_genpds, > - GFP_KERNEL); > + pd_names = devm_kcalloc(csi2phy->dev, csi2phy->soc_cfg->num_genpds, > + sizeof(*pd_names), GFP_KERNEL); And this. You're sliding several changes into something that says "no functional change" If your overall objective is to move the tables out, you don't need the churn here or the stealth changes to achieve it. Sorry this is a NAK from me, I don't get why you can't just add the tables beside where they are already defined for hamoa and glymur. --- bod