root.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2013 Google, Inc
  3. *
  4. * (C) Copyright 2012
  5. * Pavel Herrmann <morpheus.ibis@gmail.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef _DM_ROOT_H_
  10. #define _DM_ROOT_H_
  11. struct udevice;
  12. /**
  13. * dm_root() - Return pointer to the top of the driver tree
  14. *
  15. * This function returns pointer to the root node of the driver tree,
  16. *
  17. * @return pointer to root device, or NULL if not inited yet
  18. */
  19. struct udevice *dm_root(void);
  20. /**
  21. * dm_scan_platdata() - Scan all platform data and bind drivers
  22. *
  23. * This scans all available platdata and creates drivers for each
  24. *
  25. * @return 0 if OK, -ve on error
  26. */
  27. int dm_scan_platdata(void);
  28. /**
  29. * dm_scan_fdt() - Scan the device tree and bind drivers
  30. *
  31. * This scans the device tree and creates a driver for each node
  32. *
  33. * @blob: Pointer to device tree blob
  34. * @return 0 if OK, -ve on error
  35. */
  36. int dm_scan_fdt(const void *blob);
  37. /**
  38. * dm_init() - Initialise Driver Model structures
  39. *
  40. * This function will initialize roots of driver tree and class tree.
  41. * This needs to be called before anything uses the DM
  42. *
  43. * @return 0 if OK, -ve on error
  44. */
  45. int dm_init(void);
  46. #endif