Re: [PATCH v2 2/4] media: qcom: camss: Add support for MSM8939

2025-05-26 Thread Vincent Knecht
Le lundi 26 mai 2025 à 09:20 +0100, Bryan O'Donoghue a écrit :
> On 25/05/2025 20:25, Vincent Knecht via B4 Relay wrote:
> > From: Vincent Knecht 
> > 
> > The camera subsystem for the MSM8939 is the same as MSM8916 except with
> > 3 CSID instead of 2, and some higher clock rates.
> > 
> > As a quirk, this SoC needs writing values to 2 VFE VBIF registers
> > (see downstream msm8939-camera.dtsi vbif-{regs,settings} properties).
> > This fixes black stripes across sensor and garbage in CSID TPG outputs.
> > 
> > Add support for the MSM8939 camera subsystem.
> > 
> > Signed-off-by: Vincent Knecht 
> > ---
> >   drivers/media/platform/qcom/camss/camss-csiphy.c   |   1 +
> >   drivers/media/platform/qcom/camss/camss-ispif.c    |   8 +-
> >   drivers/media/platform/qcom/camss/camss-vfe-vbif.c |   7 +
> >   drivers/media/platform/qcom/camss/camss-vfe.c  |   1 +
> >   drivers/media/platform/qcom/camss/camss.c  | 157 
> > +
> >   drivers/media/platform/qcom/camss/camss.h  |   1 +
> >   6 files changed, 173 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c 
> > b/drivers/media/platform/qcom/camss/camss-csiphy.c
> > index 
> > c622efcc92ff3781d7fc3ace0253c2d64c91e847..6311fc2975aa1345e430a477c8a6476f1d7e5663
> >  100644
> > --- a/drivers/media/platform/qcom/camss/camss-csiphy.c
> > +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
> > @@ -605,6 +605,7 @@ int msm_csiphy_subdev_init(struct camss *camss,
> >     return PTR_ERR(csiphy->base);
> >   
> >     if (camss->res->version == CAMSS_8x16 ||
> > +       camss->res->version == CAMSS_8x39 ||
> >         camss->res->version == CAMSS_8x53 ||
> >         camss->res->version == CAMSS_8x96) {
> >     csiphy->base_clk_mux =
> > diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c 
> > b/drivers/media/platform/qcom/camss/camss-ispif.c
> > index 
> > 2dc585c6123dd248a5bacd9c7a88cb5375644311..aaf3caa42d33dcb641651e7f5bc0c2a564d85bfa
> >  100644
> > --- a/drivers/media/platform/qcom/camss/camss-ispif.c
> > +++ b/drivers/media/platform/qcom/camss/camss-ispif.c
> > @@ -1112,6 +1112,8 @@ int msm_ispif_subdev_init(struct camss *camss,
> >     /* Number of ISPIF lines - same as number of CSID hardware modules */
> >     if (camss->res->version == CAMSS_8x16)
> >     ispif->line_num = 2;
> > +   else if (camss->res->version == CAMSS_8x39)
> > +   ispif->line_num = 3;
> 
> > +   .interrupt = { "vfe0" },
> > +   .vfe = {
> > +   .line_num = 3,
> 
> Hmm should we really be setting line_num inline in the code ?
> 
> I don't believe we should.
> 
> These parameters should be passed from the resources structures.
> 
> ---
> bod

I've just followed suit, no strong opinion about it.
Can we agree this could be changed in another series ?





Re: [PATCH v2 2/4] media: qcom: camss: Add support for MSM8939

2025-05-26 Thread Bryan O'Donoghue

On 25/05/2025 20:25, Vincent Knecht via B4 Relay wrote:

From: Vincent Knecht 

The camera subsystem for the MSM8939 is the same as MSM8916 except with
3 CSID instead of 2, and some higher clock rates.

As a quirk, this SoC needs writing values to 2 VFE VBIF registers
(see downstream msm8939-camera.dtsi vbif-{regs,settings} properties).
This fixes black stripes across sensor and garbage in CSID TPG outputs.

Add support for the MSM8939 camera subsystem.

Signed-off-by: Vincent Knecht 
---
  drivers/media/platform/qcom/camss/camss-csiphy.c   |   1 +
  drivers/media/platform/qcom/camss/camss-ispif.c|   8 +-
  drivers/media/platform/qcom/camss/camss-vfe-vbif.c |   7 +
  drivers/media/platform/qcom/camss/camss-vfe.c  |   1 +
  drivers/media/platform/qcom/camss/camss.c  | 157 +
  drivers/media/platform/qcom/camss/camss.h  |   1 +
  6 files changed, 173 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c 
b/drivers/media/platform/qcom/camss/camss-csiphy.c
index 
c622efcc92ff3781d7fc3ace0253c2d64c91e847..6311fc2975aa1345e430a477c8a6476f1d7e5663
 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
@@ -605,6 +605,7 @@ int msm_csiphy_subdev_init(struct camss *camss,
return PTR_ERR(csiphy->base);
  
  	if (camss->res->version == CAMSS_8x16 ||

+   camss->res->version == CAMSS_8x39 ||
camss->res->version == CAMSS_8x53 ||
camss->res->version == CAMSS_8x96) {
csiphy->base_clk_mux =
diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c 
b/drivers/media/platform/qcom/camss/camss-ispif.c
index 
2dc585c6123dd248a5bacd9c7a88cb5375644311..aaf3caa42d33dcb641651e7f5bc0c2a564d85bfa
 100644
--- a/drivers/media/platform/qcom/camss/camss-ispif.c
+++ b/drivers/media/platform/qcom/camss/camss-ispif.c
@@ -1112,6 +1112,8 @@ int msm_ispif_subdev_init(struct camss *camss,
/* Number of ISPIF lines - same as number of CSID hardware modules */
if (camss->res->version == CAMSS_8x16)
ispif->line_num = 2;
+   else if (camss->res->version == CAMSS_8x39)
+   ispif->line_num = 3;



+   .interrupt = { "vfe0" },
+   .vfe = {
+   .line_num = 3,


Hmm should we really be setting line_num inline in the code ?

I don't believe we should.

These parameters should be passed from the resources structures.

---
bod