[PATCH v1 00/14] media: qcom: camss: Add parameter passing to remove several outstanding bugs

From: Bryan O'Donoghue
Date: Mon Aug 14 2023 - 12:30:11 EST


V1:
- I forgot to include patch # 14 in V0 of this series.
This patch leverages previous changes to unwind the fixed polling of
RDI[0..2] allowing driver data to articulate on a per-VFE basis how many
RDIs to poll.

Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/tree/linux-next-23-08-07-db410c-rb3-camss-dts-v3+maintenance-bugfixes-v1

V0:
This second series of bugfixes stacks ontop of the Fixes series sent earlier.

Link: https://lore.kernel.org/linux-arm-msm/20230814141007.3721197-1-bryan.odonoghue@xxxxxxxxxx/T/#t

Rather than send both series as one giant series, I opted to send a pure
Fixes series above, with this second series a non-backport series i.e. no
Fixes tags in this series.

The existing CAMSS code relies on some hard-coded parameters buried inside
of the driver, instead of passed via compat .data as arguably ought to be
the case.

This brittle model is an extending morass of spaghetti code. More than that
in CAMSS Video Front Ends (VFEs) and the number of Raw Data Interfaces
(RDIs) per VFE can vary from SoC to SoC. Indeed sm8250 has VFE and VFE Lite
blocks which have a different number of RDIs per block.

The use of defines as opposed to per-compat parameters inside of ISRs leads
to either under-polling or over-polling the number of RDIs.

On top of all of that we have some hard-coded statements for clock names
which breaks easily.

We can solve the under/over polling loop problem by transitioning loop
controls from macros to parameters passed via probe().

Similarly and unsurprisingly we can also solve the hard-coded clock problem
by adding some string processing routines that take passed arguments.

There is still some additional maintenance work to be done in this driver
but before adding one more SoC the code needs to be made more extensible
and less brittle.

Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/commits/dc346c7f46c0680bcfb84fded6db97497fffe49a

Bryan O'Donoghue (14):
media: qcom: camss: Amalgamate struct resource with struct
resource_ispif
media: qcom: camss: Start to move to module compat matched resources
media: qcom: camss: Drop useless NULL assignment for ispif resources
media: qcom: camss: Pass icc bandwidth table as a platform parameter
media: qcom: camss: Pass remainder of variables as resources
media: qcom: camss: Pass line_num from compat resources
media: qcom: camss: Assign the correct number of RDIs per VFE
media: qcom: camss: Use >= CAMSS_SDM845 for vfe_get/vfe_put
media: qcom: camss: Untangle if/else spaghetti in camss
media: qcom: camss: Improve error printout on icc_get fail
media: qcom: camss: Allow clocks vfeN vfe_liteN or vfe_lite
media: qcom: camss: Functionally decompose CSIPHY clock lookups
media: qcom: camss: Add support for setting CSIPHY clock name csiphyX
media: qcom: camss: Support RDI3 for VFE 17x

.../media/platform/qcom/camss/camss-csid.c | 24 +-
.../qcom/camss/camss-csiphy-3ph-1-0.c | 8 +-
.../media/platform/qcom/camss/camss-csiphy.c | 67 ++--
.../media/platform/qcom/camss/camss-ispif.c | 32 +-
.../media/platform/qcom/camss/camss-ispif.h | 4 +-
.../media/platform/qcom/camss/camss-vfe-170.c | 17 +-
.../media/platform/qcom/camss/camss-vfe-4-1.c | 2 -
.../media/platform/qcom/camss/camss-vfe-4-7.c | 2 -
.../media/platform/qcom/camss/camss-vfe-4-8.c | 2 -
.../media/platform/qcom/camss/camss-vfe-480.c | 5 +-
drivers/media/platform/qcom/camss/camss-vfe.c | 78 +++--
.../media/platform/qcom/camss/camss-video.c | 16 +-
drivers/media/platform/qcom/camss/camss.c | 292 +++++++++---------
drivers/media/platform/qcom/camss/camss.h | 31 +-
14 files changed, 321 insertions(+), 259 deletions(-)

--
2.41.0