[v1,26/43] pata: cirrus: add DT support for Cirrus EP93xx

Message ID 20230601054549.10843-8-nikita.shubin@maquefel.me
State New
Headers
Series None |

Commit Message

Nikita Shubin June 1, 2023, 5:45 a.m. UTC
  - find register range from the device tree
- get interrupts from device tree

Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---

Notes:
    v0 -> v1:
    
    - fixed headers
    - dropped coma in id table

 drivers/ata/pata_ep93xx.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Damien Le Moal June 1, 2023, 11:47 p.m. UTC | #1
On 6/1/23 14:45, Nikita Shubin wrote:
> - find register range from the device tree
> - get interrupts from device tree
> 
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>

Please change the commit title to:

ata: pata_ep93xx: add device tree support

> ---
> 
> Notes:
>     v0 -> v1:
>     
>     - fixed headers
>     - dropped coma in id table
> 
>  drivers/ata/pata_ep93xx.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
> index c6e043e05d43..8d363bc71342 100644
> --- a/drivers/ata/pata_ep93xx.c
> +++ b/drivers/ata/pata_ep93xx.c
> @@ -40,6 +40,7 @@
>  #include <linux/ata.h>
>  #include <linux/libata.h>
>  #include <linux/platform_device.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/delay.h>
>  #include <linux/dmaengine.h>
>  #include <linux/ktime.h>
> @@ -1016,9 +1017,16 @@ static int ep93xx_pata_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct of_device_id ep93xx_pata_of_ids[] = {
> +	{ .compatible = "cirrus,ep9312-pata" },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, ep93xx_pata_of_ids);
> +
>  static struct platform_driver ep93xx_pata_platform_driver = {
>  	.driver = {
>  		.name = DRV_NAME,
> +		.of_match_table = ep93xx_pata_of_ids,
>  	},
>  	.probe = ep93xx_pata_probe,
>  	.remove = ep93xx_pata_remove,
  
Andy Shevchenko June 2, 2023, 1:54 a.m. UTC | #2
Thu, Jun 01, 2023 at 08:45:31AM +0300, Nikita Shubin kirjoitti:
> - find register range from the device tree
> - get interrupts from device tree

...

>  #include <linux/ata.h>
>  #include <linux/libata.h>
>  #include <linux/platform_device.h>

> +#include <linux/mod_devicetable.h>

In all patches, can you try to put a new header inclusions to be ordered (to
some extent)?

>  #include <linux/delay.h>
>  #include <linux/dmaengine.h>
>  #include <linux/ktime.h>

With the context above a new one is logically suits this location.
  
Sergey Shtylyov June 2, 2023, 8:03 p.m. UTC | #3
Hello!

On 6/1/23 8:45 AM, Nikita Shubin wrote:

> - find register range from the device tree
> - get interrupts from device tree

   Hm... I'm not seeing such changes in your patch?

> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> ---
> 
> Notes:
>     v0 -> v1:
>     
>     - fixed headers
>     - dropped coma in id table
> 
>  drivers/ata/pata_ep93xx.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
> index c6e043e05d43..8d363bc71342 100644
> --- a/drivers/ata/pata_ep93xx.c
> +++ b/drivers/ata/pata_ep93xx.c
> @@ -40,6 +40,7 @@
>  #include <linux/ata.h>
>  #include <linux/libata.h>
>  #include <linux/platform_device.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/delay.h>
>  #include <linux/dmaengine.h>
>  #include <linux/ktime.h>
> @@ -1016,9 +1017,16 @@ static int ep93xx_pata_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct of_device_id ep93xx_pata_of_ids[] = {
> +	{ .compatible = "cirrus,ep9312-pata" },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, ep93xx_pata_of_ids);
> +
>  static struct platform_driver ep93xx_pata_platform_driver = {
>  	.driver = {
>  		.name = DRV_NAME,
> +		.of_match_table = ep93xx_pata_of_ids,
>  	},
>  	.probe = ep93xx_pata_probe,
>  	.remove = ep93xx_pata_remove,

MBR, Sergey
  
Nikita Shubin June 4, 2023, 7:29 p.m. UTC | #4
Hello Sergey!

On Fri, 2023-06-02 at 23:03 +0300, Sergey Shtylyov wrote:
> Hello!
> 
> On 6/1/23 8:45 AM, Nikita Shubin wrote:
> 
> > - find register range from the device tree
> > - get interrupts from device tree
> 
>    Hm... I'm not seeing such changes in your patch?

I meant that from now on it will take irq's and register from device
tree:
https://elixir.bootlin.com/linux/v6.4-rc4/source/drivers/ata/pata_ep93xx.c#L928

If CONFIG_OF_IRQ is enabled.

You are right

> > get interrupts from device tree

Is confusing.


> 
> > Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> > ---
> > 
> > Notes:
> >     v0 -> v1:
> >     
> >     - fixed headers
> >     - dropped coma in id table
> > 
> >  drivers/ata/pata_ep93xx.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
> > index c6e043e05d43..8d363bc71342 100644
> > --- a/drivers/ata/pata_ep93xx.c
> > +++ b/drivers/ata/pata_ep93xx.c
> > @@ -40,6 +40,7 @@
> >  #include <linux/ata.h>
> >  #include <linux/libata.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/mod_devicetable.h>
> >  #include <linux/delay.h>
> >  #include <linux/dmaengine.h>
> >  #include <linux/ktime.h>
> > @@ -1016,9 +1017,16 @@ static int ep93xx_pata_remove(struct
> > platform_device *pdev)
> >         return 0;
> >  }
> >  
> > +static const struct of_device_id ep93xx_pata_of_ids[] = {
> > +       { .compatible = "cirrus,ep9312-pata" },
> > +       { /* sentinel */ }
> > +};
> > +MODULE_DEVICE_TABLE(of, ep93xx_pata_of_ids);
> > +
> >  static struct platform_driver ep93xx_pata_platform_driver = {
> >         .driver = {
> >                 .name = DRV_NAME,
> > +               .of_match_table = ep93xx_pata_of_ids,
> >         },
> >         .probe = ep93xx_pata_probe,
> >         .remove = ep93xx_pata_remove,
> 
> MBR, Sergey
  

Patch

diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index c6e043e05d43..8d363bc71342 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -40,6 +40,7 @@ 
 #include <linux/ata.h>
 #include <linux/libata.h>
 #include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/delay.h>
 #include <linux/dmaengine.h>
 #include <linux/ktime.h>
@@ -1016,9 +1017,16 @@  static int ep93xx_pata_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ep93xx_pata_of_ids[] = {
+	{ .compatible = "cirrus,ep9312-pata" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, ep93xx_pata_of_ids);
+
 static struct platform_driver ep93xx_pata_platform_driver = {
 	.driver = {
 		.name = DRV_NAME,
+		.of_match_table = ep93xx_pata_of_ids,
 	},
 	.probe = ep93xx_pata_probe,
 	.remove = ep93xx_pata_remove,