Skip to contentSkip to conversation

alter_ps2: Add devicetree support

PATCH Superseded Thomas Chou 6 participants 27 messages Jan 17, 2011 – Feb 16, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 alter_ps2: Add devicetree support

From: Walter Goossens <[email protected]>

---
 drivers/input/serio/altera_ps2.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/input/serio/altera_ps2.c +16 -0
index 7998560..93054a1 100644
@@ -19,6 +19,9 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#ifdef CONFIG_OF
+#include <linux/of.h>
+#endif
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +176,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id altera_ps2_match[] = {
+	{ 
+		.compatible = "altera,altera_ps2",
+	},
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#endif /* CONFIG_OF */
+
 /*
  * Our device driver structure
  */
@@ -182,6 +195,9 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+#ifdef CONFIG_OF
+		.of_match_table = altera_ps2_match,
+#endif
 	},
 };
 
Signature · 1 line
1.7.3.4
#2 lore raw
Quoted 23 lines · Thomas Chou

From: Walter Goossens <[email protected]>

---
 drivers/input/serio/altera_ps2.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/input/serio/altera_ps2.c +3 -0
index 7998560..93054a1 100644
@@ -19,6 +19,9 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#ifdef CONFIG_OF
+#include <linux/of.h>
+#endif
 
 #define DRV_NAME "altera_ps2"
 

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 183

Quoted 8 lines
drivers/input/serio/altera_ps2.c +5 -0
@@ -173,6 +176,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
       return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id altera_ps2_match[] = {
+       {
+               .compatible = "altera,altera_ps2",
+       },

So is this an FPGA soft core PS2 device? Is there any kind of version attached to the soft core? The compatible value should specify an exact version of the implementation that this driver works with. (Newer core versions can claim compatibility with older ones, so the driver's compatible list doesn't need to be exhaustive).

Otherwise, this patch looks correct.

g.

Quoted 22 lines
drivers/input/serio/altera_ps2.c +8 -1
+       {},
+}
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#endif /* CONFIG_OF */
+
 /*
 * Our device driver structure
 */
@@ -182,6 +195,9 @@ static struct platform_driver altera_ps2_driver = {
       .driver = {
               .name   = DRV_NAME,
               .owner  = THIS_MODULE,
+#ifdef CONFIG_OF
+               .of_match_table = altera_ps2_match,
+#endif
       },
 };
 
--

1.7.3.4

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#3 lore raw
Quoted 27 lines · Grant Likely
Quoted 26 lines · Thomas Chou

From: Walter Goossens <[email protected]>

---
 drivers/input/serio/altera_ps2.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/input/serio/altera_ps2.c +3 -0
index 7998560..93054a1 100644
@@ -19,6 +19,9 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#ifdef CONFIG_OF
+#include <linux/of.h>
+#endif
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +176,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
       return 0;
 }
 
Quoted 11 lines

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 183

Quoted 5 lines
drivers/input/serio/altera_ps2.c +5 -0
+#ifdef CONFIG_OF
+static struct of_device_id altera_ps2_match[] = {
+       {
+               .compatible = "altera,altera_ps2",
+       },

So is this an FPGA soft core PS2 device? Is there any kind of version attached to the soft core? The compatible value should specify an exact version of the implementation that this driver works with. (Newer core versions can claim compatibility with older ones, so the driver's compatible list doesn't need to be exhaustive).

What's the preferred way of versioning components in a device-tree? Quite a few components inside an fpga will get a new version number with every release of the tools. For example components supplied by Altera will get a new number with every release of their IP library (approx. twice a year) even when (at least from a software point of view) there is nothing changed in the core. Should we add the number to the "compatible" name and possibly get slightly more bulky drivers, or add a version tag to the components where a driver can make decisions based on the version of the core (if needed)?
Another way to reduce the number of lines in a compatible section would be to add both their versioned and unversioned compatible entry in the dts so drivers not needing a specific version don't need to supply the entire list.
We do have the version numbers available when generating the DTS and NiosII is still quite new to device-tree so we are still flexible in fixing this in the best possible way.

Quoted 28 lines

Otherwise, this patch looks correct.

g.

Quoted 22 lines
drivers/input/serio/altera_ps2.c +8 -1
+       {},
+}
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#endif /* CONFIG_OF */
+
 /*
 * Our device driver structure
 */
@@ -182,6 +195,9 @@ static struct platform_driver altera_ps2_driver = {
       .driver = {
               .name   = DRV_NAME,
               .owner  = THIS_MODULE,
+#ifdef CONFIG_OF
+               .of_match_table = altera_ps2_match,
+#endif
       },
 };
 
--

1.7.3.4

#4 lore raw
Quoted 17 lines · Walter Goossens
Quoted 5 lines · Grant Likely
Quoted 4 lines · Thomas Chou
drivers/input/serio/altera_ps2.c +0 -0
@@ -173,6 +176,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
       return 0;
 }
 
