summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorMario Six <mario.six@gdsys.cc>2018-06-26 09:46:50 +0300
committerSimon Glass <sjg@chromium.org>2018-09-29 20:49:35 +0300
commite4c98a59db99e6bfba74d27cc571d59213acb64e (patch)
treeaf415a4f31c37994f94531dcc4923270ef894d68 /include/dm
parent2ea4d0db738f69f14a08406763ffca332f5c0446 (diff)
downloadu-boot-e4c98a59db99e6bfba74d27cc571d59213acb64e.tar.xz
core: Add dev_{disable,enable}_by_path
We cannot use device structures to disable devices, since getting them with the API functions would bind and activate the device, which would fail if the underlying device does not exist. Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index 3120b68fcc..9812d86f08 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -601,6 +601,22 @@ bool device_is_compatible(struct udevice *dev, const char *compat);
bool of_machine_is_compatible(const char *compat);
/**
+ * dev_disable_by_path() - Disable a device given its device tree path
+ *
+ * @path: The device tree path identifying the device to be disabled
+ * @return 0 on success, -ve on error
+ */
+int dev_disable_by_path(const char *path);
+
+/**
+ * dev_enable_by_path() - Enable a device given its device tree path
+ *
+ * @path: The device tree path identifying the device to be enabled
+ * @return 0 on success, -ve on error
+ */
+int dev_enable_by_path(const char *path);
+
+/**
* device_is_on_pci_bus - Test if a device is on a PCI bus
*
* @dev: device to test