diff mbox

[v8,9/9] net: can: c_can: Add support for TI am4372 DCAN

Message ID 5469E55F.1050502@ti.com
State Accepted
Commit f2bf2589834faec7af8c02c3949c90788d21b790
Headers show

Commit Message

Roger Quadros Nov. 17, 2014, 12:09 p.m. UTC
AM4372 SoC has 2 DCAN modules. Add compatible id and
raminit driver data for it. The driver data is same as AM3352
but this gives us flexibility to add AM4372 specific quirks
if required later.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 Documentation/devicetree/bindings/net/can/c_can.txt | 3 ++-
 drivers/net/can/c_can/c_can_platform.c              | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Marc Kleine-Budde Nov. 17, 2014, 12:12 p.m. UTC | #1
On 11/17/2014 01:09 PM, Roger Quadros wrote:
> AM4372 SoC has 2 DCAN modules. Add compatible id and
> raminit driver data for it. The driver data is same as AM3352
> but this gives us flexibility to add AM4372 specific quirks
> if required later.

Strictly speaking we don't need the hunk in
"drivers/net/can/c_can/c_can_platform.c" yet, iff the AM4372 dts(i) has
this compatible:

"ti,am4372-d_can", "ti,am3352-d_can"

> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
>  Documentation/devicetree/bindings/net/can/c_can.txt | 3 ++-
>  drivers/net/can/c_can/c_can_platform.c              | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/c_can.txt b/Documentation/devicetree/bindings/net/can/c_can.txt
> index 6731730..5a1d8b0 100644
> --- a/Documentation/devicetree/bindings/net/can/c_can.txt
> +++ b/Documentation/devicetree/bindings/net/can/c_can.txt
> @@ -4,7 +4,8 @@ Bosch C_CAN/D_CAN controller Device Tree Bindings
>  Required properties:
>  - compatible		: Should be "bosch,c_can" for C_CAN controllers and
>  			  "bosch,d_can" for D_CAN controllers.
> -			  Can be "ti,dra7-d_can" or "ti,am3352-d_can".
> +			  Can be "ti,dra7-d_can", "ti,am3352-d_can" or
> +			  "ti,am4372-d_can".
>  - reg			: physical base address and size of the C_CAN/D_CAN
>  			  registers map
>  - interrupts		: property with a value describing the interrupt
> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
> index f4488e5..a4535d2 100644
> --- a/drivers/net/can/c_can/c_can_platform.c
> +++ b/drivers/net/can/c_can/c_can_platform.c
> @@ -235,6 +235,7 @@ static const struct of_device_id c_can_of_table[] = {
>  	{ .compatible = "bosch,d_can", .data = &d_can_drvdata },
>  	{ .compatible = "ti,dra7-d_can", .data = &dra7_dcan_drvdata },
>  	{ .compatible = "ti,am3352-d_can", .data = &am3352_dcan_drvdata },
> +	{ .compatible = "ti,am4372-d_can", .data = &am3352_dcan_drvdata },
>  	{ /* sentinel */ },
>  };
>  MODULE_DEVICE_TABLE(of, c_can_of_table);
> 

Marc
Roger Quadros Nov. 17, 2014, 12:31 p.m. UTC | #2
On 11/17/2014 02:12 PM, Marc Kleine-Budde wrote:
> On 11/17/2014 01:09 PM, Roger Quadros wrote:
>> AM4372 SoC has 2 DCAN modules. Add compatible id and
>> raminit driver data for it. The driver data is same as AM3352
>> but this gives us flexibility to add AM4372 specific quirks
>> if required later.
> 
> Strictly speaking we don't need the hunk in
> "drivers/net/can/c_can/c_can_platform.c" yet, iff the AM4372 dts(i) has
> this compatible:
> 
> "ti,am4372-d_can", "ti,am3352-d_can"

I tried with that, but checkpatch still gives this warning
WARNING: DT compatible string "ti,am4372-d_can" appears un-documented -- check ./Documentation/devicetree/bindings/

I guess we can just live with it. Please ignore this patch in that case.