Quoted 11 lines

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 183

Quoted 5 lines
drivers/input/serio/altera_ps2.c +5 -0
+#ifdef CONFIG_OF
+static struct of_device_id altera_ps2_match[] = {
+       {
+               .compatible = "altera,altera_ps2",
+       },

So is this an FPGA soft core PS2 device? Is there any kind of version attached to the soft core? The compatible value should specify an exact version of the implementation that this driver works with. (Newer core versions can claim compatibility with older ones, so the driver's compatible list doesn't need to be exhaustive).

Quoted 16 lines

What's the preferred way of versioning components in a device-tree? Quite a few components inside an fpga will get a new version number with every release of the tools. For example components supplied by Altera will get a new number with every release of their IP library (approx. twice a year) even when (at least from a software point of view) there is nothing changed in the core. Should we add the number to the "compatible" name and possibly get slightly more bulky drivers, or add a version tag to the components where a driver can make decisions based on the version of the core (if needed)?
Another way to reduce the number of lines in a compatible section would be to add both their versioned and unversioned compatible entry in the dts so drivers not needing a specific version don't need to supply the entire list.
We do have the version numbers available when generating the DTS and NiosII is still quite new to device-tree so we are still flexible in fixing this in the best possible way.

A good rule of thumb is to always choose compatible values that reflect real working hardware. ie. "xlnx,xps-uartlite-1.00.a" instead of trying to define a generic "xlnx,uartlite". You can see this value in drivers/serial/uartlite.c, and write the driver to match the value of the device that you actually worked with.

Then, when you produce a .dts for a design, each device must specify exactly what it is (the specific version) plus an optional list of devices that it is 100% register-level backwards compatible with. In the example above, the uartlite has retained the exact same interface, so all designs claim compatibility with xlnx,xps-uartlite-1.00.a regardless of the actual version.

To take the example of the altera ps2 core; say altera has released versions 1, 2, 3, 4 and 5 of the core, and say the behaviour changed in a non-compatible way in version 3. Then the driver might do something like:

static struct of_device_id altera_ps2_match[] = {
       { .compatible = "altera,altera_ps2-1", .data = altera_ps2_1_ops, },
       { .compatible = "altera,altera_ps2-3", .data = altera_ps2_3_ops, },
       { }
};

Then the compatible values for each version in a .dts file would be:

v1: compatible = "altera,altera_ps2-1";
v2: compatible = "altera,altera_ps2-2", "altera,altera_ps2-1";
v3: compatible = "altera,altera_ps2-3";
v4: compatible = "altera,altera_ps2-4", "altera,altera_ps2-3";
v5: compatible = "altera,altera_ps2-5", "altera,altera_ps2-3";

so, instead of trying to us a 'generic' value like "altera,altera_ps2" which has a bunch of ambiguity about which hardware actually implements the behaviour, the values "altera,altera_ps2-1" and "altera,altera_ps2-3" become the de-facto 'generic' values without any messiness or ambiguity about what they mean.

Plus, each .dts file still specifies the exact version that is implemented on the board so that the driver can still fixup version-specific bugs if any are discovered in the future.

g.

Quoted 30 lines
Quoted 29 lines

Otherwise, this patch looks correct.

g.

Quoted 22 lines
drivers/input/serio/altera_ps2.c +8 -1
+       {},
+}
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#endif /* CONFIG_OF */
+
 /*
 * Our device driver structure
 */
@@ -182,6 +195,9 @@ static struct platform_driver altera_ps2_driver = {
       .driver = {
               .name   = DRV_NAME,
               .owner  = THIS_MODULE,
+#ifdef CONFIG_OF
+               .of_match_table = altera_ps2_match,
+#endif
       },
 };
 
--

1.7.3.4

#5 lore raw
Quoted 73 lines · Grant Likely
Quoted 17 lines · Walter Goossens
Quoted 5 lines · Grant Likely
Quoted 4 lines · Thomas Chou
drivers/input/serio/altera_ps2.c +0 -0
@@ -173,6 +176,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
        return 0;
  }
 
Quoted 11 lines

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 183

