board.h 1.2 KB

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