perfmgr_main.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #include <linux/proc_fs.h>
  2. #include <linux/module.h>
  3. #include <linux/moduleparam.h>
  4. #include <linux/platform_device.h>
  5. #include "perfmgr.h"
  6. /*--------------------prototype--------------------*/
  7. /*--------------------function--------------------*/
  8. static int perfmgr_probe(struct platform_device *dev)
  9. {
  10. return 0;
  11. }
  12. struct platform_device perfmgr_device = {
  13. .name = "perfmgr",
  14. .id = -1,
  15. };
  16. int perfmgr_suspend(struct device *dev)
  17. {
  18. #ifdef MTK_TOUCH_BOOST
  19. perfmgr_touch_suspend();
  20. #endif
  21. return 0;
  22. }
  23. int perfmgr_resume(struct device *dev)
  24. {
  25. return 0;
  26. }
  27. static struct platform_driver perfmgr_driver = {
  28. .probe = perfmgr_probe,
  29. .driver = {
  30. .name = "perfmgr",
  31. .pm = &(const struct dev_pm_ops){
  32. .suspend = perfmgr_suspend,
  33. .resume = perfmgr_resume,
  34. },
  35. },
  36. };
  37. /*--------------------INIT------------------------*/
  38. static int __init init_perfmgr(void)
  39. {
  40. struct proc_dir_entry *hps_dir = NULL;
  41. int ret = 0;
  42. ret = platform_device_register(&perfmgr_device);
  43. if (ret)
  44. return ret;
  45. ret = platform_driver_register(&perfmgr_driver);
  46. if (ret)
  47. return ret;
  48. hps_dir = proc_mkdir("perfmgr", NULL);
  49. #ifdef MTK_TOUCH_BOOST
  50. init_perfmgr_touch();
  51. #endif
  52. return 0;
  53. }
  54. device_initcall(init_perfmgr);
  55. /*MODULE_LICENSE("GPL");*/
  56. /*MODULE_AUTHOR("MTK");*/
  57. /*MODULE_DESCRIPTION("The fliper function");*/