musb_am335x.c 976 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/platform_device.h>
  3. #include <linux/pm_runtime.h>
  4. #include <linux/module.h>
  5. #include <linux/of_platform.h>
  6. static int am335x_child_probe(struct platform_device *pdev)
  7. {
  8. int ret;
  9. pm_runtime_enable(&pdev->dev);
  10. ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
  11. if (ret)
  12. goto err;
  13. return 0;
  14. err:
  15. pm_runtime_disable(&pdev->dev);
  16. return ret;
  17. }
  18. static const struct of_device_id am335x_child_of_match[] = {
  19. { .compatible = "ti,am33xx-usb" },
  20. { },
  21. };
  22. MODULE_DEVICE_TABLE(of, am335x_child_of_match);
  23. static struct platform_driver am335x_child_driver = {
  24. .probe = am335x_child_probe,
  25. .driver = {
  26. .name = "am335x-usb-childs",
  27. .of_match_table = am335x_child_of_match,
  28. },
  29. };
  30. static int __init am335x_child_init(void)
  31. {
  32. return platform_driver_register(&am335x_child_driver);
  33. }
  34. module_init(am335x_child_init);
  35. MODULE_DESCRIPTION("AM33xx child devices");
  36. MODULE_LICENSE("GPL v2");