cheers,
-roger

> 
>>
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>> ---
>>  Documentation/devicetree/bindings/net/can/c_can.txt | 3 ++-
>>  drivers/net/can/c_can/c_can_platform.c              | 1 +
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/can/c_can.txt b/Documentation/devicetree/bindings/net/can/c_can.txt
>> index 6731730..5a1d8b0 100644
>> --- a/Documentation/devicetree/bindings/net/can/c_can.txt
>> +++ b/Documentation/devicetree/bindings/net/can/c_can.txt
>> @@ -4,7 +4,8 @@ Bosch C_CAN/D_CAN controller Device Tree Bindings
>>  Required properties:
>>  - compatible		: Should be "bosch,c_can" for C_CAN controllers and
>>  			  "bosch,d_can" for D_CAN controllers.
>> -			  Can be "ti,dra7-d_can" or "ti,am3352-d_can".
>> +			  Can be "ti,dra7-d_can", "ti,am3352-d_can" or
>> +			  "ti,am4372-d_can".
>>  - reg			: physical base address and size of the C_CAN/D_CAN
>>  			  registers map
>>  - interrupts		: property with a value describing the interrupt
>> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
>> index f4488e5..a4535d2 100644
>> --- a/drivers/net/can/c_can/c_can_platform.c
>> +++ b/drivers/net/can/c_can/c_can_platform.c
>> @@ -235,6 +235,7 @@ static const struct of_device_id c_can_of_table[] = {
>>  	{ .compatible = "bosch,d_can", .data = &d_can_drvdata },
>>  	{ .compatible = "ti,dra7-d_can", .data = &dra7_dcan_drvdata },
>>  	{ .compatible = "ti,am3352-d_can", .data = &am3352_dcan_drvdata },
>> +	{ .compatible = "ti,am4372-d_can", .data = &am3352_dcan_drvdata },
>>  	{ /* sentinel */ },
>>  };
>>  MODULE_DEVICE_TABLE(of, c_can_of_table);
>>
> 
> Marc
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Roger Quadros Nov. 17, 2014, 2:19 p.m. UTC | #3
On 11/17/2014 02:31 PM, Roger Quadros wrote:
> On 11/17/2014 02:12 PM, Marc Kleine-Budde wrote:
>> On 11/17/2014 01:09 PM, Roger Quadros wrote:
>>> AM4372 SoC has 2 DCAN modules. Add compatible id and
>>> raminit driver data for it. The driver data is same as AM3352
>>> but this gives us flexibility to add AM4372 specific quirks
>>> if required later.
>>
>> Strictly speaking we don't need the hunk in
>> "drivers/net/can/c_can/c_can_platform.c" yet, iff the AM4372 dts(i) has
>> this compatible:
>>
>> "ti,am4372-d_can", "ti,am3352-d_can"
> 
> I tried with that, but checkpatch still gives this warning
> WARNING: DT compatible string "ti,am4372-d_can" appears un-documented -- check ./Documentation/devicetree/bindings/
> 
> I guess we can just live with it. Please ignore this patch in that case.

Did you meant that we still need to add it in the binding documentation?
It is not usable by itself so won't it be a problem to exist in documentation?

cheers,
-roger

