ti-pwmss.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * TI PWM Subsystem driver
  4. *
  5. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  6. */
  7. #include <linux/module.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/io.h>
  10. #include <linux/err.h>
  11. #include <linux/pm_runtime.h>
  12. #include <linux/of_device.h>
  13. static const struct of_device_id pwmss_of_match[] = {
  14. { .compatible = "ti,am33xx-pwmss" },
  15. {},
  16. };
  17. MODULE_DEVICE_TABLE(of, pwmss_of_match);
  18. static int pwmss_probe(struct platform_device *pdev)
  19. {
  20. int ret;
  21. struct device_node *node = pdev->dev.of_node;
  22. pm_runtime_enable(&pdev->dev);
  23. /* Populate all the child nodes here... */
  24. ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
  25. if (ret)
  26. dev_err(&pdev->dev, "no child node found\n");
  27. return ret;
  28. }
  29. static int pwmss_remove(struct platform_device *pdev)
  30. {
  31. pm_runtime_disable(&pdev->dev);
  32. return 0;
  33. }
  34. static struct platform_driver pwmss_driver = {
  35. .driver = {
  36. .name = "pwmss",
  37. .of_match_table = pwmss_of_match,
  38. },
  39. .probe = pwmss_probe,
  40. .remove = pwmss_remove,
  41. };
  42. module_platform_driver(pwmss_driver);
  43. MODULE_DESCRIPTION("PWM Subsystem driver");
  44. MODULE_AUTHOR("Texas Instruments");
  45. MODULE_LICENSE("GPL");