From: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
To: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>,
Bryan O'Donoghue <bod@kernel.org>, Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Manivannan Sadhasivam <mani@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>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Abel Vesa <abelvesa@kernel.org>
Cc: linux-phy@lists.infradead.org, linux-media@vger.kernel.org,
linux-arm-msm@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 v23 11/15] media: qcom: camss: tpg: Add support for v2.4.0 TPG
Date: Sat, 31 Oct 2026 13:38:01 +0200 [thread overview]
Message-ID: <7c7cd421-81de-4c5f-9e37-0bb3b7bc5974@linaro.org> (raw)
In-Reply-To: <20261028-kaanapali-camss-v23-11-95f250b18612@oss.qualcomm.com>
On 10/28/26 17:20, Hangxiang Ma wrote:
> Add support for the TPG found on Kaanapali. This TPG uses hardware
> version 2.4.0, which drives test-enable and reset through the
> TPG_CTRL_CMD register at offset 0x1f4 instead of the TEST_EN bit in
> TPG_CTRL and the TPG_CLEAR register. Its output is routed into the
> CSID 1080 RX through the CSI2 TPG mux, so the CSID selects the TPG as
> the data source when a test pattern is selected.
>
> Add the TPG resources to the Kaanapali camss resources so that the TPG
> subdevices are created on this SoC.
>
> Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
> ---
> .../media/platform/qcom/camss/camss-csid-1080.c | 15 ++++++++++++--
> drivers/media/platform/qcom/camss/camss-tpg-gen1.c | 23 ++++++++++++++++------
> drivers/media/platform/qcom/camss/camss.c | 2 ++
> 3 files changed, 32 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csid-1080.c b/drivers/media/platform/qcom/camss/camss-csid-1080.c
> index 3d90d31201fa..ec56ba85a0fa 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid-1080.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid-1080.c
> @@ -64,6 +64,8 @@
> #define CSI2_RX_CFG0_NUM_ACTIVE_LANES 0
> #define CSI2_RX_CFG0_DL0_INPUT_SEL 4
> #define CSI2_RX_CFG0_PHY_NUM_SEL 20
> +#define CSI2_RX_CFG0_TPG_MUX_EN BIT(27)
> +#define CSI2_RX_CFG0_TPG_MUX_SEL GENMASK(29, 28)
> #define CSI2_RX_CFG0_PHY_SEL_BASE_IDX 1
> #define CSID_CSI2_RX_CFG1 0x884
> #define CSI2_RX_CFG1_ECC_CORRECTION_EN BIT(0)
> @@ -148,6 +150,7 @@ static void __csid_reg_update_clear(struct csid_device *csid, int port_id)
> static void __csid_configure_rx(struct csid_device *csid,
> struct csid_phy_config *phy)
> {
> + struct camss *camss = csid->camss;
> u8 lane_cnt = phy->lane_cnt;
> int val;
>
> @@ -156,8 +159,16 @@ static void __csid_configure_rx(struct csid_device *csid,
>
> val = (lane_cnt - 1) << CSI2_RX_CFG0_NUM_ACTIVE_LANES;
> val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;
> - val |= (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX)
> - << CSI2_RX_CFG0_PHY_NUM_SEL;
> +
> + if (camss->tpg && csid->tpg_linked &&
> + camss->tpg[phy->csiphy_id].testgen.mode != TPG_PAYLOAD_MODE_DISABLED) {
> + val |= FIELD_PREP(CSI2_RX_CFG0_TPG_MUX_SEL, phy->csiphy_id + 1);
> + val |= CSI2_RX_CFG0_TPG_MUX_EN;
> + } else {
> + val |= (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX)
> + << CSI2_RX_CFG0_PHY_NUM_SEL;
> + }
> +
> writel(val, csid->base + CSID_CSI2_RX_CFG0);
>
> val = CSI2_RX_CFG1_ECC_CORRECTION_EN;
> diff --git a/drivers/media/platform/qcom/camss/camss-tpg-gen1.c b/drivers/media/platform/qcom/camss/camss-tpg-gen1.c
> index d29de5f93c18..cabbb2638cf3 100644
> --- a/drivers/media/platform/qcom/camss/camss-tpg-gen1.c
> +++ b/drivers/media/platform/qcom/camss/camss-tpg-gen1.c
> @@ -22,6 +22,7 @@
>
> #define TPG_HW_VER_2_0_0 TPG_HW_VER(2, 0, 0)
> #define TPG_HW_VER_2_1_0 TPG_HW_VER(2, 1, 0)
> +#define TPG_HW_VER_2_4_0 TPG_HW_VER(2, 4, 0)
>
> #define TPG_HW_STATUS 0x4
>
> @@ -33,7 +34,9 @@
> # define TPG_CTRL_OVERLAP_SHDR_EN BIT(10)
> # define TPG_CTRL_NUM_ACTIVE_VC GENMASK(31, 30)
>
> -#define TPG_CLEAR 0x1F4
> +#define TPG_CTRL_CMD 0x1F4
> +# define TPG_CTRL_CMD_TEST_EN BIT(4)
> +# define TPG_CTRL_CMD_HW_RESET BIT(0)
>
> /* TPG VC-based registers */
> #define TPG_VC_n_GAIN_CFG(n) (0x60 + (n) * 0x60)
> @@ -164,18 +167,26 @@ static int tpg_stream_on(struct tpg_device *tpg)
> }
>
> /* Global TPG control */
> - val = FIELD_PREP(TPG_CTRL_TEST_EN, 1) |
> - FIELD_PREP(TPG_CTRL_NUM_ACTIVE_LANES, lane_cnt - 1) |
> + val = FIELD_PREP(TPG_CTRL_NUM_ACTIVE_LANES, lane_cnt - 1) |
> FIELD_PREP(TPG_CTRL_NUM_ACTIVE_VC, last_vc);
> - writel(val, tpg->base + TPG_CTRL);
> +
> + if (tpg->hw_version < TPG_HW_VER_2_4_0) {
> + val |= FIELD_PREP(TPG_CTRL_TEST_EN, 1);
> + writel(val, tpg->base + TPG_CTRL);
> + } else {
> + writel(val, tpg->base + TPG_CTRL);
> + writel(TPG_CTRL_CMD_TEST_EN, tpg->base + TPG_CTRL_CMD);
> + }
>
> return 0;
> }
>
> static int tpg_reset(struct tpg_device *tpg)
> {
> - writel(0, tpg->base + TPG_CTRL);
> - writel(1, tpg->base + TPG_CLEAR);
> + if (tpg->hw_version < TPG_HW_VER_2_4_0)
> + writel(0, tpg->base + TPG_CTRL);
> +
> + writel(TPG_CTRL_CMD_HW_RESET, tpg->base + TPG_CTRL_CMD);
>
> return 0;
> }
It is necessary to split this change into two for the next run:
1) the generic TPG subdevice change to support a new hardware interface, equal to
https://lore.kernel.org/linux-arm-msm/20261031112203.545319-4-vladimir.zapolskiy@linaro.org/
this new interface is for a range of hardware including SM8650 and SM8750,
2) the rest of Kaanapali specific changes from below this comment.
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 6ff82dd2aeaf..df4b4cf30711 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -5850,11 +5850,13 @@ static const struct camss_resources kaanapali_resources = {
> .pd_name = "top",
> .pm_clks = { "cpas_fast_ahb", "cpas_ahb", "gcc_axi_hf" },
> .csiphy_res = csiphy_res_kaanapali,
> + .tpg_res = tpg_res_x1e80100,
It is closer to 'tpg_res_8775p', at least the proper name for I/O regions
is expected to be "tpgX" rather than "csitpgX".
> .csid_res = csid_res_kaanapali,
> .vfe_res = vfe_res_kaanapali,
> .icc_res = icc_res_kaanapali,
> .icc_path_num = ARRAY_SIZE(icc_res_kaanapali),
> .csiphy_num = ARRAY_SIZE(csiphy_res_kaanapali),
> + .tpg_num = ARRAY_SIZE(tpg_res_x1e80100),
> .csid_num = ARRAY_SIZE(csid_res_kaanapali),
> .vfe_num = ARRAY_SIZE(vfe_res_kaanapali),
> };
>
--
Best wishes,
Vladimir
next prev parent reply other threads:[~2026-10-31 11:38 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 15:20 [PATCH v23 00/15] media: qcom: camss: Add Kaanapali support Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 01/15] dt-bindings: phy: qcom,x1e80100-csi2-phy: Add Kaanapali CSI2 PHY Hangxiang Ma
2026-10-31 11:42 ` Vladimir Zapolskiy
2026-10-28 15:20 ` [PATCH v23 02/15] phy: qcom-mipi-csi2: Parametrise the common status register offset Hangxiang Ma
2026-10-28 15:27 ` Abel Vesa
2026-10-28 15:20 ` [PATCH v23 03/15] phy: qcom-mipi-csi2: Add Kaanapali support Hangxiang Ma
2026-10-28 15:26 ` Abel Vesa
2026-10-28 15:20 ` [PATCH v23 04/15] media: qcom: camss: Add addr_update hooks and guard CSID reg_update Hangxiang Ma
2026-10-28 15:29 ` Bryan O'Donoghue
2026-10-28 16:36 ` Loic Poulain
2026-10-28 15:20 ` [PATCH v23 05/15] media: dt-bindings: Add CAMSS device for Kaanapali Hangxiang Ma
2026-10-31 11:52 ` Vladimir Zapolskiy
2026-10-28 15:20 ` [PATCH v23 06/15] media: qcom: camss: Add Kaanapali compatible Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 07/15] media: qcom: camss: Add PM clock definitions for Kaanapali Hangxiang Ma
2026-10-28 15:31 ` Bryan O'Donoghue
2026-10-28 15:20 ` [PATCH v23 08/15] media: qcom: camss: csiphy: Add support for v2.4.0 two-phase CSIPHY Hangxiang Ma
2026-10-30 17:01 ` Vladimir Zapolskiy
2026-10-28 15:20 ` [PATCH v23 09/15] media: qcom: camss: csid: Add support for CSID 1080 Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 10/15] media: qcom: camss: vfe: Add support for VFE 1080 Hangxiang Ma
2026-10-28 15:33 ` Bryan O'Donoghue
2026-10-30 16:55 ` Nihal Kumar Gupta
2026-10-28 15:20 ` [PATCH v23 11/15] media: qcom: camss: tpg: Add support for v2.4.0 TPG Hangxiang Ma
2026-10-28 15:36 ` Bryan O'Donoghue
2026-10-31 11:38 ` Vladimir Zapolskiy [this message]
2026-10-28 15:20 ` [PATCH v23 12/15] arm64: dts: qcom: kaanapali: Add CAMSS and CSIPHY block definitions Hangxiang Ma
2026-10-28 15:28 ` Abel Vesa
2026-10-31 11:46 ` Vladimir Zapolskiy
2026-10-28 15:20 ` [PATCH v23 13/15] arm64: dts: qcom: kaanapali: Add CCI controller nodes Hangxiang Ma
2026-10-28 15:28 ` Abel Vesa
2026-10-28 15:20 ` [PATCH v23 14/15] arm64: dts: qcom: kaanapali: Add camera MCLK pinctrl Hangxiang Ma
2026-10-28 15:20 ` [PATCH v23 15/15] arm64: dts: qcom: kaanapali-mtp-camera-s5kjn5: Add DT overlay Hangxiang Ma
2026-10-28 15:29 ` Abel Vesa
2026-10-30 16:42 ` Nihal Kumar Gupta
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=7c7cd421-81de-4c5f-9e37-0bb3b7bc5974@linaro.org \
--to=vladimir.zapolskiy@linaro.org \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hangxiang.ma@oss.qualcomm.com \
--cc=jeyaprakash.soundrapandian@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--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=linux-phy@lists.infradead.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mani@kernel.org \
--cc=mchehab@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=vijay.tumati@oss.qualcomm.com \
--cc=vkoul@kernel.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®