Skip to contentSkip to conversation

drm/tegra: Use standard suffix for hotplug detect GPIO property

PATCH In review Thierry Reding 5 participants 9 messages Apr 17, 2014 – Apr 22, 2014 3 messages not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover drm/tegra: Use standard suffix for hotplug detect GPIO property

From: Thierry Reding <[email protected]>

The hotplug detect GPIO in the current bindings use "-gpio" as suffix, whereas the standard suffix is the plural: "-gpios". This small series replaces this in three steps to preserve bisectability:

- Patch 1 adds new nvidia,hpd-gpios properties to existing device tree files while marking existing nvidia,hpd-gpio ones as deprecated.
- Patch 2 makes use of the new property name in the driver and updates the device tree bindings.
- Patch 3 removes the deprecated properties from device tree files.

Since this touches both DRM and Tegra trees, I've prepared a stable branch[0] that can be pulled into both trees to make the transition easier.

Thierry

[0]: git://anongit.freedesktop.org/tegra/linux#drm/tegra/hpd-gpios-property

Thierry Reding (3):
ARM: tegra: Deprecate nvidia,hpd-gpio property drm/tegra: Use nvidia,hpd-gpios property
ARM: tegra: Remove deprecated nvidia,hpd-gpio properties

 Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt | 8 ++++----
 arch/arm/boot/dts/tegra114-dalmore.dts                          | 2 +-
 arch/arm/boot/dts/tegra20-colibri-512.dtsi                      | 4 ++--
 arch/arm/boot/dts/tegra20-harmony.dts                           | 4 ++--
 arch/arm/boot/dts/tegra20-paz00.dts                             | 4 ++--
 arch/arm/boot/dts/tegra20-seaboard.dts                          | 4 ++--
 arch/arm/boot/dts/tegra20-tamonten.dtsi                         | 4 ++--
 arch/arm/boot/dts/tegra20-trimslice.dts                         | 4 ++--
 arch/arm/boot/dts/tegra20-ventana.dts                           | 4 ++--
 arch/arm/boot/dts/tegra20-whistler.dts                          | 4 ++--
 arch/arm/boot/dts/tegra30-beaver.dts                            | 2 +-
 drivers/gpu/drm/tegra/output.c                                  | 2 +-
 12 files changed, 23 insertions(+), 23 deletions(-)
Signature · 1 line
1.9.2
#1 lore raw

PATCH 1/3 ARM: tegra: Deprecate nvidia,hpd-gpio property

From: Thierry Reding <[email protected]>

Properties referencing GPIOs should use the plural suffix -gpios. This convention is encoded in the device tree backend of gpiod_get(), which we'll eventually want to migrate to.

Rename the property to nvidia,hpd-gpios but keep (and deprecate) the old name to preserve bisectability.

---
 arch/arm/boot/dts/tegra114-dalmore.dts     | 4 ++++
 arch/arm/boot/dts/tegra20-colibri-512.dtsi | 4 ++++
 arch/arm/boot/dts/tegra20-harmony.dts      | 4 ++++
 arch/arm/boot/dts/tegra20-paz00.dts        | 4 ++++
 arch/arm/boot/dts/tegra20-seaboard.dts     | 4 ++++
 arch/arm/boot/dts/tegra20-tamonten.dtsi    | 4 ++++
 arch/arm/boot/dts/tegra20-trimslice.dts    | 4 ++++
 arch/arm/boot/dts/tegra20-ventana.dts      | 4 ++++
 arch/arm/boot/dts/tegra20-whistler.dts     | 4 ++++
 arch/arm/boot/dts/tegra30-beaver.dts       | 6 +++++-
 10 files changed, 41 insertions(+), 1 deletion(-)
arch/arm/boot/dts/tegra114-dalmore.dts +4 -0
index a288a12823ed..c1e5eb33847a 100644
@@ -29,6 +29,10 @@
 			pll-supply = <&palmas_smps3_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-colibri-512.dtsi +4 -0
