[1/5] dt-bindings: can: tcan4x5x: Add tcan4552 and tcan4553 variants

Message ID 20230314151201.2317134-2-msp@baylibre.com
State New
Headers
Series can: tcan4x5x: Introduce tcan4552/4553 |

Commit Message

Markus Schneider-Pargmann March 14, 2023, 3:11 p.m. UTC
  These two new chips do not have state or wake pins.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
 .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
  

Comments

Simon Horman March 14, 2023, 4:13 p.m. UTC | #1
On Tue, Mar 14, 2023 at 04:11:57PM +0100, Markus Schneider-Pargmann wrote:
> These two new chips do not have state or wake pins.
> 
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>

Not a requirement from my side,
but perhaps it would be worth converting this binding to yaml
at some point.

> ---
>  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> index e3501bfa22e9..38a2b5369b44 100644
> --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
>  This file provides device node information for the TCAN4x5x interface contains.
>  
>  Required properties:
> -	- compatible: "ti,tcan4x5x"
> +	- compatible:
> +		"ti,tcan4x5x" or
> +		"ti,tcan4552" or
> +		"ti,tcan4553"
>  	- reg: 0
>  	- #address-cells: 1
>  	- #size-cells: 0
> @@ -21,8 +24,10 @@ Optional properties:
>  	- reset-gpios: Hardwired output GPIO. If not defined then software
>  		       reset.
>  	- device-state-gpios: Input GPIO that indicates if the device is in
> -			      a sleep state or if the device is active.
> -	- device-wake-gpios: Wake up GPIO to wake up the TCAN device.
> +			      a sleep state or if the device is active. Not
> +			      available with tcan4552/4553.
> +	- device-wake-gpios: Wake up GPIO to wake up the TCAN device. Not
> +			     available with tcan4552/4553.
>  
>  Example:
>  tcan4x5x: tcan4x5x@0 {
> -- 
> 2.39.2
>
  
Krzysztof Kozlowski March 14, 2023, 8:01 p.m. UTC | #2
On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
> These two new chips do not have state or wake pins.
> 
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> ---
>  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> index e3501bfa22e9..38a2b5369b44 100644
> --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
>  This file provides device node information for the TCAN4x5x interface contains.
>  
>  Required properties:
> -	- compatible: "ti,tcan4x5x"
> +	- compatible:
> +		"ti,tcan4x5x" or
> +		"ti,tcan4552" or
> +		"ti,tcan4553"

Awesome, they nicely fit into wildcard... Would be useful to deprecate
the wildcard at some point and switch to proper compatibles in such
case, because now they became confusing.

Anyway:

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof
  
Markus Schneider-Pargmann March 15, 2023, 10:49 a.m. UTC | #3
Hi Krzysztof,

On Tue, Mar 14, 2023 at 09:01:10PM +0100, Krzysztof Kozlowski wrote:
> On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
> > These two new chips do not have state or wake pins.
> > 
> > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> > ---
> >  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > index e3501bfa22e9..38a2b5369b44 100644
> > --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
> >  This file provides device node information for the TCAN4x5x interface contains.
> >  
> >  Required properties:
> > -	- compatible: "ti,tcan4x5x"
> > +	- compatible:
> > +		"ti,tcan4x5x" or
> > +		"ti,tcan4552" or
> > +		"ti,tcan4553"
> 
> Awesome, they nicely fit into wildcard... Would be useful to deprecate
> the wildcard at some point and switch to proper compatibles in such
> case, because now they became confusing.
> 
> Anyway:
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thank you. Indeed the old generic name could be replaced, unfortunately
I don't have a list of devices that this generic wildcard matches.

Best,
Markus
  
Marc Kleine-Budde March 15, 2023, 11:25 a.m. UTC | #4
On 14.03.2023 21:01:10, Krzysztof Kozlowski wrote:
> On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
> > These two new chips do not have state or wake pins.
> > 
> > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> > ---
> >  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > index e3501bfa22e9..38a2b5369b44 100644
> > --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
> >  This file provides device node information for the TCAN4x5x interface contains.
> >  
> >  Required properties:
> > -	- compatible: "ti,tcan4x5x"
> > +	- compatible:
> > +		"ti,tcan4x5x" or
> > +		"ti,tcan4552" or
> > +		"ti,tcan4553"
> 
> Awesome, they nicely fit into wildcard... Would be useful to deprecate
> the wildcard at some point and switch to proper compatibles in such
> case, because now they became confusing.

I plead for DT stability!

As I understand correctly, the exact version of the chip (4550, 4552, or
4553) can be detected via the ID2 register.

regards,
Marc
  
Marc Kleine-Budde March 15, 2023, 11:29 a.m. UTC | #5
On 15.03.2023 11:49:14, Markus Schneider-Pargmann wrote:
> Hi Krzysztof,
> 
> On Tue, Mar 14, 2023 at 09:01:10PM +0100, Krzysztof Kozlowski wrote:
> > On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
> > > These two new chips do not have state or wake pins.
> > > 
> > > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> > > ---
> > >  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
> > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > > index e3501bfa22e9..38a2b5369b44 100644
> > > --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > > +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > > @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
> > >  This file provides device node information for the TCAN4x5x interface contains.
> > >  
> > >  Required properties:
> > > -	- compatible: "ti,tcan4x5x"
> > > +	- compatible:
> > > +		"ti,tcan4x5x" or
> > > +		"ti,tcan4552" or
> > > +		"ti,tcan4553"
> > 
> > Awesome, they nicely fit into wildcard... Would be useful to deprecate
> > the wildcard at some point and switch to proper compatibles in such
> > case, because now they became confusing.
> > 
> > Anyway:
> > 
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Thank you. Indeed the old generic name could be replaced, unfortunately
> I don't have a list of devices that this generic wildcard matches.

The mcp251xfd driver supports "microchip,mcp2517fd",
"microchip,mcp2518fd", "microchip,mcp251863", and "microchip,mcp251xfd".
It always does auto detection and throws a warning if the found chip is
not consistent with the firmware (DT, ACPI).

Marc
  
Krzysztof Kozlowski March 15, 2023, 1:14 p.m. UTC | #6
On 15/03/2023 12:25, Marc Kleine-Budde wrote:
> On 14.03.2023 21:01:10, Krzysztof Kozlowski wrote:
>> On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
>>> These two new chips do not have state or wake pins.
>>>
>>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>>> ---
>>>  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
>>>  1 file changed, 8 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
>>> index e3501bfa22e9..38a2b5369b44 100644
>>> --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
>>> +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
>>> @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
>>>  This file provides device node information for the TCAN4x5x interface contains.
>>>  
>>>  Required properties:
>>> -	- compatible: "ti,tcan4x5x"
>>> +	- compatible:
>>> +		"ti,tcan4x5x" or
>>> +		"ti,tcan4552" or
>>> +		"ti,tcan4553"
>>
>> Awesome, they nicely fit into wildcard... Would be useful to deprecate
>> the wildcard at some point and switch to proper compatibles in such
>> case, because now they became confusing.
> 
> I plead for DT stability!
> 
> As I understand correctly, the exact version of the chip (4550, 4552, or
> 4553) can be detected via the ID2 register.

So maybe there is no need for this patch at all? Or the new compatibles
should be made compatible with generic fallback?

Best regards,
Krzysztof
  
Markus Schneider-Pargmann March 15, 2023, 3:58 p.m. UTC | #7
On Wed, Mar 15, 2023 at 02:14:27PM +0100, Krzysztof Kozlowski wrote:
> On 15/03/2023 12:25, Marc Kleine-Budde wrote:
> > On 14.03.2023 21:01:10, Krzysztof Kozlowski wrote:
> >> On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
> >>> These two new chips do not have state or wake pins.
> >>>
> >>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> >>> ---
> >>>  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
> >>>  1 file changed, 8 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> >>> index e3501bfa22e9..38a2b5369b44 100644
> >>> --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> >>> +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> >>> @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
> >>>  This file provides device node information for the TCAN4x5x interface contains.
> >>>  
> >>>  Required properties:
> >>> -	- compatible: "ti,tcan4x5x"
> >>> +	- compatible:
> >>> +		"ti,tcan4x5x" or
> >>> +		"ti,tcan4552" or
> >>> +		"ti,tcan4553"
> >>
> >> Awesome, they nicely fit into wildcard... Would be useful to deprecate
> >> the wildcard at some point and switch to proper compatibles in such
> >> case, because now they became confusing.
> > 
> > I plead for DT stability!
> > 
> > As I understand correctly, the exact version of the chip (4550, 4552, or
> > 4553) can be detected via the ID2 register.
> 
> So maybe there is no need for this patch at all? Or the new compatibles
> should be made compatible with generic fallback?

I can use the value being read from the ID2 register to get the version.
This at least holds the correct value for tcan4550, 4552 and 4553. But
the state and wake gpios can't be used in case of a 4552 or 4553.

So yes, it is possible to do it without the new compatibles but the
changes for state and wake gpios need to stay.

What do you two prefer?

Best,
Markus
  
Simon Horman March 15, 2023, 4:03 p.m. UTC | #8
On Wed, Mar 15, 2023 at 04:58:33PM +0100, Markus Schneider-Pargmann wrote:
> On Wed, Mar 15, 2023 at 02:14:27PM +0100, Krzysztof Kozlowski wrote:
> > On 15/03/2023 12:25, Marc Kleine-Budde wrote:
> > > On 14.03.2023 21:01:10, Krzysztof Kozlowski wrote:
> > >> On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
> > >>> These two new chips do not have state or wake pins.
> > >>>
> > >>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> > >>> ---
> > >>>  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
> > >>>  1 file changed, 8 insertions(+), 3 deletions(-)
> > >>>
> > >>> diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > >>> index e3501bfa22e9..38a2b5369b44 100644
> > >>> --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > >>> +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
> > >>> @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
> > >>>  This file provides device node information for the TCAN4x5x interface contains.
> > >>>  
> > >>>  Required properties:
> > >>> -	- compatible: "ti,tcan4x5x"
> > >>> +	- compatible:
> > >>> +		"ti,tcan4x5x" or
> > >>> +		"ti,tcan4552" or
> > >>> +		"ti,tcan4553"
> > >>
> > >> Awesome, they nicely fit into wildcard... Would be useful to deprecate
> > >> the wildcard at some point and switch to proper compatibles in such
> > >> case, because now they became confusing.
> > > 
> > > I plead for DT stability!
> > > 
> > > As I understand correctly, the exact version of the chip (4550, 4552, or
> > > 4553) can be detected via the ID2 register.
> > 
> > So maybe there is no need for this patch at all? Or the new compatibles
> > should be made compatible with generic fallback?
> 
> I can use the value being read from the ID2 register to get the version.
> This at least holds the correct value for tcan4550, 4552 and 4553. But
> the state and wake gpios can't be used in case of a 4552 or 4553.
> 
> So yes, it is possible to do it without the new compatibles but the
> changes for state and wake gpios need to stay.
> 
> What do you two prefer?

FWIIW, I think it is good to have the extra compat strings,
even if the driver only uses the fallback string for now.
This would allow the driver to take into account HW differences that come
to light later, without needing to update the bindings.
  
Krzysztof Kozlowski March 15, 2023, 4:07 p.m. UTC | #9
On 15/03/2023 16:58, Markus Schneider-Pargmann wrote:
> On Wed, Mar 15, 2023 at 02:14:27PM +0100, Krzysztof Kozlowski wrote:
>> On 15/03/2023 12:25, Marc Kleine-Budde wrote:
>>> On 14.03.2023 21:01:10, Krzysztof Kozlowski wrote:
>>>> On 14/03/2023 16:11, Markus Schneider-Pargmann wrote:
>>>>> These two new chips do not have state or wake pins.
>>>>>
>>>>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>>>>> ---
>>>>>  .../devicetree/bindings/net/can/tcan4x5x.txt          | 11 ++++++++---
>>>>>  1 file changed, 8 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
>>>>> index e3501bfa22e9..38a2b5369b44 100644
>>>>> --- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
>>>>> +++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
>>>>> @@ -4,7 +4,10 @@ Texas Instruments TCAN4x5x CAN Controller
>>>>>  This file provides device node information for the TCAN4x5x interface contains.
>>>>>  
>>>>>  Required properties:
>>>>> -	- compatible: "ti,tcan4x5x"
>>>>> +	- compatible:
>>>>> +		"ti,tcan4x5x" or
>>>>> +		"ti,tcan4552" or
>>>>> +		"ti,tcan4553"
>>>>
>>>> Awesome, they nicely fit into wildcard... Would be useful to deprecate
>>>> the wildcard at some point and switch to proper compatibles in such
>>>> case, because now they became confusing.
>>>
>>> I plead for DT stability!
>>>
>>> As I understand correctly, the exact version of the chip (4550, 4552, or
>>> 4553) can be detected via the ID2 register.
>>
>> So maybe there is no need for this patch at all? Or the new compatibles
>> should be made compatible with generic fallback?
> 
> I can use the value being read from the ID2 register to get the version.
> This at least holds the correct value for tcan4550, 4552 and 4553. But
> the state and wake gpios can't be used in case of a 4552 or 4553.
> 
> So yes, it is possible to do it without the new compatibles but the
> changes for state and wake gpios need to stay.
> 
> What do you two prefer?

Then specific with generic fallback compatibles, although for driver it
still won't matter as you need to customize driver_data anyway.

Best regards,
Krzysztof
  

Patch

diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
index e3501bfa22e9..38a2b5369b44 100644
--- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
+++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
@@ -4,7 +4,10 @@  Texas Instruments TCAN4x5x CAN Controller
 This file provides device node information for the TCAN4x5x interface contains.
 
 Required properties:
-	- compatible: "ti,tcan4x5x"
+	- compatible:
+		"ti,tcan4x5x" or
+		"ti,tcan4552" or
+		"ti,tcan4553"
 	- reg: 0
 	- #address-cells: 1
 	- #size-cells: 0
@@ -21,8 +24,10 @@  Optional properties:
 	- reset-gpios: Hardwired output GPIO. If not defined then software
 		       reset.
 	- device-state-gpios: Input GPIO that indicates if the device is in
-			      a sleep state or if the device is active.
-	- device-wake-gpios: Wake up GPIO to wake up the TCAN device.
+			      a sleep state or if the device is active. Not
+			      available with tcan4552/4553.
+	- device-wake-gpios: Wake up GPIO to wake up the TCAN device. Not
+			     available with tcan4552/4553.
 
 Example:
 tcan4x5x: tcan4x5x@0 {