lists.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_LISTS_H_
  10. #define _DM_LISTS_H_
  11. #include <dm/uclass-id.h>
  12. /**
  13. * lists_driver_lookup_name() - Return u_boot_driver corresponding to name
  14. *
  15. * This function returns a pointer to a driver given its name. This is used
  16. * for binding a driver given its name and platdata.
  17. *
  18. * @name: Name of driver to look up
  19. * @return pointer to driver, or NULL if not found
  20. */
  21. struct driver *lists_driver_lookup_name(const char *name);
  22. /**
  23. * lists_uclass_lookup() - Return uclass_driver based on ID of the class
  24. * id: ID of the class
  25. *
  26. * This function returns the pointer to uclass_driver, which is the class's
  27. * base structure based on the ID of the class. Returns NULL on error.
  28. */
  29. struct uclass_driver *lists_uclass_lookup(enum uclass_id id);
  30. /**
  31. * lists_bind_drivers() - search for and bind all drivers to parent
  32. *
  33. * This searches the U_BOOT_DEVICE() structures and creates new devices for
  34. * each one. The devices will have @parent as their parent.
  35. *
  36. * @parent: parent driver (root)
  37. * @early_only: If true, bind only drivers with the DM_INIT_F flag. If false
  38. * bind all drivers.
  39. */
  40. int lists_bind_drivers(struct udevice *parent);
  41. /**
  42. * lists_bind_fdt() - bind a device tree node
  43. *
  44. * This creates a new device bound to the given device tree node, with
  45. * @parent as its parent.
  46. *
  47. * @parent: parent driver (root)
  48. * @blob: device tree blob
  49. * @offset: offset of this device tree node
  50. */
  51. int lists_bind_fdt(struct udevice *parent, const void *blob, int offset);
  52. #endif