rcar-csi2: add R8A77980 support
diff mbox series

Message ID f6edfd44-7b08-e467-3486-795251816187@cogentembedded.com
State Not Applicable
Headers show
Series
  • rcar-csi2: add R8A77980 support
Related show

Commit Message

Sergei Shtylyov Aug. 6, 2018, 4:56 p.m. UTC
Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against the 'media_tree.git' repo's 'master' branch.

 Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt |    1 
 drivers/media/platform/rcar-vin/rcar-csi2.c                   |   11 ++++++++++
 2 files changed, 12 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Niklas Söderlund Aug. 6, 2018, 6:02 p.m. UTC | #1
Hi Sergei,,

Thanks for your patch.

On 2018-08-06 19:56:27 +0300, Sergei Shtylyov wrote:
> Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

It looks good but before I add my tag I would like to know if you tested 
this on a V3H? In the past extending the R-Car CSI-2 receiver to a new 
SoC always caught some new corner case :-)

I don't have access to a V3H myself otherwise I would of course test it 
myself.

> 
> ---
> This patch is against the 'media_tree.git' repo's 'master' branch.
> 
>  Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt |    1 
>  drivers/media/platform/rcar-vin/rcar-csi2.c                   |   11 ++++++++++
>  2 files changed, 12 insertions(+)
> 
> Index: media_tree/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
> ===================================================================
> --- media_tree.orig/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
> +++ media_tree/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
> @@ -12,6 +12,7 @@ Mandatory properties
>     - "renesas,r8a7796-csi2" for the R8A7796 device.
>     - "renesas,r8a77965-csi2" for the R8A77965 device.
>     - "renesas,r8a77970-csi2" for the R8A77970 device.
> +   - "renesas,r8a77980-csi2" for the R8A77980 device.
>  
>   - reg: the register base and size for the device registers
>   - interrupts: the interrupt for the device
> Index: media_tree/drivers/media/platform/rcar-vin/rcar-csi2.c
> ===================================================================
> --- media_tree.orig/drivers/media/platform/rcar-vin/rcar-csi2.c
> +++ media_tree/drivers/media/platform/rcar-vin/rcar-csi2.c
> @@ -959,6 +959,13 @@ static const struct rcar_csi2_info rcar_
>  	.confirm_start = rcsi2_confirm_start_v3m_e3,
>  };
>  
> +static const struct rcar_csi2_info rcar_csi2_info_r8a77980 = {
> +	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
> +	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
> +	.csi0clkfreqrange = 0x20,
> +	.clear_ulps = true,
> +};
> +
>  static const struct of_device_id rcar_csi2_of_table[] = {
>  	{
>  		.compatible = "renesas,r8a7795-csi2",
> @@ -976,6 +983,10 @@ static const struct of_device_id rcar_cs
>  		.compatible = "renesas,r8a77970-csi2",
>  		.data = &rcar_csi2_info_r8a77970,
>  	},
> +	{
> +		.compatible = "renesas,r8a77980-csi2",
> +		.data = &rcar_csi2_info_r8a77980,
> +	},
>  	{ /* sentinel */ },
>  };
>  MODULE_DEVICE_TABLE(of, rcar_csi2_of_table);
Sergei Shtylyov Aug. 6, 2018, 6:24 p.m. UTC | #2
Hello!

On 08/06/2018 09:02 PM, Niklas Söderlund wrote:

> On 2018-08-06 19:56:27 +0300, Sergei Shtylyov wrote:
>> Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> It looks good but before I add my tag I would like to know if you tested 
> this on a V3H?

   No, have not tested the upstream patch, seemed too cumbersome (we did 
test the BSP patch AFAIK).

> In the past extending the R-Car CSI-2 receiver to a new 
> SoC always caught some new corner case :-)
> 
> I don't have access to a V3H myself otherwise I would of course test it 
> myself.

   CSI-2 on the Condor board is connected to a pair of MAX9286 GMSL de-serializers
which are connected to 4 (composite?) connectors... There's supposed to be sensor
chip on the other side, AFAIK...

MBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring Aug. 20, 2018, 10:24 p.m. UTC | #3
On Mon, Aug 06, 2018 at 07:56:27PM +0300, Sergei Shtylyov wrote:
> Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> This patch is against the 'media_tree.git' repo's 'master' branch.
> 
>  Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt |    1 

Acked-by: Rob Herring <robh@kernel.org>

>  drivers/media/platform/rcar-vin/rcar-csi2.c                   |   11 ++++++++++
>  2 files changed, 12 insertions(+)
Niklas Söderlund Sept. 17, 2018, 11:17 a.m. UTC | #4
Hi Sergei,

On 2018-08-06 21:24:11 +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 08/06/2018 09:02 PM, Niklas Söderlund wrote:
> 
> > On 2018-08-06 19:56:27 +0300, Sergei Shtylyov wrote:
> >> Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver.
> >>
> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > 
> > It looks good but before I add my tag I would like to know if you tested 
> > this on a V3H?
> 
>    No, have not tested the upstream patch, seemed too cumbersome (we did 
> test the BSP patch AFAIK).

