[PATCH v10 0/3] media: qcom: camss: Add camss TPG support for multiple targets

Wenmeng Liu posted 3 patches 2 weeks, 6 days ago
drivers/media/platform/qcom/camss/Makefile         |  12 +-
drivers/media/platform/qcom/camss/camss-csid-680.c |  14 +-
.../media/platform/qcom/camss/camss-csid-gen3.c    |  14 +-
drivers/media/platform/qcom/camss/camss-csid.c     |  45 +-
drivers/media/platform/qcom/camss/camss-csid.h     |   1 +
drivers/media/platform/qcom/camss/camss-csiphy.c   |   1 +
drivers/media/platform/qcom/camss/camss-csiphy.h   |   2 +
drivers/media/platform/qcom/camss/camss-tpg-gen1.c | 231 +++++++++
drivers/media/platform/qcom/camss/camss-tpg.c      | 519 +++++++++++++++++++++
drivers/media/platform/qcom/camss/camss-tpg.h      | 118 +++++
drivers/media/platform/qcom/camss/camss.c          | 172 ++++++-
drivers/media/platform/qcom/camss/camss.h          |   5 +
12 files changed, 1109 insertions(+), 25 deletions(-)
[PATCH v10 0/3] media: qcom: camss: Add camss TPG support for multiple targets
Posted by Wenmeng Liu 2 weeks, 6 days ago
This series adds driver changes to bring up the TPG interfaces
in LeMans, Monaco, Hamoa.

Have tested this on LeMans EVK board and qcs8300-ride board and Hamoa
EVK board with 'Test Pattern Generator' and sensor.
Unlike CSID TPG, this TPG can be seen as a combination of CSIPHY
and sensor.

Tested with following commands:
- media-ctl --reset
- media-ctl -V '"msm_tpg0":0[fmt:SRGGB10/4608x2592 field:none]'
- media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]'
- media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]'
- media-ctl -l '"msm_tpg0":1->"msm_csid0":0[1]'
- media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
- v4l2-ctl -d /dev/v4l-subdev1 -c test_pattern=9
- yavta -B capture-mplane -n 5 -f SRGGB10P -s 4608x2592 /dev/video2
  --capture=7

Changes in v10:
- Fix the code alignment issue.
- Link to v9: https://lore.kernel.org/r/20260313-camss_tpg-v9-0-b9095de6525b@oss.qualcomm.com

Changes in v9:
- Fix typo: rename TPG_GUP_ID to TPG_GRP_ID and CSIPHY_GUP_ID
  to CSIPHY_GRP_ID.
- Replace DATA_TYPE_RAW_*BIT with MIPI_CSI2_DT_RAW* in format table.
- Simplify camss-tpg.c: remove kernel-doc comments, TPG now has only
  one source pad.
- Rename CSI2_RX_CFG0_TPG_NUM_EN/SEL to CSI2_RX_CFG0_TPG_MUX_EN/SEL
  and use if-else with phy_num_sel as they are mutually exclusive.
- Add TPG mode validity check when tpg_linked is true.
- Refactor tpg_stream_on() to use MSM_TPG_ACTIVE_VC/DT constants.
- Make tpg_stream_off() reuse tpg_reset().
- Rename TPG_V2_* macros to TPG_V2_0_* for better readability.
- Add register section comments in camss-tpg-gen1.c to segregate
  global, VC-based and DT-based registers.
- Clean up resource tables: remove vc_cnt, camnoc_rt_axi clock and
  interrupt entries.
- Sort Makefile entries in alphabetical order.
- Link to v8: https://lore.kernel.org/r/20260113-camss_tpg-v8-0-fa2cb186a018@oss.qualcomm.com

Changes in v8:
- Fix error bit operation. -- Bryan
- Add tpg link check for tpg enable/disable in csid node stream on.
- Link to v7: https://lore.kernel.org/r/20251226-camss_tpg-v7-0-ccb536734805@oss.qualcomm.com

Changes in V7:
- Add TPG support for Hamoa
- Add differentiation of register bitfields based on hardware version number.
- Fix the null pointer issue when TPG clock is 0.
- Correct the clock dependency for TPG.
- Link to V6: https://lore.kernel.org/all/20251114-camss_tpg-v6-0-38d3d9fbe339@oss.qualcomm.com/

Changes in V6:
- Addressed comments from Bryan and Konrad.
- Add exception handling for the streamon format.
- Link to V5: https://lore.kernel.org/all/20251017-camss_tpg-v5-0-cafe3ad42163@oss.qualcomm.com/

Changes in V5:
- Modify the commit message and change the chip names to LeMans and Monaco.
- Add the header file to resolve the compilation error.
- Remove the definition where tpg_num is 0.
- Link to v4: https://lore.kernel.org/all/20250925-camss_tpg-v4-0-d2eb099902c8@oss.qualcomm.com/

