mtk-scpsys-bringup.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2015 MediaTek Inc.
  3. * Author: James Liao <jamesjj.liao@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/module.h>
  16. #include <linux/of.h>
  17. #include <linux/of_platform.h>
  18. #include <linux/pm_runtime.h>
  19. static const struct of_device_id scpsys_bring_up_id_table[] = {
  20. { .compatible = "mediatek,scpsys-bring-up",},
  21. { },
  22. };
  23. MODULE_DEVICE_TABLE(of, scpsys_bring_up_id_table);
  24. static int scpsys_bring_up_probe(struct platform_device *pdev)
  25. {
  26. if (!pdev->dev.pm_domain)
  27. return -EPROBE_DEFER;
  28. pm_runtime_enable(&pdev->dev);
  29. pm_runtime_get_sync(&pdev->dev);
  30. return 0;
  31. }
  32. static int scpsys_bring_up_remove(struct platform_device *pdev)
  33. {
  34. return 0;
  35. }
  36. static struct platform_driver scpsys_bring_up = {
  37. .probe = scpsys_bring_up_probe,
  38. .remove = scpsys_bring_up_remove,
  39. .driver = {
  40. .name = "scpsys_bring_up",
  41. .owner = THIS_MODULE,
  42. .of_match_table = scpsys_bring_up_id_table,
  43. },
  44. };
  45. module_platform_driver(scpsys_bring_up);