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: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/f4d02ac8-23ee-d891-4056-75c672cc59c9@axentia.se
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Aswath Govindraju 2022-01-02 23:38:18 +01:00 committed by Greg Kroah-Hartman
parent 04ce4a6b9b
commit 8f2cade5da
3 changed files with 55 additions and 3 deletions

View File

@ -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
- "#mux-control-cells"
anyOf:
- required:
- "#mux-control-cells"
- required:
- "#mux-state-cells"
additionalProperties: false

View File

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

View File

@ -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>;
};
...