summaryrefslogtreecommitdiffstats
path: root/include/of.h
diff options
context:
space:
mode:
authorDaniel Schultz <d.schultz@phytec.de>2017-11-03 11:48:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-11-07 07:47:41 +0100
commit7a6239529b93cb2a18d691d118ff830b14af7fdc (patch)
tree002fd6003ada0e7c4ae3d34b53b29deefdf7842c /include/of.h
parentf34d13722141b4bbe68ff46d65ef93e360c2acbe (diff)
downloadbarebox-7a6239529b93cb2a18d691d118ff830b14af7fdc.tar.gz
barebox-7a6239529b93cb2a18d691d118ff830b14af7fdc.tar.xz
common: oftree: Add autoenable functionality
This patch adds an API to automatically enable either hardware components with existing device drivers or i2c clients. All functions take a device tree path to find the hardware and will fix up the node status in the kernel device tree, if it's accessible. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/of.h')
-rw-r--r--include/of.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/of.h b/include/of.h
index 18a423241b..9bdbbb5ed2 100644
--- a/include/of.h
+++ b/include/of.h
@@ -262,6 +262,8 @@ struct device_node *of_find_node_by_alias(struct device_node *root,
const char *alias);
struct device_node *of_find_node_by_path_or_alias(struct device_node *root,
const char *str);
+int of_autoenable_device_by_path(char *path);
+int of_autoenable_i2c_by_component(char *path);
#else
static inline int of_parse_partitions(struct cdev *cdev,
struct device_node *node)
@@ -664,6 +666,18 @@ static inline struct device_node *of_find_node_by_path_or_alias(
{
return NULL;
}
+
+static inline int of_autoenable_i2c_by_path(char *path)
+{
+ return -ENODEV;
+}
+
+static inline int of_autoenable_i2c_by_component(char *path)
+{
+ return -ENODEV;
+}
+
+
#endif
#define for_each_node_by_name(dn, name) \