Quoted 5 lines
drivers/input/serio/altera_ps2.c +5 -0
+#ifdef CONFIG_OF
+static struct of_device_id altera_ps2_match[] = {
+       {
+               .compatible = "altera,altera_ps2",
+       },

So is this an FPGA soft core PS2 device? Is there any kind of version attached to the soft core? The compatible value should specify an exact version of the implementation that this driver works with. (Newer core versions can claim compatibility with older ones, so the driver's compatible list doesn't need to be exhaustive).

Quoted 16 lines

What's the preferred way of versioning components in a device-tree? Quite a few components inside an fpga will get a new version number with every release of the tools. For example components supplied by Altera will get a new number with every release of their IP library (approx. twice a year) even when (at least from a software point of view) there is nothing changed in the core. Should we add the number to the "compatible" name and possibly get slightly more bulky drivers, or add a version tag to the components where a driver can make decisions based on the version of the core (if needed)?
Another way to reduce the number of lines in a compatible section would be to add both their versioned and unversioned compatible entry in the dts so drivers not needing a specific version don't need to supply the entire list.
We do have the version numbers available when generating the DTS and NiosII is still quite new to device-tree so we are still flexible in fixing this in the best possible way.

A good rule of thumb is to always choose compatible values that reflect real working hardware. ie. "xlnx,xps-uartlite-1.00.a" instead of trying to define a generic "xlnx,uartlite". You can see this value in drivers/serial/uartlite.c, and write the driver to match the value of the device that you actually worked with.

Then, when you produce a .dts for a design, each device must specify exactly what it is (the specific version) plus an optional list of devices that it is 100% register-level backwards compatible with. In the example above, the uartlite has retained the exact same interface, so all designs claim compatibility with xlnx,xps-uartlite-1.00.a regardless of the actual version.

To take the example of the altera ps2 core; say altera has released versions 1, 2, 3, 4 and 5 of the core, and say the behaviour changed in a non-compatible way in version 3. Then the driver might do something like:

static struct of_device_id altera_ps2_match[] = {
        { .compatible = "altera,altera_ps2-1", .data = altera_ps2_1_ops, },
        { .compatible = "altera,altera_ps2-3", .data = altera_ps2_3_ops, },
        { }
};

Then the compatible values for each version in a .dts file would be:

v1: compatible = "altera,altera_ps2-1";
v2: compatible = "altera,altera_ps2-2", "altera,altera_ps2-1";
v3: compatible = "altera,altera_ps2-3";
v4: compatible = "altera,altera_ps2-4", "altera,altera_ps2-3";
v5: compatible = "altera,altera_ps2-5", "altera,altera_ps2-3";

so, instead of trying to us a 'generic' value like "altera,altera_ps2" which has a bunch of ambiguity about which hardware actually implements the behaviour, the values "altera,altera_ps2-1" and "altera,altera_ps2-3" become the de-facto 'generic' values without any messiness or ambiguity about what they mean.

Quoted 4 lines

Plus, each .dts file still specifies the exact version that is implemented on the board so that the driver can still fixup version-specific bugs if any are discovered in the future.

Ahh ok.
That does look like a good solution. I'll try and cook something up for that. Thanks for the explanation!

Walter

Quoted 29 lines

g.

Quoted 27 lines
Quoted 27 lines

Otherwise, this patch looks correct.

g.

Quoted 22 lines
drivers/input/serio/altera_ps2.c +8 -1
+       {},
+}
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#endif /* CONFIG_OF */
+
  /*
  * Our device driver structure
  */
@@ -182,6 +195,9 @@ static struct platform_driver altera_ps2_driver = {
        .driver = {
                .name   = DRV_NAME,
                .owner  = THIS_MODULE,
+#ifdef CONFIG_OF
+               .of_match_table = altera_ps2_match,
+#endif
        },
  };
 
--

1.7.3.4

#6 lore raw
Quoted 6 lines · Walter Goossens
Quoted 6 lines

so, instead of trying to us a 'generic' value like "altera,altera_ps2" which has a bunch of ambiguity about which hardware actually implements the behaviour, the values "altera,altera_ps2-1" and "altera,altera_ps2-3" become the de-facto 'generic' values without any messiness or ambiguity about what they mean.

Quoted 7 lines
Quoted 4 lines

Plus, each .dts file still specifies the exact version that is implemented on the board so that the driver can still fixup version-specific bugs if any are discovered in the future.

Ahh ok.
That does look like a good solution. I'll try and cook something up for that.

Hi Walter,

Can we use "kind" and "version" attribute of a sopcinfo file to build the match string? This way, your dts converter won't need update for each new component.

eg,

kind="altera_avalon_spi" version="9.0" ==> "altera","avalon-spi-9.0"

kind="altera_up_avalon_ps2_classic" version="6.1" ==>
"altera","up-avalon-ps2-classic-6.1"

- Thomas

maintainer
#7 lore raw
In reply to Thomas Chou
Quoted 2 lines · Thomas Chou

From: Walter Goossens <[email protected]>

For my education, why is this needed?

Quoted 11 lines
---
 drivers/input/serio/altera_ps2.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/input/serio/altera_ps2.c +0 -0
index 7998560..93054a1 100644

drivers/input/serio/altera_ps2.c line 24

Quoted 6 lines
drivers/input/serio/altera_ps2.c +3 -0
@@ -19,6 +19,9 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#ifdef CONFIG_OF
+#include <linux/of.h>
+#endif

Does it have to be guarded?

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 180

