summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2018-03-20 15:57:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-22 15:10:29 +0300
commitf2d9b66d84f3ff5ea3aff111e6a403e04fa8bf37 (patch)
treefa1d83bf1777d68f0bb53305d0f941c5886775f1 /include/linux/device.h
parent2699126bcf18db672451b82b26a1c8e954784fad (diff)
downloadlinux-f2d9b66d84f3ff5ea3aff111e6a403e04fa8bf37.tar.xz
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 'include/linux/device.h')
-rw-r--r--include/linux/device.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index b093405ed525..204ff64279fd 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -730,6 +730,28 @@ struct device_dma_parameters {
};
/**
+ * 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.
* @DL_STATE_DORMANT: None of the supplier/consumer drivers is present.