aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
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 /include/linux/device.h
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 '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 {
730}; 730};
731 731
732/** 732/**
733 * struct device_connection - Device Connection Descriptor
734 * @endpoint: The names of the two devices connected together
735 * @id: Unique identifier for the connection
736 * @list: List head, private, for internal use only
737 */
738struct device_connection {
739 const char *endpoint[2];
740 const char *id;
741 struct list_head list;
742};
743
744void *device_connection_find_match(struct device *dev, const char *con_id,
745 void *data,
746 void *(*match)(struct device_connection *con,
747 int ep, void *data));
748
749struct device *device_connection_find(struct device *dev, const char *con_id);
750
751void device_connection_add(struct device_connection *con);
752void device_connection_remove(struct device_connection *con);
753
754/**
733 * enum device_link_state - Device link states. 755 * enum device_link_state - Device link states.
734 * @DL_STATE_NONE: The presence of the drivers is not being tracked. 756 * @DL_STATE_NONE: The presence of the drivers is not being tracked.
735 * @DL_STATE_DORMANT: None of the supplier/consumer drivers is present. 757 * @DL_STATE_DORMANT: None of the supplier/consumer drivers is present.