summaryrefslogtreecommitdiffstats
path: root/include/linux/fwnode.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fwnode.h')
-rw-r--r--include/linux/fwnode.h56
1 files changed, 33 insertions, 23 deletions
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 50893a1646cf..0c35b6caf0f6 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -14,20 +14,9 @@
#include <linux/types.h>
-enum fwnode_type {
- FWNODE_INVALID = 0,
- FWNODE_OF,
- FWNODE_ACPI,
- FWNODE_ACPI_DATA,
- FWNODE_ACPI_STATIC,
- FWNODE_PDATA,
- FWNODE_IRQCHIP
-};
-
struct fwnode_operations;
struct fwnode_handle {
- enum fwnode_type type;
struct fwnode_handle *secondary;
const struct fwnode_operations *ops;
};
@@ -44,6 +33,20 @@ struct fwnode_endpoint {
const struct fwnode_handle *local_fwnode;
};
+#define NR_FWNODE_REFERENCE_ARGS 8
+
+/**
+ * struct fwnode_reference_args - Fwnode reference with additional arguments
+ * @fwnode:- A reference to the base fwnode
+ * @nargs: Number of elements in @args array
+ * @args: Integer arguments on the fwnode
+ */
+struct fwnode_reference_args {
+ struct fwnode_handle *fwnode;
+ unsigned int nargs;
+ unsigned int args[NR_FWNODE_REFERENCE_ARGS];
+};
+
/**
* struct fwnode_operations - Operations for fwnode interface
* @get: Get a reference to an fwnode.
@@ -57,6 +60,7 @@ struct fwnode_endpoint {
* @get_parent: Return the parent of an fwnode.
* @get_next_child_node: Return the next child node in an iteration.
* @get_named_child_node: Return a child node with a given name.
+ * @get_reference_args: Return a reference pointed to by a property, with args
* @graph_get_next_endpoint: Return an endpoint node in an iteration.
* @graph_get_remote_endpoint: Return the remote endpoint node of a local
* endpoint node.
@@ -66,30 +70,36 @@ struct fwnode_endpoint {
struct fwnode_operations {
void (*get)(struct fwnode_handle *fwnode);
void (*put)(struct fwnode_handle *fwnode);
- bool (*device_is_available)(struct fwnode_handle *fwnode);
- bool (*property_present)(struct fwnode_handle *fwnode,
+ bool (*device_is_available)(const struct fwnode_handle *fwnode);
+ bool (*property_present)(const struct fwnode_handle *fwnode,
const char *propname);
- int (*property_read_int_array)(struct fwnode_handle *fwnode,
+ int (*property_read_int_array)(const struct fwnode_handle *fwnode,
const char *propname,
unsigned int elem_size, void *val,
size_t nval);
- int (*property_read_string_array)(struct fwnode_handle *fwnode_handle,
- const char *propname,
- const char **val, size_t nval);
- struct fwnode_handle *(*get_parent)(struct fwnode_handle *fwnode);
+ int
+ (*property_read_string_array)(const struct fwnode_handle *fwnode_handle,
+ const char *propname, const char **val,
+ size_t nval);
+ struct fwnode_handle *(*get_parent)(const struct fwnode_handle *fwnode);
struct fwnode_handle *
- (*get_next_child_node)(struct fwnode_handle *fwnode,
+ (*get_next_child_node)(const struct fwnode_handle *fwnode,
struct fwnode_handle *child);
struct fwnode_handle *
- (*get_named_child_node)(struct fwnode_handle *fwnode, const char *name);
+ (*get_named_child_node)(const struct fwnode_handle *fwnode,
+ const char *name);
+ int (*get_reference_args)(const struct fwnode_handle *fwnode,
+ const char *prop, const char *nargs_prop,
+ unsigned int nargs, unsigned int index,
+ struct fwnode_reference_args *args);
struct fwnode_handle *
- (*graph_get_next_endpoint)(struct fwnode_handle *fwnode,
+ (*graph_get_next_endpoint)(const struct fwnode_handle *fwnode,
struct fwnode_handle *prev);
struct fwnode_handle *
- (*graph_get_remote_endpoint)(struct fwnode_handle *fwnode);
+ (*graph_get_remote_endpoint)(const struct fwnode_handle *fwnode);
struct fwnode_handle *
(*graph_get_port_parent)(struct fwnode_handle *fwnode);
- int (*graph_parse_endpoint)(struct fwnode_handle *fwnode,
+ int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint);
};