Quoted 9 lines
drivers/input/serio/altera_ps2.c +2 -0
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +176,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id altera_ps2_match[] = {

Not const?

Quoted 12 lines
drivers/input/serio/altera_ps2.c +8 -0
+	{ 
+		.compatible = "altera,altera_ps2",
+	},
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#endif /* CONFIG_OF */
+
 /*
  * Our device driver structure
  */

drivers/input/serio/altera_ps2.c static struct platform_driver altera_ps2_driver = { · line 200

Quoted 6 lines
drivers/input/serio/altera_ps2.c +3 -0
@@ -182,6 +195,9 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+#ifdef CONFIG_OF
+		.of_match_table = altera_ps2_match,
+#endif

Can't we spare 4 bytes per driver and have .of_match_table always present?

Signature · 1 line
Dmitry
#8 lore raw
Quoted 12 lines · Dmitry Torokhov
Quoted 2 lines · Thomas Chou

From: Walter Goossens <[email protected]>

For my education, why is this needed?

Quoted 6 lines
---
 drivers/input/serio/altera_ps2.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
Quoted 13 lines

drivers/input/serio/altera_ps2.c line 24

Quoted 11 lines
drivers/input/serio/altera_ps2.c +3 -0
index 7998560..93054a1 100644
@@ -19,6 +19,9 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#ifdef CONFIG_OF
+#include <linux/of.h>
+#endif

Does it have to be guarded?

Shouldn't need to be.

Quoted 26 lines

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 180

Quoted 10 lines
drivers/input/serio/altera_ps2.c +2 -0
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +176,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id altera_ps2_match[] = {

Not const?

Quoted 13 lines
drivers/input/serio/altera_ps2.c +8 -0
+	{ 
+		.compatible = "altera,altera_ps2",
+	},
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#endif /* CONFIG_OF */
+
 /*
  * Our device driver structure
  */
@@ -182,6 +195,9 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
Quoted 8 lines

drivers/input/serio/altera_ps2.c static struct platform_driver altera_ps2_driver = { · line 200

Quoted 5 lines
drivers/input/serio/altera_ps2.c +3 -0
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+#ifdef CONFIG_OF
+		.of_match_table = altera_ps2_match,
+#endif

Can't we spare 4 bytes per driver and have .of_match_table always present?

Yeah, probably. I've been trying to avoid it, but I suppose that is much ado about a tiny amount of data. I'll craft a patch.

g.

#9 lore raw

PATCH v2 1/1 altera_ps2: Add devicetree support

From: Walter Goossens <[email protected]>

---
v2 use const and add compat version.

 drivers/input/serio/altera_ps2.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
drivers/input/serio/altera_ps2.c +9 -2
index 7998560..63325ee 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +174,12 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+
 /*
  * Our device driver structure
  */
@@ -182,6 +189,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,
 	},
 };
 
@@ -189,13 +197,12 @@ static int __init altera_ps2_init(void)
 {
 	return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
 	platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
Signature · 1 line
1.7.3.4
#10 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

Quoted 23 lines · Thomas Chou

From: Walter Goossens <[email protected]>

---
v2 use const and add compat version.

 drivers/input/serio/altera_ps2.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
drivers/input/serio/altera_ps2.c +1 -0
index 7998560..63325ee 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 5 lines
drivers/input/serio/altera_ps2.c +2 -0
@@ -173,6 +174,12 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

drivers/input/serio/altera_ps2.c static struct platform_driver altera_ps2_driver = { · line 192

Quoted 12 lines
drivers/input/serio/altera_ps2.c +5 -0
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+
 /*
  * Our device driver structure
  */
@@ -182,6 +189,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,

At the moment, this patch can only be applied against my devicetree/next branch since there is a #ifdef CONFIG_OF around of_match_table in mainline, and the patch to remove it is in my next branch. I'm okay with taking it through my tree if Dmitry agrees.

g.

Quoted 21 lines
drivers/input/serio/altera_ps2.c +1 -2
 	},
 };
 
@@ -189,13 +197,12 @@ static int __init altera_ps2_init(void)
 {
 	return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
 	platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
Signature · 1 line
1.7.3.4
#11 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

Quoted 27 lines · Grant Likely
Quoted 26 lines · Thomas Chou

From: Walter Goossens <[email protected]>

---
v2 use const and add compat version.

 drivers/input/serio/altera_ps2.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
drivers/input/serio/altera_ps2.c +1 -0
index 7998560..63325ee 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +174,12 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
      return 0;
 }
 
Quoted 7 lines

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+     { .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Oh, and this patch should add documentation to Documentation/devicetree/bindings/spi specifying exactly what device this compatible string represents and what properties are expected to be in the node (if any) beyond the standard reg, interrupts, etc. It doesn't need to be huge and detailed, but it at least needs to show that the string is in use. This comment goes for the other patches that add bindings too.

g.

#12 lore raw

PATCH v3 1/1 altera_ps2: Add devicetree support

---
v2 use const and add compat version.
v3 change compatible vendor to ALTR.
add dts binding doc.

 .../devicetree/bindings/serio/altera_ps2.txt       |    4 ++++
 drivers/input/serio/altera_ps2.c                   |   11 +++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serio/altera_ps2.txt
Documentation/devicetree/bindings/serio/altera_ps2.txt new file +4 -0
new file mode 100644
index 0000000..4d9eecc
@@ -0,0 +1,4 @@
+Altera UP PS/2 controller
+
+Required properties:
+- compatible : should be "ALTR,ps2-1.0".
drivers/input/serio/altera_ps2.c +9 -2
index 7998560..d94b4a3 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +174,12 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "ALTR,ps2-1.0", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+
 /*
  * Our device driver structure
  */
@@ -182,6 +189,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,
 	},
 };
 
@@ -189,13 +197,12 @@ static int __init altera_ps2_init(void)
 {
 	return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
 	platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
Signature · 1 line
1.7.3.5
#13 lore raw

Re: [PATCH v3] altera_ps2: Add devicetree support

Quoted 35 lines · Thomas Chou

---
v2 use const and add compat version.
v3 change compatible vendor to ALTR.
add dts binding doc.

 .../devicetree/bindings/serio/altera_ps2.txt       |    4 ++++
 drivers/input/serio/altera_ps2.c                   |   11 +++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serio/altera_ps2.txt
Documentation/devicetree/bindings/serio/altera_ps2.txt new file +4 -0
new file mode 100644
index 0000000..4d9eecc
@@ -0,0 +1,4 @@
+Altera UP PS/2 controller
+
+Required properties:
+- compatible : should be "ALTR,ps2-1.0".
drivers/input/serio/altera_ps2.c +1 -0
index 7998560..d94b4a3 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 182

Quoted 9 lines
drivers/input/serio/altera_ps2.c +6 -0
@@ -173,6 +174,12 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "ALTR,ps2-1.0", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+

Should be:

#ifdef CONFIG_OF

static const struct of_device_id altera_ps2_match[] = {
	{ .compatible = "ALTR,ps2-1.0", },
	{},
}

MODULE_DEVICE_TABLE(of, altera_ps2_match);
#else /* CONFIG_OF */
#define altera_ps2_match NULL
#endif /* CONFIG_OF */

Otherwise the driver will be advertising that it provides device tree support when CONFIG_OF is disabled.

Otherwise, looks good to me. Feel free to add my acked-by line.

g.

Quoted 29 lines
drivers/input/serio/altera_ps2.c +2 -2
 /*
  * Our device driver structure
  */
@@ -182,6 +189,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,
 	},
 };
 