> 
>>
>>>
>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>> ---
>>>  Documentation/devicetree/bindings/net/can/c_can.txt | 3 ++-
>>>  drivers/net/can/c_can/c_can_platform.c              | 1 +
>>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/can/c_can.txt b/Documentation/devicetree/bindings/net/can/c_can.txt
>>> index 6731730..5a1d8b0 100644
>>> --- a/Documentation/devicetree/bindings/net/can/c_can.txt
>>> +++ b/Documentation/devicetree/bindings/net/can/c_can.txt
>>> @@ -4,7 +4,8 @@ Bosch C_CAN/D_CAN controller Device Tree Bindings
>>>  Required properties:
>>>  - compatible		: Should be "bosch,c_can" for C_CAN controllers and
>>>  			  "bosch,d_can" for D_CAN controllers.
>>> -			  Can be "ti,dra7-d_can" or "ti,am3352-d_can".
>>> +			  Can be "ti,dra7-d_can", "ti,am3352-d_can" or
>>> +			  "ti,am4372-d_can".
>>>  - reg			: physical base address and size of the C_CAN/D_CAN
>>>  			  registers map
>>>  - interrupts		: property with a value describing the interrupt
>>> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
>>> index f4488e5..a4535d2 100644
>>> --- a/drivers/net/can/c_can/c_can_platform.c
>>> +++ b/drivers/net/can/c_can/c_can_platform.c
>>> @@ -235,6 +235,7 @@ static const struct of_device_id c_can_of_table[] = {
>>>  	{ .compatible = "bosch,d_can", .data = &d_can_drvdata },
>>>  	{ .compatible = "ti,dra7-d_can", .data = &dra7_dcan_drvdata },
>>>  	{ .compatible = "ti,am3352-d_can", .data = &am3352_dcan_drvdata },
>>> +	{ .compatible = "ti,am4372-d_can", .data = &am3352_dcan_drvdata },
>>>  	{ /* sentinel */ },
>>>  };
>>>  MODULE_DEVICE_TABLE(of, c_can_of_table);
>>>
>>
>> Marc
>>
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marc Kleine-Budde Nov. 17, 2014, 2:31 p.m. UTC | #4
On 11/17/2014 03:19 PM, Roger Quadros wrote:
> On 11/17/2014 02:31 PM, Roger Quadros wrote:
>> On 11/17/2014 02:12 PM, Marc Kleine-Budde wrote:
>>> On 11/17/2014 01:09 PM, Roger Quadros wrote:
>>>> AM4372 SoC has 2 DCAN modules. Add compatible id and
>>>> raminit driver data for it. The driver data is same as AM3352
>>>> but this gives us flexibility to add AM4372 specific quirks
>>>> if required later.
>>>
>>> Strictly speaking we don't need the hunk in
>>> "drivers/net/can/c_can/c_can_platform.c" yet, iff the AM4372 dts(i) has
>>> this compatible:
>>>
>>> "ti,am4372-d_can", "ti,am3352-d_can"
>>
>> I tried with that, but checkpatch still gives this warning
>> WARNING: DT compatible string "ti,am4372-d_can" appears un-documented -- check ./Documentation/devicetree/bindings/
>>
>> I guess we can just live with it. Please ignore this patch in that case.
> 
> Did you meant that we still need to add it in the binding documentation?
> It is not usable by itself so won't it be a problem to exist in documentation?

I'll take patch 9 as is, since checkpatch is a bit more picky now :)

Marc
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/net/can/c_can.txt b/Documentation/devicetree/bindings/net/can/c_can.txt
index 6731730..5a1d8b0 100644
--- a/Documentation/devicetree/bindings/net/can/c_can.txt
+++ b/Documentation/devicetree/bindings/net/can/c_can.txt
@@ -4,7 +4,8 @@  Bosch C_CAN/D_CAN controller Device Tree Bindings
 Required properties:
 - compatible		: Should be "bosch,c_can" for C_CAN controllers and
 			  "bosch,d_can" for D_CAN controllers.
-			  Can be "ti,dra7-d_can" or "ti,am3352-d_can".
+			  Can be "ti,dra7-d_can", "ti,am3352-d_can" or
+			  "ti,am4372-d_can".
 - reg			: physical base address and size of the C_CAN/D_CAN
 			  registers map
 - interrupts		: property with a value describing the interrupt
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index f4488e5..a4535d2 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -235,6 +235,7 @@  static const struct of_device_id c_can_of_table[] = {
 	{ .compatible = "bosch,d_can", .data = &d_can_drvdata },
 	{ .compatible = "ti,dra7-d_can", .data = &dra7_dcan_drvdata },
 	{ .compatible = "ti,am3352-d_can", .data = &am3352_dcan_drvdata },
+	{ .compatible = "ti,am4372-d_can", .data = &am3352_dcan_drvdata },
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, c_can_of_table);