]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/pwm/pwm-tipwmss.c
CIFS: Add new mount option to set owner uid and gid from special sids in acl
[mirror_ubuntu-artful-kernel.git] / drivers / pwm / pwm-tipwmss.c
CommitLineData
af0ba001
PA
1/*
2 * TI PWM Subsystem driver
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/module.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <linux/err.h>
22#include <linux/pm_runtime.h>
23#include <linux/of_device.h>
24
af0ba001
PA
25static const struct of_device_id pwmss_of_match[] = {
26 { .compatible = "ti,am33xx-pwmss" },
27 {},
28};
29MODULE_DEVICE_TABLE(of, pwmss_of_match);
30
31static int pwmss_probe(struct platform_device *pdev)
32{
33 int ret;
af0ba001
PA
34 struct device_node *node = pdev->dev.of_node;
35
af0ba001
PA
36 pm_runtime_enable(&pdev->dev);
37 pm_runtime_get_sync(&pdev->dev);
af0ba001
PA
38
39 /* Populate all the child nodes here... */
40 ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
41 if (ret)
42 dev_err(&pdev->dev, "no child node found\n");
43
44 return ret;
45}
46
47static int pwmss_remove(struct platform_device *pdev)
48{
af0ba001
PA
49 pm_runtime_put_sync(&pdev->dev);
50 pm_runtime_disable(&pdev->dev);
af0ba001
PA
51 return 0;
52}
53
c26e9bb4 54#ifdef CONFIG_PM_SLEEP
af0ba001
PA
55static int pwmss_suspend(struct device *dev)
56{
af0ba001
PA
57 pm_runtime_put_sync(dev);
58 return 0;
59}
60
61static int pwmss_resume(struct device *dev)
62{
af0ba001 63 pm_runtime_get_sync(dev);
af0ba001
PA
64 return 0;
65}
c26e9bb4 66#endif
af0ba001
PA
67
68static SIMPLE_DEV_PM_OPS(pwmss_pm_ops, pwmss_suspend, pwmss_resume);
69
70static struct platform_driver pwmss_driver = {
71 .driver = {
72 .name = "pwmss",
af0ba001
PA
73 .pm = &pwmss_pm_ops,
74 .of_match_table = pwmss_of_match,
75 },
76 .probe = pwmss_probe,
77 .remove = pwmss_remove,
78};
79
80module_platform_driver(pwmss_driver);
81
82MODULE_DESCRIPTION("PWM Subsystem driver");
83MODULE_AUTHOR("Texas Instruments");
84MODULE_LICENSE("GPL");