platform.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * include/linux/platform.h - platform driver definitions
  3. *
  4. * Because of the prolific consumerism of the average American,
  5. * and the dominant marketing budgets of PC OEMs, we have been
  6. * blessed with frequent updates of the PC architecture.
  7. *
  8. * While most of these calls are singular per architecture, they
  9. * require an extra layer of abstraction on the x86 so the right
  10. * subsystem gets the right call.
  11. *
  12. * Basically, this consolidates the power off and reboot callbacks
  13. * into one structure, as well as adding power management hooks.
  14. *
  15. * When adding a platform driver, please make sure all callbacks are
  16. * filled. There are defaults defined below that do nothing; use those
  17. * if you do not support that callback.
  18. */
  19. #ifndef _PLATFORM_H_
  20. #define _PLATFORM_H_
  21. #ifdef __KERNEL__
  22. #include <linux/types.h>
  23. struct platform_t {
  24. char * name;
  25. u32 suspend_states;
  26. void (*reboot)(char * cmd);
  27. void (*halt)(void);
  28. void (*power_off)(void);
  29. int (*suspend)(int state, int flags);
  30. void (*idle)(void);
  31. };
  32. extern struct platform_t * platform;
  33. extern void default_reboot(char * cmd);
  34. extern void default_halt(void);
  35. extern int default_suspend(int state, int flags);
  36. extern void default_idle(void);
  37. #endif /* __KERNEL__ */
  38. #endif /* _PLATFORM_H */