diff options
author | Mario Six <mario.six@gdsys.cc> | 2018-06-26 08:46:50 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-09-29 11:49:35 -0600 |
commit | e4c98a59db99e6bfba74d27cc571d59213acb64e (patch) | |
tree | af415a4f31c37994f94531dcc4923270ef894d68 /include | |
parent | 2ea4d0db738f69f14a08406763ffca332f5c0446 (diff) |
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')
-rw-r--r-- | include/dm/device.h | 16 |
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 |