of_spmi.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* Copyright (c) 2012, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #include <linux/spmi.h>
  13. #include <linux/of_irq.h>
  14. #ifdef CONFIG_OF_SPMI
  15. /**
  16. * of_spmi_register_devices() - Register devices in the SPMI Device Tree
  17. * @ctrl: spmi_controller which devices should be registered to.
  18. *
  19. * This routine scans the SPMI Device Tree, allocating resources and
  20. * creating spmi_devices according to the SPMI bus Device Tree
  21. * hierarchy. Details of this hierarchy can be found in
  22. * Documentation/devicetree/bindings/spmi. This routine is normally
  23. * called from the probe routine of the driver registering as a
  24. * spmi_controller.
  25. */
  26. int of_spmi_register_devices(struct spmi_controller *ctrl);
  27. #else
  28. static int of_spmi_register_devices(struct spmi_controller *ctrl)
  29. {
  30. return -ENXIO;
  31. }
  32. #endif /* CONFIG_OF_SPMI */