Changes in V4:
- Rebase changes
- Use GENMASK to define bit fields and avoid using tabs. Use FIELD_PREP and FIELD_GET uniformly to access bit fields.
- Link to V3: https://lore.kernel.org/all/20250822-camss_tpg-v3-0-c7833a5f10d0@quicinc.com/

Changes in V3:
- Change the payload mode string
- Change the method for setting the TPG clock rate
- Remove the TPG IRQ
- Format correction
- Remove unused variables
- Merge functions and eliminate redundancy
- Modify the register write method
- Change TPG matching method to use grp_id
- Encapsulate magic numbers as macros
- Link to V2: https://lore.kernel.org/all/20250717-lemans_tpg-v2-0-a2538659349c@quicinc.com/

Changes in V2:
- rebase tpg changes based on new versions of sa8775p and qcs8300 camss patches
- Link to V1: https://lore.kernel.org/all/20250211-sa8775p_tpg-v1-0-3f76c5f8431f@quicinc.com/

---
Wenmeng Liu (3):
      media: qcom: camss: Add common TPG support
      media: qcom: camss: Add link support for TPG
      media: qcom: camss: tpg: Add TPG support for multiple targets

 drivers/media/platform/qcom/camss/Makefile         |  12 +-
 drivers/media/platform/qcom/camss/camss-csid-680.c |  14 +-
 .../media/platform/qcom/camss/camss-csid-gen3.c    |  14 +-
 drivers/media/platform/qcom/camss/camss-csid.c     |  45 +-
 drivers/media/platform/qcom/camss/camss-csid.h     |   1 +
 drivers/media/platform/qcom/camss/camss-csiphy.c   |   1 +
 drivers/media/platform/qcom/camss/camss-csiphy.h   |   2 +
 drivers/media/platform/qcom/camss/camss-tpg-gen1.c | 231 +++++++++
 drivers/media/platform/qcom/camss/camss-tpg.c      | 519 +++++++++++++++++++++
 drivers/media/platform/qcom/camss/camss-tpg.h      | 118 +++++
 drivers/media/platform/qcom/camss/camss.c          | 172 ++++++-
 drivers/media/platform/qcom/camss/camss.h          |   5 +
 12 files changed, 1109 insertions(+), 25 deletions(-)
---
base-commit: ec4c8f012802e4654892379f627ce7a1b95f8ba7
change-id: 20251226-camss_tpg-b23a398bb65a

Best regards,
-- 
Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>
Re: [PATCH v10 0/3] media: qcom: camss: Add camss TPG support for multiple targets
Posted by Bryan O'Donoghue 5 days, 13 hours ago
On 17/03/2026 10:05, Wenmeng Liu wrote:
> Tested with following commands:
> - media-ctl --reset
> - media-ctl -V '"msm_tpg0":0[fmt:SRGGB10/4608x2592 field:none]'
> - media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]'
> - media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]'
> - media-ctl -l '"msm_tpg0":1->"msm_csid0":0[1]'
> - media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
> - v4l2-ctl -d /dev/v4l-subdev1 -c test_pattern=9
> - yavta -B capture-mplane -n 5 -f SRGGB10P -s 4608x2592 /dev/video2
>    --capture=7

I get this on Hamoa.

media-ctl --reset

media-ctl -V '"msm_tpg0":0[fmt:SRGGB10/4608x2592 field:none]'
media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]'
media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]'
media-ctl -l '"msm_tpg0":1->"msm_csid0":0[1]'
Unable to parse link: Invalid argument (22)

Failing to connect the TPG to the CSID.

Please resolve.

---
bod
Re: [PATCH v10 0/3] media: qcom: camss: Add camss TPG support for multiple targets
Posted by Wenmeng Liu 5 days, 13 hours ago

On 4/1/2026 5:02 PM, Bryan O'Donoghue wrote:
> On 17/03/2026 10:05, Wenmeng Liu wrote:
>> Tested with following commands:
>> - media-ctl --reset
>> - media-ctl -V '"msm_tpg0":0[fmt:SRGGB10/4608x2592 field:none]'
>> - media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]'
>> - media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]'
>> - media-ctl -l '"msm_tpg0":1->"msm_csid0":0[1]'
>> - media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
>> - v4l2-ctl -d /dev/v4l-subdev1 -c test_pattern=9
>> - yavta -B capture-mplane -n 5 -f SRGGB10P -s 4608x2592 /dev/video2
>>    --capture=7
> 
> I get this on Hamoa.
> 
> media-ctl --reset
> 
> media-ctl -V '"msm_tpg0":0[fmt:SRGGB10/4608x2592 field:none]'
> media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]'
> media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]'
> media-ctl -l '"msm_tpg0":1->"msm_csid0":0[1]'
> Unable to parse link: Invalid argument (22)
> 
> Failing to connect the TPG to the CSID.
> 
> Please resolve.
> 
> ---
> bod

Hi Bryan,

This is a typo,msm_tpg only have 0 pad.

please try media-ctl -l '"msm_tpg0":0->"msm_csid0":0[1]'


Thanks,
Wenmeng