Linux Audio

Check our new training course

Loading...
v4.17
 
 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
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;
34	struct device_node *node = pdev->dev.of_node;
35
36	pm_runtime_enable(&pdev->dev);
37
38	/* Populate all the child nodes here... */
39	ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
40	if (ret)
41		dev_err(&pdev->dev, "no child node found\n");
42
43	return ret;
44}
45
46static int pwmss_remove(struct platform_device *pdev)
47{
48	pm_runtime_disable(&pdev->dev);
49	return 0;
50}
51
52static struct platform_driver pwmss_driver = {
53	.driver	= {
54		.name	= "pwmss",
55		.of_match_table	= pwmss_of_match,
56	},
57	.probe	= pwmss_probe,
58	.remove	= pwmss_remove,
59};
60
61module_platform_driver(pwmss_driver);
62
63MODULE_DESCRIPTION("PWM Subsystem driver");
64MODULE_AUTHOR("Texas Instruments");
65MODULE_LICENSE("GPL");
v5.4
 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
 8#include <linux/module.h>
 9#include <linux/platform_device.h>
10#include <linux/io.h>
11#include <linux/err.h>
12#include <linux/pm_runtime.h>
13#include <linux/of_device.h>
14
15static const struct of_device_id pwmss_of_match[] = {
16	{ .compatible	= "ti,am33xx-pwmss" },
17	{},
18};
19MODULE_DEVICE_TABLE(of, pwmss_of_match);
20
21static int pwmss_probe(struct platform_device *pdev)
22{
23	int ret;
24	struct device_node *node = pdev->dev.of_node;
25
26	pm_runtime_enable(&pdev->dev);
27
28	/* Populate all the child nodes here... */
29	ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
30	if (ret)
31		dev_err(&pdev->dev, "no child node found\n");
32
33	return ret;
34}
35
36static int pwmss_remove(struct platform_device *pdev)
37{
38	pm_runtime_disable(&pdev->dev);
39	return 0;
40}
41
42static struct platform_driver pwmss_driver = {
43	.driver	= {
44		.name	= "pwmss",
45		.of_match_table	= pwmss_of_match,
46	},
47	.probe	= pwmss_probe,
48	.remove	= pwmss_remove,
49};
50
51module_platform_driver(pwmss_driver);
52
53MODULE_DESCRIPTION("PWM Subsystem driver");
54MODULE_AUTHOR("Texas Instruments");
55MODULE_LICENSE("GPL");