linux/linux-5.4.31/Documentation/devicetree/bindings/hwlock/hwlock.txt

72 lines
2.4 KiB
Plaintext

Generic hwlock bindings
=======================
Generic bindings that are common to all the hwlock platform specific driver
implementations.
Please also look through the individual platform specific hwlock binding
documentations for identifying any additional properties specific to that
platform.
hwlock providers:
=================
Required properties:
- #hwlock-cells: Specifies the number of cells needed to represent a
specific lock. Shall be 1 or 2 (see hwlocks below).
hwlock users:
=============
Consumers that require specific hwlock(s) should specify them using the
property "hwlocks", and an optional "hwlock-names" property.
Required properties:
- hwlocks: List of phandle to a hwlock provider node and an
associated hwlock args specifier as indicated by
#hwlock-cells. The list can have just a single hwlock
or multiple hwlocks, with each hwlock represented by
a phandle and a corresponding args specifier.
If #hwlock-cells is 1, all of the locks are exclusive
(cannot be used by several users).
If #hwlock-cells is 2, the value of the second cell
defines whether the lock is for exclusive usage (0) or
shared (1) i.e. can be used by several users.
Optional properties:
- hwlock-names: List of hwlock name strings defined in the same order
as the hwlocks, with one name per hwlock. Consumers can
use the hwlock-names to match and get a specific hwlock.
1. Example of a node using a single specific hwlock:
The following example has a node requesting a hwlock in the bank defined by
the node hwlock1. hwlock1 is a hwlock provider with an argument specifier
of length 1.
node {
...
hwlocks = <&hwlock1 2>;
...
};
2. Example of nodes using multiple and shared specific hwlocks:
The following example has a nodeA requesting two hwlocks:
- an exclusive one (#hwlock-cells = 1) within the hwlock device node 'hwlock1'
- a shared one (#hwlock-cells = 2, second cell = 1) within the hwlock device
node 'hwlock2'.
The shared lock is also be used by nodeB.
nodeA {
...
hwlocks = <&hwlock1 2>, <&hwlock2 0 1>;
...
};
nodeB {
...
hwlocks = <&hwlock2 0 1>;
...
};