Re: [PATCH v5 1/3] media: qcom: camss: Add common TPG support
From: Konrad Dybcio
Date: Mon Oct 20 2025 - 08:53:18 EST
On 10/17/25 7:06 AM, Wenmeng Liu wrote:
> Introduce a new common Test Pattern Generator (TPG) implementation for
> Qualcomm CAMSS. This module provides a generic interface for pattern
> generation that can be reused by multiple platforms.
>
> Unlike CSID-integrated TPG, this TPG acts as a standalone block
> that emulates both CSIPHY and sensor behavior, enabling flexible test
> patterns without external hardware.
>
> Signed-off-by: Wenmeng Liu <wenmeng.liu@xxxxxxxxxxxxxxxx>
> ---
[...]
> +const struct tpg_format_info *tpg_get_fmt_entry(struct tpg_device *tpg,
> + const struct tpg_format_info *formats,
> + unsigned int nformats,
> + u32 code)
> +{
> + struct device *dev = tpg->camss->dev;
> + size_t i;
> +
> + for (i = 0; i < nformats; i++)
> + if (code == formats[i].code)
> + return &formats[i];
> +
> + dev_warn_once(dev, "Unknown format\n");
It would probably be useful to denote which format is invalid (i.e.
print its code or so), and _once doesn't seem like a right choice,
because the user may choose 2 different invalid formats and only
the first one would cause a descriptive warning
Konrad