0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/module.h>
0009 #include <linux/platform_device.h>
0010 #include <linux/io.h>
0011 #include <linux/err.h>
0012 #include <linux/pm_runtime.h>
0013 #include <linux/of_device.h>
0014
0015 static const struct of_device_id pwmss_of_match[] = {
0016 { .compatible = "ti,am33xx-pwmss" },
0017 {},
0018 };
0019 MODULE_DEVICE_TABLE(of, pwmss_of_match);
0020
0021 static int pwmss_probe(struct platform_device *pdev)
0022 {
0023 int ret;
0024 struct device_node *node = pdev->dev.of_node;
0025
0026 pm_runtime_enable(&pdev->dev);
0027
0028
0029 ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
0030 if (ret)
0031 dev_err(&pdev->dev, "no child node found\n");
0032
0033 return ret;
0034 }
0035
0036 static int pwmss_remove(struct platform_device *pdev)
0037 {
0038 pm_runtime_disable(&pdev->dev);
0039 return 0;
0040 }
0041
0042 static struct platform_driver pwmss_driver = {
0043 .driver = {
0044 .name = "pwmss",
0045 .of_match_table = pwmss_of_match,
0046 },
0047 .probe = pwmss_probe,
0048 .remove = pwmss_remove,
0049 };
0050
0051 module_platform_driver(pwmss_driver);
0052
0053 MODULE_DESCRIPTION("PWM Subsystem driver");
0054 MODULE_AUTHOR("Texas Instruments");
0055 MODULE_LICENSE("GPL");