diff mbox

[3/4] gpio: davinci: Add a separate compatible for keystone-k2g soc

Message ID 1500375436-9435-4-git-send-email-j-keerthy@ti.com
State New
Headers show

Commit Message

J, KEERTHY July 18, 2017, 10:57 a.m. UTC
Add a separate compatible for keystone-k2g soc

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 Documentation/devicetree/bindings/gpio/gpio-davinci.txt | 3 ++-
 drivers/gpio/gpio-davinci.c                             | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Sekhar Nori July 18, 2017, 11:31 a.m. UTC | #1
Hi Keerthy,

On Tuesday 18 July 2017 04:27 PM, Keerthy wrote:
> Add a separate compatible for keystone-k2g soc
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  Documentation/devicetree/bindings/gpio/gpio-davinci.txt | 3 ++-
>  drivers/gpio/gpio-davinci.c                             | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
> index 5079ba7..1a5c1a2 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
> @@ -1,7 +1,8 @@
>  Davinci/Keystone GPIO controller bindings
>  
>  Required Properties:
> -- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio"
> +- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio",
> +	      "ti,keystone-k2g-gpio"
>  
>  - reg: Physical base address of the controller and the size of memory mapped
>         registers.
> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> index 932f270..a8d8dd9 100644
> --- a/drivers/gpio/gpio-davinci.c
> +++ b/drivers/gpio/gpio-davinci.c
> @@ -610,6 +610,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
>  static const struct of_device_id davinci_gpio_ids[] = {
>  	{ .compatible = "ti,keystone-gpio", keystone_gpio_get_irq_chip},
>  	{ .compatible = "ti,dm6441-gpio", davinci_gpio_get_irq_chip},
> +	{ .compatible = "ti,keystone-k2g-gpio", keystone_gpio_get_irq_chip},

You don't have to add compatible matching to the driver if you don't
need any special handling for K2G ATM. Your dts should have:

compatible = "ti,keystone-k2g-gpio", "ti,keystone-gpio";

this way, the driver continues to probe using "ti,keystone-gpio", and
when you really discover a need to do some special handling for K2G, a
kernel update will do without the need for a DT update.

Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J, KEERTHY July 18, 2017, 5:48 p.m. UTC | #2
On Tuesday 18 July 2017 05:01 PM, Sekhar Nori wrote:
> Hi Keerthy,
> 
> On Tuesday 18 July 2017 04:27 PM, Keerthy wrote:
>> Add a separate compatible for keystone-k2g soc
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>  Documentation/devicetree/bindings/gpio/gpio-davinci.txt | 3 ++-
>>  drivers/gpio/gpio-davinci.c                             | 1 +
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>> index 5079ba7..1a5c1a2 100644
>> --- a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>> +++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>> @@ -1,7 +1,8 @@
>>  Davinci/Keystone GPIO controller bindings
>>  
>>  Required Properties:
>> -- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio"
>> +- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio",
>> +	      "ti,keystone-k2g-gpio"
>>  
>>  - reg: Physical base address of the controller and the size of memory mapped
>>         registers.
>> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
>> index 932f270..a8d8dd9 100644
>> --- a/drivers/gpio/gpio-davinci.c
>> +++ b/drivers/gpio/gpio-davinci.c
>> @@ -610,6 +610,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
>>  static const struct of_device_id davinci_gpio_ids[] = {
>>  	{ .compatible = "ti,keystone-gpio", keystone_gpio_get_irq_chip},
>>  	{ .compatible = "ti,dm6441-gpio", davinci_gpio_get_irq_chip},
>> +	{ .compatible = "ti,keystone-k2g-gpio", keystone_gpio_get_irq_chip},
> 
> You don't have to add compatible matching to the driver if you don't
> need any special handling for K2G ATM. Your dts should have:
> 
> compatible = "ti,keystone-k2g-gpio", "ti,keystone-gpio";
> 
> this way, the driver continues to probe using "ti,keystone-gpio", and
> when you really discover a need to do some special handling for K2G, a
> kernel update will do without the need for a DT update.

Sure that is better to do as currently i do not see any differences
between k2g and other k2 devices.

> 
> Thanks,
> Sekhar
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring July 24, 2017, 6:24 p.m. UTC | #3
On Tue, Jul 18, 2017 at 04:27:15PM +0530, Keerthy wrote:
> Add a separate compatible for keystone-k2g soc
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  Documentation/devicetree/bindings/gpio/gpio-davinci.txt | 3 ++-
>  drivers/gpio/gpio-davinci.c                             | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
> index 5079ba7..1a5c1a2 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
> @@ -1,7 +1,8 @@
>  Davinci/Keystone GPIO controller bindings
>  
>  Required Properties:
> -- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio"
> +- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio",
> +	      "ti,keystone-k2g-gpio"

Reformat to one valid combination per line.

>  
>  - reg: Physical base address of the controller and the size of memory mapped
>         registers.
> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> index 932f270..a8d8dd9 100644
> --- a/drivers/gpio/gpio-davinci.c
> +++ b/drivers/gpio/gpio-davinci.c
> @@ -610,6 +610,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
>  static const struct of_device_id davinci_gpio_ids[] = {
>  	{ .compatible = "ti,keystone-gpio", keystone_gpio_get_irq_chip},
>  	{ .compatible = "ti,dm6441-gpio", davinci_gpio_get_irq_chip},
> +	{ .compatible = "ti,keystone-k2g-gpio", keystone_gpio_get_irq_chip},
>  	{ /* sentinel */ },
>  };
>  MODULE_DEVICE_TABLE(of, davinci_gpio_ids);
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J, KEERTHY July 25, 2017, 3:22 a.m. UTC | #4
On Monday 24 July 2017 11:54 PM, Rob Herring wrote:
> On Tue, Jul 18, 2017 at 04:27:15PM +0530, Keerthy wrote:
>> Add a separate compatible for keystone-k2g soc
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>  Documentation/devicetree/bindings/gpio/gpio-davinci.txt | 3 ++-
>>  drivers/gpio/gpio-davinci.c                             | 1 +
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>> index 5079ba7..1a5c1a2 100644
>> --- a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>> +++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
>> @@ -1,7 +1,8 @@
>>  Davinci/Keystone GPIO controller bindings
>>  
>>  Required Properties:
>> -- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio"
>> +- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio",
>> +	      "ti,keystone-k2g-gpio"
> 
> Reformat to one valid combination per line.

Sure Rob. Thanks for reviewing.

> 
>>  
>>  - reg: Physical base address of the controller and the size of memory mapped
>>         registers.
>> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
>> index 932f270..a8d8dd9 100644
>> --- a/drivers/gpio/gpio-davinci.c
>> +++ b/drivers/gpio/gpio-davinci.c
>> @@ -610,6 +610,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
>>  static const struct of_device_id davinci_gpio_ids[] = {
>>  	{ .compatible = "ti,keystone-gpio", keystone_gpio_get_irq_chip},
>>  	{ .compatible = "ti,dm6441-gpio", davinci_gpio_get_irq_chip},
>> +	{ .compatible = "ti,keystone-k2g-gpio", keystone_gpio_get_irq_chip},
>>  	{ /* sentinel */ },
>>  };
>>  MODULE_DEVICE_TABLE(of, davinci_gpio_ids);
>> -- 
>> 1.9.1
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
index 5079ba7..1a5c1a2 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.txt
@@ -1,7 +1,8 @@ 
 Davinci/Keystone GPIO controller bindings
 
 Required Properties:
-- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio"
+- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio",
+	      "ti,keystone-k2g-gpio"
 
 - reg: Physical base address of the controller and the size of memory mapped
        registers.
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 932f270..a8d8dd9 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -610,6 +610,7 @@  static int davinci_gpio_irq_setup(struct platform_device *pdev)
 static const struct of_device_id davinci_gpio_ids[] = {
 	{ .compatible = "ti,keystone-gpio", keystone_gpio_get_irq_chip},
 	{ .compatible = "ti,dm6441-gpio", davinci_gpio_get_irq_chip},
+	{ .compatible = "ti,keystone-k2g-gpio", keystone_gpio_get_irq_chip},
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, davinci_gpio_ids);