index 8e0066ad9628..57b9b0d08123 100644
@@ -19,6 +19,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&i2c_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-harmony.dts +4 -0
index 3fb1f50f6d46..f62fe7059bca 100644
@@ -32,6 +32,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-paz00.dts +4 -0
index 9a39a8001f78..196578fd007a 100644
@@ -32,6 +32,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-seaboard.dts +4 -0
index a1d4bf9895d7..7a69d5f4f55d 100644
@@ -32,6 +32,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-tamonten.dtsi +4 -0
index a1b0d965757f..af582f8fd636 100644
@@ -19,6 +19,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-trimslice.dts +4 -0
index 216fa6d50c65..4ab1eea59efe 100644
@@ -24,6 +24,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-ventana.dts +4 -0
index ca8484cccddc..663fbf4f8b63 100644
@@ -32,6 +32,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra20-whistler.dts +4 -0
index 1843725785c9..9b5948f0cbc6 100644
@@ -24,6 +24,10 @@
 			pll-supply = <&hdmi_pll_reg>;
 
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpios =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+
+			/* deprecated */
 			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
 				GPIO_ACTIVE_HIGH>;
 		};
arch/arm/boot/dts/tegra30-beaver.dts +5 -1
index e93fe45b7803..e99b9967b2ca 100644
@@ -43,9 +43,13 @@
 			vdd-supply = <&sys_3v3_reg>;
 			pll-supply = <&vio_reg>;
 
-			nvidia,hpd-gpio =
+			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
 			nvidia,ddc-i2c-bus = <&hdmiddc>;
+
+			/* deprecated */
+			nvidia,hpd-gpio =
+				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
 		};
 	};
 
Signature · 1 line
1.9.2
#7 lore raw

PATCH 2/3 drm/tegra: Use nvidia,hpd-gpios property

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

Make use of the new nvidia,hpd-gpios property and remove support for the deprecated nvidia,hpd-gpio property.

---
 Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt | 8 ++++----
 drivers/gpu/drm/tegra/output.c                                  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt +4 -4
index efa8b8451f93..81cdc7f4f5b1 100644
@@ -126,7 +126,7 @@ of the following host1x client modules:
   the RGB output associated with the controller. It can take the following
   optional properties:
   - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
-  - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection
+  - nvidia,hpd-gpios: specifies a GPIO used for hotplug detection
   - nvidia,edid: supplies a binary EDID blob
   - nvidia,panel: phandle of a display panel
 
@@ -151,7 +151,7 @@ of the following host1x client modules:
 
   Optional properties:
   - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
-  - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection
+  - nvidia,hpd-gpios: specifies a GPIO used for hotplug detection
   - nvidia,edid: supplies a binary EDID blob
   - nvidia,panel: phandle of a display panel
 
@@ -186,7 +186,7 @@ of the following host1x client modules:
 
   Optional properties:
   - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
-  - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection
+  - nvidia,hpd-gpios: specifies a GPIO used for hotplug detection
   - nvidia,edid: supplies a binary EDID blob
   - nvidia,panel: phandle of a display panel
 
@@ -210,7 +210,7 @@ of the following host1x client modules:
 
   Optional properties:
   - nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
-  - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection
+  - nvidia,hpd-gpios: specifies a GPIO used for hotplug detection
   - nvidia,edid: supplies a binary EDID blob
   - nvidia,panel: phandle of a display panel
 
