device_connection.rst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ==================
  2. Device connections
  3. ==================
  4. Introduction
  5. ------------
  6. Devices often have connections to other devices that are outside of the direct
  7. child/parent relationship. A serial or network communication controller, which
  8. could be a PCI device, may need to be able to get a reference to its PHY
  9. component, which could be attached for example to the I2C bus. Some device
  10. drivers need to be able to control the clocks or the GPIOs for their devices,
  11. and so on.
  12. Device connections are generic descriptions of any type of connection between
  13. two separate devices.
  14. Device connections alone do not create a dependency between the two devices.
  15. They are only descriptions which are not tied to either of the devices directly.
  16. A dependency between the two devices exists only if one of the two endpoint
  17. devices requests a reference to the other. The descriptions themselves can be
  18. defined in firmware (not yet supported) or they can be built-in.
  19. Usage
  20. -----
  21. Device connections should exist before device ``->probe`` callback is called for
  22. either endpoint device in the description. If the connections are defined in
  23. firmware, this is not a problem. It should be considered if the connection
  24. descriptions are "built-in", and need to be added separately.
  25. The connection description consists of the names of the two devices with the
  26. connection, i.e. the endpoints, and unique identifier for the connection which
  27. is needed if there are multiple connections between the two devices.
  28. After a description exists, the devices in it can request reference to the other
  29. endpoint device, or they can request the description itself.
  30. API
  31. ---
  32. .. kernel-doc:: drivers/base/devcon.c
  33. :functions: device_connection_find_match device_connection_find device_connection_add device_connection_remove