lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a49b6b55-0482-4287-8001-e6e87381227f@linaro.org>
Date: Mon, 28 Jul 2025 16:28:42 +0100
From: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
To: Wenmeng Liu <quic_wenmliu@...cinc.com>, Robert Foss <rfoss@...nel.org>,
 Todor Tomov <todor.too@...il.com>, Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] media: qcom: camss: tpg: Add tpg support for qcs8300

On 17/07/2025 05:18, Wenmeng Liu wrote:
> Add support for TPG found on QCS8300.
> 
> Signed-off-by: Wenmeng Liu <quic_wenmliu@...cinc.com>
> ---
> QCS8300 is a Qualcomm SoC. This series adds driver changes to
> bring up TPG in QCS8300.
> 
> Tested with following commands:
> - media-ctl --reset
> - v4l2-ctl -d /dev/v4l-subdev0 -c test_pattern=0
> - 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-subdev3 -c test_pattern=9
> - yavta -B capture-mplane -n 5 -f SRGGB10P -s 4608x2592 /dev/video0
>    --capture=7
> 
> Dependencies:
> 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/20250217-qcs8300_tpg-v1-1-6e0f4dd3ad1f@quicinc.com/
> ---
>   drivers/media/platform/qcom/camss/camss.c | 52 ++++++++++++++++++++++++++++++-
>   1 file changed, 51 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index ced31e3655a52a7b2e55b109085cf24a9e230f1d..68411e4a5c55b394145ba907f18cb03e235dcc23 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -2548,6 +2548,53 @@ static const struct camss_subdev_resources csiphy_res_8300[] = {
>   	},
>   };
>   
> +static const struct camss_subdev_resources tpg_res_8300[] = {
> +	/* TPG0 */
> +	{
> +		.regulators = {  },

you can drop the explicit empty set.

> +		.clock = { "csiphy_rx" },
> +		.clock_rate = { { 400000000 } },
> +		.reg = { "tpg0" },
> +		.interrupt = { "tpg0" },
> +		.tpg = {
> +			.lane_cnt = 4,
> +			.vc_cnt = 1,
> +			.formats = &tpg_formats_gen1,
> +			.hw_ops = &tpg_ops_gen1
> +		}
> +	},
> +
> +	/* TPG1 */
> +	{
> +		.regulators = {  },
> +		.clock = { "csiphy_rx" },
> +		.clock_rate = { { 400000000 } },
> +		.reg = { "tpg1" },
> +		.interrupt = { "tpg1" },
> +		.tpg = {
> +			.lane_cnt = 4,
> +			.vc_cnt = 1,
> +			.formats = &tpg_formats_gen1,
> +			.hw_ops = &tpg_ops_gen1
> +		}
> +	},
> +
> +	/* TPG2 */
> +	{
> +		.regulators = {  },
> +		.clock = { "csiphy_rx" },
> +		.clock_rate = { { 400000000 } },
> +		.reg = { "tpg2" },
> +		.interrupt = { "tpg2" },

Does the TPG interrupt do something ? AFIAK it does not.

Drop dead array entries and unused ISRs.

> +		.tpg = {
> +			.lane_cnt = 4,
> +			.vc_cnt = 1,
> +			.formats = &tpg_formats_gen1,
> +			.hw_ops = &tpg_ops_gen1
> +		}
> +	},
> +};

> +
>   static const struct camss_subdev_resources csid_res_8300[] = {
>   	/* CSID0 */
>   	{
> @@ -4492,7 +4539,8 @@ static int camss_probe(struct platform_device *pdev)
>   	if (!camss->csiphy)
>   		return -ENOMEM;
>   
> -	if (camss->res->version == CAMSS_8775P) {
> +	if (camss->res->version == CAMSS_8775P ||
> +	    camss->res->version == CAMSS_8300) {
>   		camss->tpg = devm_kcalloc(dev, camss->res->tpg_num,

You already know the number of tpgs so there's no sense in pivoting on 
version number.

if (res->tpg_num) {
	devm_kzalloc()
}

>   					  sizeof(*camss->tpg), GFP_KERNEL);
>   		if (!camss->tpg)
> @@ -4677,11 +4725,13 @@ static const struct camss_resources qcs8300_resources = {
>   	.version = CAMSS_8300,
>   	.pd_name = "top",
>   	.csiphy_res = csiphy_res_8300,
> +	.tpg_res = tpg_res_8300,
>   	.csid_res = csid_res_8300,
>   	.csid_wrapper_res = &csid_wrapper_res_qcs8300,
>   	.vfe_res = vfe_res_8300,
>   	.icc_res = icc_res_qcs8300,
>   	.csiphy_num = ARRAY_SIZE(csiphy_res_8300),
> +	.tpg_num = ARRAY_SIZE(tpg_res_8300),
>   	.csid_num = ARRAY_SIZE(csid_res_8300),
>   	.vfe_num = ARRAY_SIZE(vfe_res_8300),
>   	.icc_path_num = ARRAY_SIZE(icc_res_qcs8300),
> 
> ---
> base-commit: dc3d6ecbfebec02791feea0b08062540badcb5a2
> change-id: 20250717-qcs8300_tpg-f7735e998310
> 
> Best regards,
---
bod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