@@ -189,13 +197,12 @@ static int __init altera_ps2_init(void)
 {
 	return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
 	platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
Signature · 1 line
1.7.3.5
#14 lore raw

Re: [PATCH v3] altera_ps2: Add devicetree support

Quoted 53 lines · Grant Likely
Quoted 35 lines · Thomas Chou

---
v2 use const and add compat version.
v3 change compatible vendor to ALTR.
add dts binding doc.

  .../devicetree/bindings/serio/altera_ps2.txt       |    4 ++++
  drivers/input/serio/altera_ps2.c                   |   11 +++++++++--
  2 files changed, 13 insertions(+), 2 deletions(-)

create mode 100644 Documentation/devicetree/bindings/serio/altera_ps2.txt

Documentation/devicetree/bindings/serio/altera_ps2.txt new file +4 -0
new file mode 100644
index 0000000..4d9eecc
@@ -0,0 +1,4 @@
+Altera UP PS/2 controller
+
+Required properties:
+- compatible : should be "ALTR,ps2-1.0".
drivers/input/serio/altera_ps2.c +1 -0
index 7998560..d94b4a3 100644
@@ -19,6 +19,7 @@
  #include<linux/platform_device.h>
  #include<linux/io.h>
  #include<linux/slab.h>
+#include<linux/of.h>
 
  #define DRV_NAME "altera_ps2"
 

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 182

Quoted 9 lines
drivers/input/serio/altera_ps2.c +6 -0
@@ -173,6 +174,12 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
  	return 0;
  }
 
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "ALTR,ps2-1.0", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+

Should be:

#ifdef CONFIG_OF

static const struct of_device_id altera_ps2_match[] = {
	{ .compatible = "ALTR,ps2-1.0", },
	{},
}
Quoted 7 lines

MODULE_DEVICE_TABLE(of, altera_ps2_match);
#else /* CONFIG_OF */
#define altera_ps2_match NULL
#endif /* CONFIG_OF */

Otherwise the driver will be advertising that it provides device tree support when CONFIG_OF is disabled.

Thanks. Will update all related drivers.

- Thomas

Quoted 35 lines

Otherwise, looks good to me. Feel free to add my acked-by line.

g.

Quoted 29 lines
drivers/input/serio/altera_ps2.c +2 -3
  /*
   * Our device driver structure
   */
@@ -182,6 +189,7 @@ static struct platform_driver altera_ps2_driver = {
  	.driver	= {
  		.name	= DRV_NAME,
  		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,
  	},
  };
 
