Merge tag 'driver-core-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[muen/linux.git] / include / linux / device.h
index 0b32a42db4ae656e71529d6c55be7a0b2d416e99..0059b99e1f25db0ef52d09bf50e1239e2fbf14e9 100644 (file)
@@ -730,6 +730,28 @@ struct device_dma_parameters {
        unsigned long segment_boundary_mask;
 };
 
+/**
+ * struct device_connection - Device Connection Descriptor
+ * @endpoint: The names of the two devices connected together
+ * @id: Unique identifier for the connection
+ * @list: List head, private, for internal use only
+ */
+struct device_connection {
+       const char              *endpoint[2];
+       const char              *id;
+       struct list_head        list;
+};
+
+void *device_connection_find_match(struct device *dev, const char *con_id,
+                               void *data,
+                               void *(*match)(struct device_connection *con,
+                                              int ep, void *data));
+
+struct device *device_connection_find(struct device *dev, const char *con_id);
+
+void device_connection_add(struct device_connection *con);
+void device_connection_remove(struct device_connection *con);
+
 /**
  * enum device_link_state - Device link states.
  * @DL_STATE_NONE: The presence of the drivers is not being tracked.
@@ -770,6 +792,7 @@ enum device_link_state {
  * @status: The state of the link (with respect to the presence of drivers).
  * @flags: Link flags.
  * @rpm_active: Whether or not the consumer device is runtime-PM-active.
+ * @kref: Count repeated addition of the same link.
  * @rcu_head: An RCU head to use for deferred execution of SRCU callbacks.
  */
 struct device_link {
@@ -780,6 +803,7 @@ struct device_link {
        enum device_link_state status;
        u32 flags;
        bool rpm_active;
+       struct kref kref;
 #ifdef CONFIG_SRCU
        struct rcu_head rcu_head;
 #endif