aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fwnode.h
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2020-11-20 18:02:23 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-09 19:10:21 +0100
commit7b337cb3ebde384cba7405b61dfb84200bf623bf (patch)
treecf895b0d4122e4e9b0d058953a4ed2460e8e7e40 /include/linux/fwnode.h
parentdriver core: Add fwnode_init() (diff)
downloadlinux-dev-7b337cb3ebde384cba7405b61dfb84200bf623bf.tar.xz
linux-dev-7b337cb3ebde384cba7405b61dfb84200bf623bf.zip
driver core: Add fwnode link support
Add support for creating supplier-consumer links between fwnodes. It is intended for internal use the driver core and generic firmware support code (eg. Device Tree, ACPI), so it is simple by design and the API provided is limited. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20201121020232.908850-9-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fwnode.h')
-rw-r--r--include/linux/fwnode.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 5589799708b5..b88365187347 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -10,6 +10,7 @@
#define _LINUX_FWNODE_H_
#include <linux/types.h>
+#include <linux/list.h>
struct fwnode_operations;
struct device;
@@ -18,6 +19,15 @@ struct fwnode_handle {
struct fwnode_handle *secondary;
const struct fwnode_operations *ops;
struct device *dev;
+ struct list_head suppliers;
+ struct list_head consumers;
+};
+
+struct fwnode_link {
+ struct fwnode_handle *supplier;
+ struct list_head s_hook;
+ struct fwnode_handle *consumer;
+ struct list_head c_hook;
};
/**
@@ -174,8 +184,12 @@ static inline void fwnode_init(struct fwnode_handle *fwnode,
const struct fwnode_operations *ops)
{
fwnode->ops = ops;
+ INIT_LIST_HEAD(&fwnode->consumers);
+ INIT_LIST_HEAD(&fwnode->suppliers);
}
extern u32 fw_devlink_get_flags(void);
+int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup);
+void fwnode_links_purge(struct fwnode_handle *fwnode);
#endif