media: qcom: camss: Functionally decompose CSIPHY clock lookups
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Mon, 25 Sep 2023 15:47:02 +0000 (16:47 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 7 Oct 2023 08:55:44 +0000 (10:55 +0200)
commit0727615fb975f69c23a9e71cd0a982be67bfe159
tree7046936a78d0d53ae751978df231bf72b59258b0
parentbcd2adfef23aee34d74e0b0a299e3268182cf27f
media: qcom: camss: Functionally decompose CSIPHY clock lookups

The csiphyX_timer and csiX_phy values need not be hard-coded. We can
functionally decompose the string matching inside of a loop.

Static string values are brittle, difficult to extend and not required
anyway since the camss->res->csiphy_num value informs us of the number
of CSIPHYs and hence the set of potential clocks for a given CSIPHY.

In simple terms if we have five CSIPHYs we can have no more and no less
than five csiphy_timer clocks. Similarly csi_phy core clocks have a 1:1
relationship with the PHY they clock.

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-csiphy.c