Commit 8f2cade5 authored by Aswath Govindraju's avatar Aswath Govindraju Committed by Greg Kroah-Hartman
Browse files

dt-bindings: mux: Document mux-states property



In some cases, it is required to provide the state to which the mux
controller has to be set to, from the consumer device tree node. Document
the property mux-states that can be used for adding this support.

Signed-off-by: default avatarAswath Govindraju <a-govindraju@ti.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/f4d02ac8-23ee-d891-4056-75c672cc59c9@axentia.se


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04ce4a6b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -26,7 +26,10 @@ properties:
      List of gpios used to control the multiplexer, least significant bit first.

  '#mux-control-cells':
    const: 0
    enum: [ 0, 1 ]

  '#mux-state-cells':
    enum: [ 1, 2 ]

  idle-state:
    default: -1
@@ -34,7 +37,11 @@ properties:
required:
  - compatible
  - mux-gpios
anyOf:
  - required:
      - "#mux-control-cells"
  - required:
      - "#mux-state-cells"

additionalProperties: false

+21 −0
Original line number Diff line number Diff line
@@ -25,6 +25,17 @@ description: |
  strings to label each of the mux controllers listed in the "mux-controls"
  property.

  If it is required to provide the state that the mux controller needs to
  be set to, the property "mux-states" must be used. An optional property
  "mux-state-names" can be used to provide a list of strings, to label
  each of the multiplixer states listed in the "mux-states" property.

  Properties "mux-controls" and "mux-states" can be used depending on how
  the consumers want to control the mux controller. If the consumer needs
  needs to set multiple states in a mux controller, then property
  "mux-controls" can be used. If the consumer needs to set the mux
  controller to a given state then property "mux-states" can be used.

  mux-ctrl-specifier typically encodes the chip-relative mux controller number.
  If the mux controller chip only provides a single mux controller, the
  mux-ctrl-specifier can typically be left out.
@@ -35,12 +46,22 @@ properties:
  mux-controls:
    $ref: /schemas/types.yaml#/definitions/phandle-array

  mux-states:
    $ref: /schemas/types.yaml#/definitions/phandle-array

  mux-control-names:
    description:
      Devices that use more than a single mux controller can use the
      "mux-control-names" property to map the name of the requested mux
      controller to an index into the list given by the "mux-controls" property.

  mux-state-names:
    description:
      Devices that use more than a single multiplexer state can use the
      "mux-state-names" property to map the name of the requested mux
      controller to an index into the list given by the "mux-states"
      property.

additionalProperties: true

...
+25 −1
Original line number Diff line number Diff line
@@ -25,7 +25,9 @@ description: |
  --------------------

  Mux controller nodes must specify the number of cells used for the
  specifier using the '#mux-control-cells' property.
  specifier using the '#mux-control-cells' or '#mux-state-cells' property.
  The value of '#mux-state-cells' will always be one greater than the value
  of '#mux-control-cells'.

  Optionally, mux controller nodes can also specify the state the mux should
  have when it is idle. The idle-state property is used for this. If the
@@ -67,6 +69,8 @@ select:
          pattern: '^mux-controller'
    - required:
        - '#mux-control-cells'
    - required:
        - '#mux-state-cells'

properties:
  $nodename:
@@ -75,6 +79,9 @@ properties:
  '#mux-control-cells':
    enum: [ 0, 1 ]

  '#mux-state-cells':
    enum: [ 1, 2 ]

  idle-state:
    $ref: /schemas/types.yaml#/definitions/int32
    minimum: -2
@@ -179,4 +186,21 @@ examples:
            };
        };
    };

  - |
    #include <dt-bindings/gpio/gpio.h>

    mux1: mux-controller {
        compatible = "gpio-mux";
        #mux-state-cells = <1>;
        mux-gpios = <&exp_som 2 GPIO_ACTIVE_HIGH>;
    };

    transceiver4: can-phy4 {
        compatible = "ti,tcan1042";
        #phy-cells = <0>;
        max-bitrate = <5000000>;
        standby-gpios = <&exp_som 7 GPIO_ACTIVE_HIGH>;
        mux-states = <&mux1 1>;
    };
...