lastpc.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __LASTPC_H__
  2. #define __LASTPC_H__
  3. #include <linux/platform_device.h>
  4. #include <linux/pm.h>
  5. #include <linux/compiler.h>
  6. struct lastpc_plt;
  7. struct lastpc_plt_operations {
  8. /* if platform needs special settings before */
  9. int (*start)(struct lastpc_plt *plt);
  10. /* dump anything we get */
  11. int (*dump)(struct lastpc_plt *plt, char *buf, int len);
  12. /* if you want to add unit test by sysfs interface, implement this */
  13. int (*reboot_test)(struct lastpc_plt *plt);
  14. /* if you want to do anything more than lastpc.c:lastpc_probe() */
  15. int (*probe)(struct lastpc_plt *plt, struct platform_device *pdev);
  16. /* if you want to do anything more than lastpc.c:lastpc_remove() */
  17. int (*remove)(struct lastpc_plt *plt, struct platform_device *pdev);
  18. /* if you want to do anything more than lastpc.c:lastpc_suspend() */
  19. int (*suspend)(struct lastpc_plt *plt, struct platform_device *pdev, pm_message_t state);
  20. /* if you want to do anything more than lastpc.c:lastpc_resume() */
  21. int (*resume)(struct lastpc_plt *plt, struct platform_device *pdev);
  22. };
  23. struct lastpc_plt {
  24. unsigned int chip_code;
  25. unsigned int min_buf_len;
  26. struct lastpc_plt_operations *ops;
  27. struct lastpc *common;
  28. };
  29. struct lastpc {
  30. struct platform_driver plt_drv;
  31. void __iomem *base;
  32. struct lastpc_plt *cur_plt;
  33. };
  34. /* for platform register their specific lastpc behaviors
  35. (chip or various versions of lastpc)
  36. */
  37. int lastpc_register(struct lastpc_plt *plt);
  38. #endif /* end of __LASTPC_H__ */