diff mbox

dt/bindings: add documentation on standard property unit suffixes

Message ID 1454951044-18223-1-git-send-email-robh@kernel.org
State Accepted
Commit bde7fabad93ddea8fbefa8da90a4142801b03d37
Headers show

Commit Message

Rob Herring Feb. 8, 2016, 5:04 p.m. UTC
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.

Signed-off-by: Rob Herring <robh@kernel.org>

Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
---
 .../devicetree/bindings/property-units.txt         | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/property-units.txt

-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Mark Rutland Feb. 8, 2016, 5:08 p.m. UTC | #1
On Mon, Feb 08, 2016 at 11:04:04AM -0600, Rob Herring wrote:
> 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:

Acked-by: Mark Rutland <mark.rutland@arm.com>


Mark.

> Signed-off-by: Rob Herring <robh@kernel.org>

> Cc: Pawel Moll <pawel.moll@arm.com>

> Cc: Mark Rutland <mark.rutland@arm.com>

> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>

> Cc: Kumar Gala <galak@codeaurora.org>

> ---

>  .../devicetree/bindings/property-units.txt         | 35 ++++++++++++++++++++++

>  1 file changed, 35 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/property-units.txt

> 

> diff --git a/Documentation/devicetree/bindings/property-units.txt b/Documentation/devicetree/bindings/property-units.txt

> new file mode 100644

> index 0000000..f8231ed

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/property-units.txt

> @@ -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

> -- 

> 2.5.0

> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring Feb. 12, 2016, 10:05 p.m. UTC | #2
On Mon, Feb 8, 2016 at 11:04 AM, Rob Herring <robh@kernel.org> wrote:
> 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.

>

> Signed-off-by: Rob Herring <robh@kernel.org>

> Cc: Pawel Moll <pawel.moll@arm.com>

> Cc: Mark Rutland <mark.rutland@arm.com>

> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>

> Cc: Kumar Gala <galak@codeaurora.org>

> ---

>  .../devicetree/bindings/property-units.txt         | 35 ++++++++++++++++++++++

>  1 file changed, 35 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/property-units.txt

>

> diff --git a/Documentation/devicetree/bindings/property-units.txt b/Documentation/devicetree/bindings/property-units.txt

> new file mode 100644

> index 0000000..f8231ed

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/property-units.txt

> @@ -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


Adding one more here:

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

> +

> +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

>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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/property-units.txt b/Documentation/devicetree/bindings/property-units.txt
new file mode 100644
index 0000000..f8231ed
--- /dev/null
+++ b/Documentation/devicetree/bindings/property-units.txt
@@ -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