@@ -189,13 +197,12 @@ static int __init altera_ps2_init(void)
  {
  	return platform_driver_register(&altera_ps2_driver);
  }
+module_init(altera_ps2_init);
 
  static void __exit altera_ps2_exit(void)
  {
  	platform_driver_unregister(&altera_ps2_driver);
  }
-
-module_init(altera_ps2_init);
  module_exit(altera_ps2_exit);
 
  MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
--

1.7.3.5

#15 lore raw

PATCH v4 1/1 altera_ps2: Add devicetree support

In reply to Grant Likely

From: Walter Goossens <[email protected]>

---
v2 use const and add compat version.
v3 change compatible vendor to ALTR.
add dts binding doc.
v4 condition module device table export for of.

Grant, please take it through your tree as Dmitry agreed.

 .../devicetree/bindings/serio/altera_ps2.txt       |    4 ++++
 drivers/input/serio/altera_ps2.c                   |   15 +++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serio/altera_ps2.txt
Documentation/devicetree/bindings/serio/altera_ps2.txt new file +4 -0
new file mode 100644
index 0000000..4d9eecc
@@ -0,0 +1,4 @@
+Altera UP PS/2 controller
+
+Required properties:
+- compatible : should be "ALTR,ps2-1.0".
drivers/input/serio/altera_ps2.c +13 -2
index 7998560..3fee88b 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +174,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "ALTR,ps2-1.0", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+#else /* CONFIG_OF */
+#define altera_ps2_match NULL
+#endif /* CONFIG_OF */
+
 /*
  * Our device driver structure
  */
@@ -182,6 +193,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,
 	},
 };
 
@@ -189,13 +201,12 @@ static int __init altera_ps2_init(void)
 {
 	return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
 	platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
Signature · 1 line
1.7.4
maintainer Acked-by on v4 1/1
#16 lore raw

Re: [PATCH v4] altera_ps2: Add devicetree support

Quoted 5 lines · Thomas Chou

From: Walter Goossens <[email protected]>

Quoted 7 lines

---
v2 use const and add compat version.
v3 change compatible vendor to ALTR.
add dts binding doc.
v4 condition module device table export for of.

Grant, please take it through your tree as Dmitry agreed.

*nod* Please.

Quoted 71 lines
 .../devicetree/bindings/serio/altera_ps2.txt       |    4 ++++
 drivers/input/serio/altera_ps2.c                   |   15 +++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serio/altera_ps2.txt
Documentation/devicetree/bindings/serio/altera_ps2.txt new file +4 -0
new file mode 100644
index 0000000..4d9eecc
@@ -0,0 +1,4 @@
+Altera UP PS/2 controller
+
+Required properties:
+- compatible : should be "ALTR,ps2-1.0".
drivers/input/serio/altera_ps2.c +13 -2
index 7998560..3fee88b 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +174,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "ALTR,ps2-1.0", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+#else /* CONFIG_OF */
+#define altera_ps2_match NULL
+#endif /* CONFIG_OF */
+
 /*
  * Our device driver structure
  */
@@ -182,6 +193,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,
 	},
 };
 
@@ -189,13 +201,12 @@ static int __init altera_ps2_init(void)
 {
 	return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
 	platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
Signature · 1 line
1.7.4
Signature · 1 line
Dmitry
Applied
#17 lore raw

Re: [PATCH v4] altera_ps2: Add devicetree support

In reply to Thomas Chou
Quoted 5 lines · Thomas Chou

From: Walter Goossens <[email protected]>

Merged, thanks,
g.

Quoted 78 lines

---
v2 use const and add compat version.
v3 change compatible vendor to ALTR.
add dts binding doc.
v4 condition module device table export for of.

Grant, please take it through your tree as Dmitry agreed.

 .../devicetree/bindings/serio/altera_ps2.txt       |    4 ++++
 drivers/input/serio/altera_ps2.c                   |   15 +++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serio/altera_ps2.txt
Documentation/devicetree/bindings/serio/altera_ps2.txt new file +4 -0
new file mode 100644
index 0000000..4d9eecc
@@ -0,0 +1,4 @@
+Altera UP PS/2 controller
+
+Required properties:
+- compatible : should be "ALTR,ps2-1.0".
drivers/input/serio/altera_ps2.c +13 -2
index 7998560..3fee88b 100644
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #define DRV_NAME "altera_ps2"
 
@@ -173,6 +174,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "ALTR,ps2-1.0", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, altera_ps2_match);
+#else /* CONFIG_OF */
+#define altera_ps2_match NULL
+#endif /* CONFIG_OF */
+
 /*
  * Our device driver structure
  */
@@ -182,6 +193,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,
 	},
 };
 
@@ -189,13 +201,12 @@ static int __init altera_ps2_init(void)
 {
 	return platform_driver_register(&altera_ps2_driver);
 }
