ti-pwmss.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_platform.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 void pwmss_remove(struct platform_device *pdev)
  30. {
  31. pm_runtime_disable(&pdev->dev);
  32. }
  33. static struct platform_driver pwmss_driver = {
  34. .driver = {
  35. .name = "pwmss",
  36. .of_match_table = pwmss_of_match,
  37. },
  38. .probe = pwmss_probe,
  39. .remove_new = pwmss_remove,
  40. };
  41. module_platform_driver(pwmss_driver);
  42. MODULE_DESCRIPTION("PWM Subsystem driver");
  43. MODULE_AUTHOR("Texas Instruments");
  44. MODULE_LICENSE("GPL");