drivers/gpu/drm/tegra/output.c +1 -1
index a3e4f1eca6f7..e8f50d57c95d 100644
@@ -223,7 +223,7 @@ int tegra_output_probe(struct tegra_output *output)
 	}
 
 	output->hpd_gpio = of_get_named_gpio_flags(output->of_node,
-						   "nvidia,hpd-gpio", 0,
+						   "nvidia,hpd-gpios", 0,
 						   &flags);
 	if (gpio_is_valid(output->hpd_gpio)) {
 		unsigned long flags;
Signature · 1 line
1.9.2
#9 lore raw

PATCH 3/3 ARM: tegra: Remove deprecated nvidia,hpd-gpio properties

In reply to a message not in the archive

From: Thierry Reding <[email protected]>

This property has been replaced by one with a more standard name (nvidia,hpd-gpios) and is now obsolete.

---
 arch/arm/boot/dts/tegra114-dalmore.dts     | 4 ----
 arch/arm/boot/dts/tegra20-colibri-512.dtsi | 4 ----
 arch/arm/boot/dts/tegra20-harmony.dts      | 4 ----
 arch/arm/boot/dts/tegra20-paz00.dts        | 4 ----
 arch/arm/boot/dts/tegra20-seaboard.dts     | 4 ----
 arch/arm/boot/dts/tegra20-tamonten.dtsi    | 4 ----
 arch/arm/boot/dts/tegra20-trimslice.dts    | 4 ----
 arch/arm/boot/dts/tegra20-ventana.dts      | 4 ----
 arch/arm/boot/dts/tegra20-whistler.dts     | 4 ----
 arch/arm/boot/dts/tegra30-beaver.dts       | 4 ----
 10 files changed, 40 deletions(-)
arch/arm/boot/dts/tegra114-dalmore.dts +0 -4
index c1e5eb33847a..df22dfad7db7 100644
@@ -31,10 +31,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio =
-				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
 		};
 
 		dsi@54300000 {
arch/arm/boot/dts/tegra20-colibri-512.dtsi +0 -4
index 57b9b0d08123..7ab61aef11e0 100644
@@ -21,10 +21,6 @@
 			nvidia,ddc-i2c-bus = <&i2c_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra20-harmony.dts +0 -4
index f62fe7059bca..650daf16c37b 100644
@@ -34,10 +34,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra20-paz00.dts +0 -4
index 196578fd007a..80f1827b219c 100644
@@ -34,10 +34,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra20-seaboard.dts +0 -4
index 7a69d5f4f55d..aa97216a2683 100644
@@ -34,10 +34,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra20-tamonten.dtsi +0 -4
index af582f8fd636..72f07a20aec3 100644
@@ -21,10 +21,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra20-trimslice.dts +0 -4
index 4ab1eea59efe..2affa75c0803 100644
@@ -26,10 +26,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra20-ventana.dts +0 -4
index 663fbf4f8b63..b66045b53357 100644
@@ -34,10 +34,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra20-whistler.dts +0 -4
index 9b5948f0cbc6..b0ecff2f71cc 100644
@@ -26,10 +26,6 @@
 			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
-
-			/* deprecated */
-			nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
-				GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/tegra30-beaver.dts +0 -4
index e99b9967b2ca..e7a9da968f3b 100644
@@ -46,10 +46,6 @@
 			nvidia,hpd-gpios =
 				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
 			nvidia,ddc-i2c-bus = <&hdmiddc>;
-
-			/* deprecated */
-			nvidia,hpd-gpio =
-				<&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
 		};
 	};
 
Signature · 1 line
1.9.2
#10 lore raw
In reply to a message not in the archive

Am Donnerstag, den 17.04.2014, 14:02 +0200 schrieb Thierry Reding:

Quoted 12 lines

From: Thierry Reding <[email protected]>

The hotplug detect GPIO in the current bindings use "-gpio" as suffix, whereas the standard suffix is the plural: "-gpios". This small series replaces this in three steps to preserve bisectability:

- Patch 1 adds new nvidia,hpd-gpios properties to existing device tree files while marking existing nvidia,hpd-gpio ones as deprecated.
- Patch 2 makes use of the new property name in the driver and updates the device tree bindings.
- Patch 3 removes the deprecated properties from device tree files.

Quoted 4 lines

Since this touches both DRM and Tegra trees, I've prepared a stable branch[0] that can be pulled into both trees to make the transition easier.

What's the real benefit to this series? After all you are breaking existing devicetrees here, as the driver doesn't continue to recognize the old name. IMHO adding a missed 's' to the property name isn't enough reason to do this.

Regards,
Lucas

#11 lore raw
Quoted 13 lines · Lucas Stach

Am Donnerstag, den 17.04.2014, 14:02 +0200 schrieb Thierry Reding:

Quoted 12 lines

From: Thierry Reding <[email protected]>

The hotplug detect GPIO in the current bindings use "-gpio" as suffix, whereas the standard suffix is the plural: "-gpios". This small series replaces this in three steps to preserve bisectability:

- Patch 1 adds new nvidia,hpd-gpios properties to existing device tree files while marking existing nvidia,hpd-gpio ones as deprecated.
- Patch 2 makes use of the new property name in the driver and updates the device tree bindings.
- Patch 3 removes the deprecated properties from device tree files.

Quoted 8 lines
Quoted 4 lines

Since this touches both DRM and Tegra trees, I've prepared a stable branch[0] that can be pulled into both trees to make the transition easier.

What's the real benefit to this series? After all you are breaking existing devicetrees here, as the driver doesn't continue to recognize the old name. IMHO adding a missed 's' to the property name isn't enough reason to do this.