Did you find time to test this change? I think it looks good but I would 
feel a lot better about this change if I knew it was tested :-) More 
often then not have we shaken a bug out of the rcar-{csi2,vin} tree by 
adding support for a new SoC.

Also if you for some reason need to resend this series could you split 
the DT documentation and driver changes in two separate patches?

> 
> > In the past extending the R-Car CSI-2 receiver to a new 
> > SoC always caught some new corner case :-)
> > 
> > I don't have access to a V3H myself otherwise I would of course test it 
> > myself.
> 
>    CSI-2 on the Condor board is connected to a pair of MAX9286 GMSL de-serializers
> which are connected to 4 (composite?) connectors... There's supposed to be sensor
> chip on the other side, AFAIK...

There is experimental patches which are tested on V3M that uses the 
MAX9286 GMSL setup if you feel brave and want to try and extend them to 
cover V3H ;-P

> 
> MBR, Sergei
Sergei Shtylyov Sept. 19, 2018, 6:44 p.m. UTC | #5
Hello!

On 09/17/2018 02:17 PM, Niklas Söderlund wrote:

>>>> Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver.
>>>>
>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>>
>>> It looks good but before I add my tag I would like to know if you tested 
>>> this on a V3H?
>>
>>    No, have not tested the upstream patch, seemed too cumbersome (we did 
>> test the BSP patch AFAIK).
> 
> Did you find time to test this change? I think it looks good but I would 

   Unfortunately, no.

> feel a lot better about this change if I knew it was tested :-) More 
> often then not have we shaken a bug out of the rcar-{csi2,vin} tree by 
> adding support for a new SoC.
> 
> Also if you for some reason need to resend this series could you split 
> the DT documentation and driver changes in two separate patches?

   OK.

>>> In the past extending the R-Car CSI-2 receiver to a new 
>>> SoC always caught some new corner case :-)
>>>
>>> I don't have access to a V3H myself otherwise I would of course test it 
>>> myself.
>>
>>    CSI-2 on the Condor board is connected to a pair of MAX9286 GMSL de-serializers
>> which are connected to 4 (composite?) connectors... There's supposed to be sensor
>> chip on the other side, AFAIK...
> 
> There is experimental patches which are tested on V3M that uses the 
> MAX9286 GMSL setup if you feel brave and want to try and extend them to 
> cover V3H ;-P

   Wouldn't hurt having them. :-)

MBR, Sergei
Niklas Söderlund Sept. 19, 2018, 9:43 p.m. UTC | #6
Hi Sergei,

Thanks for still working on this,

On 2018-09-19 21:44:53 +0300, Sergei Shtylyov wrote:
> >>    CSI-2 on the Condor board is connected to a pair of MAX9286 GMSL 
> >>    de-serializers
> >> which are connected to 4 (composite?) connectors... There's supposed to be sensor
> >> chip on the other side, AFAIK...
> > 
> > There is experimental patches which are tested on V3M that uses the 
> > MAX9286 GMSL setup if you feel brave and want to try and extend them to 
> > cover V3H ;-P
> 
>    Wouldn't hurt having them. :-)

My bad the intention when pointing out the existence of the patches 
where of course to also provide a reference to them ;-)

Unfortunately the whole stack is a bit out of date. A old branch with 
framework + max9286 + rdacm20 patches can be found at:

git://git.ragnatech.se/linux v4l2/mux+gmsl

While updated branch with framework changes is:

git://git.ragnatech.se/linux v4l2/mux

Patch
diff mbox series

Index: media_tree/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
===================================================================
--- media_tree.orig/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
+++ media_tree/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
@@ -12,6 +12,7 @@  Mandatory properties
    - "renesas,r8a7796-csi2" for the R8A7796 device.
    - "renesas,r8a77965-csi2" for the R8A77965 device.
    - "renesas,r8a77970-csi2" for the R8A77970 device.
+   - "renesas,r8a77980-csi2" for the R8A77980 device.
 
  - reg: the register base and size for the device registers
  - interrupts: the interrupt for the device
Index: media_tree/drivers/media/platform/rcar-vin/rcar-csi2.c
===================================================================
--- media_tree.orig/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ media_tree/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -959,6 +959,13 @@  static const struct rcar_csi2_info rcar_
 	.confirm_start = rcsi2_confirm_start_v3m_e3,
 };
 
+static const struct rcar_csi2_info rcar_csi2_info_r8a77980 = {
+	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
+	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
+	.csi0clkfreqrange = 0x20,
+	.clear_ulps = true,
+};
+
 static const struct of_device_id rcar_csi2_of_table[] = {
 	{
 		.compatible = "renesas,r8a7795-csi2",
@@ -976,6 +983,10 @@  static const struct of_device_id rcar_cs
 		.compatible = "renesas,r8a77970-csi2",
 		.data = &rcar_csi2_info_r8a77970,
 	},
+	{
+		.compatible = "renesas,r8a77980-csi2",
+		.data = &rcar_csi2_info_r8a77980,
+	},
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, rcar_csi2_of_table);