Skip to contentSkip to conversation

dt/bindings: add documentation on standard property unit suffixes

PATCH In review Rob Herring 2 participants 3 messages Feb 8, 2016 – Feb 12, 2016 1 message not in the archive Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt/bindings: add documentation on standard property unit suffixes

A common review comment is to add units to DT property names. The naming convention is inconsistent unfortunately although there are clear majorities in use already. This makes it hard to remember the exact name preferred, so I'm documenting this to provide an easy point of reference.

Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Kumar Gala <[email protected]>
---
 .../devicetree/bindings/property-units.txt         | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/property-units.txt
Documentation/devicetree/bindings/property-units.txt new file +35 -0
new file mode 100644
index 0000000..f8231ed
@@ -0,0 +1,35 @@
+Standard Unit Suffixes for Property names
+
+Properties which have a unit of measure are recommended to have a unit
+suffix appended to the property name. The list below contains the
+recommended suffixes. Other variations exist in bindings, but should not
+be used in new bindings or added here. The inconsistency in the unit
+prefixes is due to selecting the most commonly used variants.
+
+It is also recommended to use the units listed here and not add additional
+unit prefixes.
+
+Time/Frequency
+----------------------------------------
+-mhz		: megahertz
+-hz		: Hertz (preferred)
+-sec		: seconds
+-ms		: milliseconds
+-us		: microseconds
+-ns		: nanoseconds
+
+Electricity
+----------------------------------------
+-microamp	: micro amps
+-ohms		: Ohms
+-micro-ohms	: micro Ohms
+-microvolt	: micro volts
+
+Temperature
+----------------------------------------
+-celsius	: Degrees Celsius
+-millicelsius	: Degreee milli-Celsius
+
+Pressure
+----------------------------------------
+-kpascal	: kiloPascal
Signature · 1 line
2.5.0

A message that is not in the archive (sent off-list or not yet received): 1454951044-18223-1-git-send-email-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Acked-by
#2 lore raw
Quoted 5 lines · Rob Herring

A common review comment is to add units to DT property names. The naming convention is inconsistent unfortunately although there are clear majorities in use already. This makes it hard to remember the exact name preferred, so I'm documenting this to provide an easy point of reference.

This looks good to me. FWIW:

Mark.

Quoted 54 lines
Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Kumar Gala <[email protected]>
---
 .../devicetree/bindings/property-units.txt         | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/property-units.txt
Documentation/devicetree/bindings/property-units.txt new file +35 -0
new file mode 100644
index 0000000..f8231ed
@@ -0,0 +1,35 @@
+Standard Unit Suffixes for Property names
+
+Properties which have a unit of measure are recommended to have a unit
+suffix appended to the property name. The list below contains the
+recommended suffixes. Other variations exist in bindings, but should not
+be used in new bindings or added here. The inconsistency in the unit
+prefixes is due to selecting the most commonly used variants.
+
+It is also recommended to use the units listed here and not add additional
+unit prefixes.
+
+Time/Frequency
+----------------------------------------
+-mhz		: megahertz
+-hz		: Hertz (preferred)
+-sec		: seconds
+-ms		: milliseconds
+-us		: microseconds
+-ns		: nanoseconds
+
+Electricity
+----------------------------------------
+-microamp	: micro amps
+-ohms		: Ohms
+-micro-ohms	: micro Ohms
+-microvolt	: micro volts
+
+Temperature
+----------------------------------------
+-celsius	: Degrees Celsius
+-millicelsius	: Degreee milli-Celsius
+
+Pressure
+----------------------------------------
+-kpascal	: kiloPascal
Signature · 1 line
2.5.0
#3 lore raw
In reply to a message not in the archive
Quoted 31 lines · Rob Herring

A common review comment is to add units to DT property names. The naming convention is inconsistent unfortunately although there are clear majorities in use already. This makes it hard to remember the exact name preferred, so I'm documenting this to provide an easy point of reference.

Cc Pawel Moll <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Kumar Gala <[email protected]>
---
 .../devicetree/bindings/property-units.txt         | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/property-units.txt
Documentation/devicetree/bindings/property-units.txt new file +9 -0
new file mode 100644
index 0000000..f8231ed
@@ -0,0 +1,35 @@
+Standard Unit Suffixes for Property names
+
+Properties which have a unit of measure are recommended to have a unit
+suffix appended to the property name. The list below contains the
+recommended suffixes. Other variations exist in bindings, but should not
+be used in new bindings or added here. The inconsistency in the unit
+prefixes is due to selecting the most commonly used variants.
+
+It is also recommended to use the units listed here and not add additional

Documentation/devicetree/bindings/property-units.txt line 19

Quoted 10 lines
Documentation/devicetree/bindings/property-units.txt new file +10 -0
+unit prefixes.
+
+Time/Frequency
+----------------------------------------
+-mhz           : megahertz
+-hz            : Hertz (preferred)
+-sec           : seconds
+-ms            : milliseconds
+-us            : microseconds
+-ns            : nanoseconds

Adding one more here:

Distance
----------------------------------
-mm : millimeters

Quoted 19 lines
Documentation/devicetree/bindings/property-units.txt new file +16 -1
+
+Electricity
+----------------------------------------
+-microamp      : micro amps
+-ohms          : Ohms
+-micro-ohms    : micro Ohms
+-microvolt     : micro volts
+
+Temperature
+----------------------------------------
+-celsius       : Degrees Celsius
+-millicelsius  : Degreee milli-Celsius
+
+Pressure
+----------------------------------------
+-kpascal       : kiloPascal
--

2.5.0