aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/driver-api
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2018-03-20 08:57:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-22 08:10:29 -0400
commitf2d9b66d84f3ff5ea3aff111e6a403e04fa8bf37 (patch)
treefa1d83bf1777d68f0bb53305d0f941c5886775f1 /Documentation/driver-api
parent2699126bcf18db672451b82b26a1c8e954784fad (diff)
drivers: base: Unified device connection lookup
Several frameworks - clk, gpio, phy, pmw, etc. - maintain lookup tables for describing connections and provide custom API for handling them. This introduces a single generic lookup table and API for the connections. The motivation for this commit is centralizing the connection lookup, but the goal is to ultimately extract the connection descriptions also from firmware by using the fwnode_graph_* functions and other mechanisms that are available. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/driver-api')
-rw-r--r--Documentation/driver-api/device_connection.rst43
1 files changed, 43 insertions, 0 deletions
diff --git a/Documentation/driver-api/device_connection.rst b/Documentation/driver-api/device_connection.rst
new file mode 100644
index 000000000000..affbc5566ab0
--- /dev/null
+++ b/Documentation/driver-api/device_connection.rst
@@ -0,0 +1,43 @@
1==================
2Device connections
3==================
4
5Introduction
6------------
7
8Devices often have connections to other devices that are outside of the direct
9child/parent relationship. A serial or network communication controller, which
10could be a PCI device, may need to be able to get a reference to its PHY
11component, which could be attached for example to the I2C bus. Some device
12drivers need to be able to control the clocks or the GPIOs for their devices,
13and so on.
14
15Device connections are generic descriptions of any type of connection between
16two separate devices.
17
18Device connections alone do not create a dependency between the two devices.
19They are only descriptions which are not tied to either of the devices directly.
20A dependency between the two devices exists only if one of the two endpoint
21devices requests a reference to the other. The descriptions themselves can be
22defined in firmware (not yet supported) or they can be built-in.
23
24Usage
25-----
26
27Device connections should exist before device ``->probe`` callback is called for
28either endpoint device in the description. If the connections are defined in
29firmware, this is not a problem. It should be considered if the connection
30descriptions are "built-in", and need to be added separately.
31
32The connection description consists of the names of the two devices with the
33connection, i.e. the endpoints, and unique identifier for the connection which
34is needed if there are multiple connections between the two devices.
35
36After a description exists, the devices in it can request reference to the other
37endpoint device, or they can request the description itself.
38
39API
40---
41
42.. kernel-doc:: drivers/base/devcon.c
43 : functions: device_connection_find_match device_connection_find device_connection_add device_connection_remove