The series is explicitly done in a way to ensure that at least in-tree device trees will keep working across the whole series. Obviously if anybody were to use a DTB written according to the deprecated binding that would no longer work.

However I'd like to eventually convert the driver to use the new GPIO descriptor helpers because they make it a lot easier to deal with the GPIOs. And with the new gpiod_get() function you loose the ability to specify an exact property name as it appends the -gpios suffix automatically.

The idea is to rectify this mistake now that there's still a manageable number of boards in the tree and we have never really supported stable devicetree bindings on Tegra anyway. Or to put it differently, there is not enough functionality on Tegra generally to make it practicable to use it in production. Therefore I think it makes sense to fix these issues while it's still a viable option.

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH 1/3] ARM: tegra: Deprecate nvidia,hpd-gpio property

In reply to a message not in the archive
Quoted 5 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Properties referencing GPIOs should use the plural suffix -gpios. This convention is encoded in the device tree backend of gpiod_get(), which we'll eventually want to migrate to.

Wouldn't it be simpler to fix the GPIO binding documentation and gpiod_get() code to allow the -gpio suffix in addition to -gpios? It always struck me as silly that the binding required a plural property name when only a single entry made sense.

(For something like "clocks", since the property name applies to any clock, and there certainly can be many clocks, a plural property name makes sense. However, since each type of GPIO is "foo-gpios" rather than an "foo" entry in "gpios", that same argument doesn't apply, and a singular property name seems much more correct).

#5 lore raw

Re: [PATCH 1/3] ARM: tegra: Deprecate nvidia,hpd-gpio property

In reply to a message not in the archive
Quoted 12 lines · Stephen Warren
Quoted 5 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Properties referencing GPIOs should use the plural suffix -gpios. This convention is encoded in the device tree backend of gpiod_get(), which we'll eventually want to migrate to.

Wouldn't it be simpler to fix the GPIO binding documentation and gpiod_get() code to allow the -gpio suffix in addition to -gpios? It always struck me as silly that the binding required a plural property name when only a single entry made sense.

Quoted 5 lines

(For something like "clocks", since the property name applies to any clock, and there certainly can be many clocks, a plural property name makes sense. However, since each type of GPIO is "foo-gpios" rather than an "foo" entry in "gpios", that same argument doesn't apply, and a singular property name seems much more correct).

Yeah, it's somewhat unfortunate that this is done inconsistently across different subsystems. GPIO isn't the only exception here. Regulators use a similar pattern.

For consistency it'd be nice if we could get everyone to agree to one scheme, but I suspect that by now we're far beyond that being a viable option.

I don't have a strong feeling either way, so if allowing both *-gpios and *-gpio properties is what we want, then I can certainly come up with a patch.

Thierry

#6 lore raw

Re: [PATCH 1/3] ARM: tegra: Deprecate nvidia,hpd-gpio property

Am Dienstag, den 22.04.2014, 09:23 +0200 schrieb Thierry Reding:

Quoted 23 lines · Stephen Warren
Quoted 12 lines · Thierry Reding
Quoted 5 lines

From: Thierry Reding <[email protected]>

Properties referencing GPIOs should use the plural suffix -gpios. This convention is encoded in the device tree backend of gpiod_get(), which we'll eventually want to migrate to.

Wouldn't it be simpler to fix the GPIO binding documentation and gpiod_get() code to allow the -gpio suffix in addition to -gpios? It always struck me as silly that the binding required a plural property name when only a single entry made sense.

Quoted 5 lines

(For something like "clocks", since the property name applies to any clock, and there certainly can be many clocks, a plural property name makes sense. However, since each type of GPIO is "foo-gpios" rather than an "foo" entry in "gpios", that same argument doesn't apply, and a singular property name seems much more correct).

Yeah, it's somewhat unfortunate that this is done inconsistently across different subsystems. GPIO isn't the only exception here. Regulators use a similar pattern.

Quoted 8 lines

For consistency it'd be nice if we could get everyone to agree to one scheme, but I suspect that by now we're far beyond that being a viable option.

I don't have a strong feeling either way, so if allowing both *-gpios and *-gpio properties is what we want, then I can certainly come up with a patch.

I agree with Stephen, allowing the singular form in the property name seems like a nicer solution (it makes for a less irritating property name), without the need to break existing DTs.

Regards,
Lucas

Signature · 2 lines
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |