board.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __BOARD_H__
  3. #define __BOARD_H__
  4. #include <linux/init.h>
  5. #include <linux/of.h>
  6. struct board_staging_clk {
  7. const char *clk;
  8. const char *con_id;
  9. const char *dev_id;
  10. };
  11. struct board_staging_dev {
  12. /* Platform Device */
  13. struct platform_device *pdev;
  14. /* Clocks (optional) */
  15. const struct board_staging_clk *clocks;
  16. unsigned int nclocks;
  17. /* Generic PM Domain (optional) */
  18. const char *domain;
  19. };
  20. struct resource;
  21. bool board_staging_dt_node_available(const struct resource *resource,
  22. unsigned int num_resources);
  23. int board_staging_gic_setup_xlate(const char *gic_match, unsigned int base);
  24. void board_staging_gic_fixup_resources(struct resource *res, unsigned int nres);
  25. int board_staging_register_clock(const struct board_staging_clk *bsc);
  26. int board_staging_register_device(const struct board_staging_dev *dev);
  27. void board_staging_register_devices(const struct board_staging_dev *devs,
  28. unsigned int ndevs);
  29. #define board_staging(str, fn) \
  30. static int __init runtime_board_check(void) \
  31. { \
  32. if (of_machine_is_compatible(str)) \
  33. fn(); \
  34. \
  35. return 0; \
  36. } \
  37. \
  38. device_initcall(runtime_board_check)
  39. #endif /* __BOARD_H__ */