media: qcom: camss: Allow clocks vfeN vfe_liteN or vfe_lite
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Mon, 25 Sep 2023 15:47:01 +0000 (16:47 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 7 Oct 2023 08:55:44 +0000 (10:55 +0200)
commitbcd2adfef23aee34d74e0b0a299e3268182cf27f
tree1897dfcd89748fd44b3641ff6784c9d2e52c2ca9
parent2de3a6546aeee6807b4315107a0131081fd0205e
media: qcom: camss: Allow clocks vfeN vfe_liteN or vfe_lite

The number of Video Front End - VFE or Image Front End - IFE supported
with new SoCs can vary both for the full and lite cases.

For example sdm845 has one vfe_lite and two vfe interfaces with the vfe
clock called simply "vfe_lite" with no integer postfix. sc8280xp has four
vfe and four vfe lite blocks.

At the moment we declare vfe_lite0 and vfe_lite1 for sm8250 but never set
those clocks because we don't match the strings.

We need to support the following clock name formats

- vfeN
- vfe_liteN
- vfe_lite

with N being any reasonably sized integer.

There are two sites in this code which need to do the same thing,
constructing and matching strings with the pattern above, so encapsulate
the logic in one function.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/qcom/camss/camss-vfe.c