+module_init(altera_ps2_init);
 
 static void __exit altera_ps2_exit(void)
 {
 	platform_driver_unregister(&altera_ps2_driver);
 }
-
-module_init(altera_ps2_init);
 module_exit(altera_ps2_exit);
 
 MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
Signature · 1 line
1.7.4
maintainer
#18 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

In reply to Grant Likely
Quoted 12 lines · Grant Likely

drivers/input/serio/altera_ps2.c static struct platform_driver altera_ps2_driver = { · line 192

Quoted 5 lines · Thomas Chou
drivers/input/serio/altera_ps2.c +1 -0
@@ -182,6 +189,7 @@ static struct platform_driver altera_ps2_driver = {
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = altera_ps2_match,

At the moment, this patch can only be applied against my devicetree/next branch since there is a #ifdef CONFIG_OF around of_match_table in mainline, and the patch to remove it is in my next branch. I'm okay with taking it through my tree if Dmitry agrees.

Actually I was going to ask you if you could do just that.

Thanks.

Signature · 1 line
Dmitry
#19 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

In reply to Grant Likely
Quoted 8 lines · Grant Likely

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

About the documentation on dts binding, shall we have a single altera.txt to describe all Altera related binding, and opencores.txt to describe all OpenCores binding? Or separate file for each core in its driver class?

- Thomas

#20 lore raw

Re: [Nios2-dev] [PATCH v2] altera_ps2: Add devicetree support

Quoted 10 lines · On Wed, 2 Feb 2011 19:48:58 +0800 Thomas Chou <[email protected]> wrote:
Quoted 8 lines · Grant Likely

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Quoted 7 lines

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

About the documentation on dts binding, shall we have a single altera.txt to describe all Altera related binding, and opencores.txt to describe all OpenCores binding? Or separate file for each core in its driver class?

As I will submit the device tree support for the altera_uart driver (and the altera_jtaguart driver sometime in the future) I was asking myself the same question. I'd vote for the altera.txt solution, as we could use that for documenting the uart drivers, other Altera component specific drivers and also the Nios2 arch specific parameters in the future.

Cheers
Tobias

#21 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

In reply to Thomas Chou
Quoted 10 lines · Thomas Chou
Quoted 8 lines · Grant Likely

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Quoted 7 lines

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

About the documentation on dts binding, shall we have a single altera.txt to describe all Altera related binding, and opencores.txt to describe all OpenCores binding? Or separate file for each core in its driver class?

Since I'm reorganizing the binding documentation to reflect subsystems (bindings/spi, bindings/i2c, bindings/powerpc, etc) I'd prefer to see a separate file for each type of core.

Eventually, I'd like to define a record format for documenting bindings that can generate searchable and crosslinked output, but I've not spent any time looking at that seriously yet.

g.

Quoted 2 lines

- Thomas

#22 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

Quoted 14 lines · Grant Likely
Quoted 13 lines · Thomas Chou
Quoted 8 lines · Grant Likely

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

Quoted 8 lines
Quoted 4 lines

About the documentation on dts binding, shall we have a single altera.txt to describe all Altera related binding, and opencores.txt to describe all OpenCores binding? Or separate file for each core in its driver class?

Since I'm reorganizing the binding documentation to reflect subsystems (bindings/spi, bindings/i2c, bindings/powerpc, etc) I'd prefer to see a separate file for each type of core.

OK. We will use separate files. I will send an updated patch to include the dts binding.

As for nios2 cpu related binding, we shall use binding/nios2 dir. Right?

- Thomas

Quoted 10 lines

Eventually, I'd like to define a record format for documenting bindings that can generate searchable and crosslinked output, but I've not spent any time looking at that seriously yet.

g.

Quoted 2 lines

- Thomas

#23 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

In reply to Thomas Chou
Quoted 10 lines · Thomas Chou
Quoted 8 lines · Grant Likely

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Quoted 2 lines

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

Is altr the stock ticker symbol? The convention is to either use the stock ticker in all uppercase (although the uppercase bit hasn't been consistently applied), or to use the full name in lowercase.

g.

#24 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

Quoted 11 lines · Grant Likely
Quoted 10 lines · Thomas Chou
Quoted 8 lines · Grant Likely

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Quoted 6 lines
Quoted 2 lines

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

Is altr the stock ticker symbol? The convention is to either use the stock ticker in all uppercase (although the uppercase bit hasn't been consistently applied), or to use the full name in lowercase.

Yes, it is the stock ticker symbol. Then we shall follow the convention, and change it to uppercase.

- Thomas

Quoted 4 lines

g.

#25 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

In reply to Grant Likely
Quoted 9 lines · Grant Likely
Quoted 8 lines · Thomas Chou
Quoted 7 lines · Grant Likely

drivers/input/serio/altera_ps2.c static int __devexit altera_ps2_remove(struct platform_device *pdev) · line 178

Quoted 2 lines
drivers/input/serio/altera_ps2.c +2 -0
+static const struct of_device_id altera_ps2_match[] = {
+	{ .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Quoted 9 lines
Quoted 2 lines

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

Is altr the stock ticker symbol? The convention is to either use the stock ticker in all uppercase (although the uppercase bit hasn't been consistently applied), or to use the full name in lowercase.

g.

Risking my limbs here by breaking in this late in the discussion... (I wasn't able to reply earlier) but where does it state it needs to be uppercase? I found a bunch of microblaze code which seems to use the lowercase xlnx and freescale seems happy with fsl. Unless I'm missing something obvious here I guess ALTR would actually be the first to use uppercase. The only reference to uppercase I found in the ePAPR docs was chapter 1.6 that talks about uppercase hex-characters as an OUI.
Not that I terribly mind either way, but I want to double-check before we go ahead and change all altera-related devicetree stuff to uppercase.

Greetz
Walter

#26 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

Quoted 19 lines · Walter Goossens
Quoted 9 lines · Grant Likely
Quoted 8 lines · Thomas Chou
Quoted 7 lines · Grant Likely
Quoted 2 lines

+static const struct of_device_id altera_ps2_match[] = {
+ { .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Quoted 9 lines
Quoted 2 lines

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

Is altr the stock ticker symbol? The convention is to either use the stock ticker in all uppercase (although the uppercase bit hasn't been consistently applied), or to use the full name in lowercase.

g.

Quoted 10 lines

Risking my limbs here by breaking in this late in the discussion... (I wasn't able to reply earlier) but where does it state it needs to be uppercase? I found a bunch of microblaze code which seems to use the lowercase xlnx and freescale seems happy with fsl. Unless I'm missing something obvious here I guess ALTR would actually be the first to use uppercase.
The only reference to uppercase I found in the ePAPR docs was chapter 1.6 that talks about uppercase hex-characters as an OUI.
Not that I terribly mind either way, but I want to double-check before we go ahead and change all altera-related devicetree stuff to uppercase.

The relevant text in IEEE 1275-1994 is in the description of the "name" property in Annex A. If a node name begins with a sequence of from one to five uppercase letters followed by a comma, that means a stock symbol on some exchange whose names do not conflict with NYSE or NASDAQ.

A lower-case prefix is okay, but it does not necessarily mean that it is a ticker symbol. So in some sense, a lower case prefix provides less protection against collisions than an upper case prefix, which comes from an externally-arbitrated name space. Case is explicitly significant in node names.

In practice, the important thing is that names must not conflict. Name collisions haven't been much of a problem so far.

Quoted 10 lines

Greetz
Walter

_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

#27 lore raw

Re: [PATCH v2] altera_ps2: Add devicetree support

Quoted 32 lines · Mitch Bradley
Quoted 19 lines · Walter Goossens
Quoted 9 lines · Grant Likely
Quoted 8 lines · Thomas Chou
Quoted 7 lines · Grant Likely
Quoted 2 lines

+static const struct of_device_id altera_ps2_match[] = {
+ { .compatible = "altr,ps2-1.0", },

I thought I had seen 'altera' instead of an abbreviation being used in a previous patch. I don't care much whether 'altr' or 'altera' is used, but I'd like to know that there is consensus from the Altera users so that all the drivers use the same prefix.

Quoted 9 lines
Quoted 2 lines

We had discussed on nios2-dev mailing list, and decided to use 'altr' as Walter suggested that it saves space.

Is altr the stock ticker symbol? The convention is to either use the stock ticker in all uppercase (although the uppercase bit hasn't been consistently applied), or to use the full name in lowercase.

g.

Quoted 10 lines

Risking my limbs here by breaking in this late in the discussion... (I wasn't able to reply earlier) but where does it state it needs to be uppercase? I found a bunch of microblaze code which seems to use the lowercase xlnx and freescale seems happy with fsl. Unless I'm missing something obvious here I guess ALTR would actually be the first to use uppercase.
The only reference to uppercase I found in the ePAPR docs was chapter 1.6 that talks about uppercase hex-characters as an OUI.
Not that I terribly mind either way, but I want to double-check before we go ahead and change all altera-related devicetree stuff to uppercase.

Quoted 6 lines

The relevant text in IEEE 1275-1994 is in the description of the "name" property in Annex A. If a node name begins with a sequence of from one to five uppercase letters followed by a comma, that means a stock symbol on some exchange whose names do not conflict with NYSE or NASDAQ.

A lower-case prefix is okay, but it does not necessarily mean that it is a ticker symbol. So in some sense, a lower case prefix provides less protection against collisions than an upper case prefix, which comes from an externally-arbitrated name space. Case is explicitly significant in node names.

In practice, the important thing is that names must not conflict. Name collisions haven't been much of a problem so far.

Excellent!
Must have missed that one. Good reason. We'll change 'm!

Thanks
Walter

Quoted 11 lines
Quoted 10 lines

Greetz
Walter

_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss