Linux Audio

Check our new training course

Yocto distribution development and maintenance

Need a Yocto distribution for your embedded project?
Loading...
v3.15
 
 1/*
 2 * Runtime PM support code for OMAP1
 3 *
 4 * Author: Kevin Hilman, Deep Root Systems, LLC
 5 *
 6 * Copyright (C) 2010 Texas Instruments, Inc.
 7 *
 8 * This file is licensed under the terms of the GNU General Public
 9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/pm_runtime.h>
16#include <linux/pm_clock.h>
17#include <linux/platform_device.h>
18#include <linux/mutex.h>
19#include <linux/clk.h>
20#include <linux/err.h>
21
22#include "soc.h"
23
24#ifdef CONFIG_PM_RUNTIME
25static int omap1_pm_runtime_suspend(struct device *dev)
26{
27	int ret;
28
29	dev_dbg(dev, "%s\n", __func__);
30
31	ret = pm_generic_runtime_suspend(dev);
32	if (ret)
33		return ret;
34
35	ret = pm_clk_suspend(dev);
36	if (ret) {
37		pm_generic_runtime_resume(dev);
38		return ret;
39	}
40
41	return 0;
42}
43
44static int omap1_pm_runtime_resume(struct device *dev)
45{
46	dev_dbg(dev, "%s\n", __func__);
47
48	pm_clk_resume(dev);
49	return pm_generic_runtime_resume(dev);
50}
51
52static struct dev_pm_domain default_pm_domain = {
53	.ops = {
54		.runtime_suspend = omap1_pm_runtime_suspend,
55		.runtime_resume = omap1_pm_runtime_resume,
56		USE_PLATFORM_PM_SLEEP_OPS
57	},
58};
59#define OMAP1_PM_DOMAIN (&default_pm_domain)
60#else
61#define OMAP1_PM_DOMAIN NULL
62#endif /* CONFIG_PM_RUNTIME */
63
64static struct pm_clk_notifier_block platform_bus_notifier = {
65	.pm_domain = OMAP1_PM_DOMAIN,
66	.con_ids = { "ick", "fck", NULL, },
67};
68
69static int __init omap1_pm_runtime_init(void)
70{
71	if (!cpu_class_is_omap1())
72		return -ENODEV;
73
74	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
75
76	return 0;
77}
78core_initcall(omap1_pm_runtime_init);
79
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0-only
 2/*
 3 * Runtime PM support code for OMAP1
 4 *
 5 * Author: Kevin Hilman, Deep Root Systems, LLC
 6 *
 7 * Copyright (C) 2010 Texas Instruments, Inc.
 
 
 
 
 8 */
 9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/io.h>
12#include <linux/pm_runtime.h>
13#include <linux/pm_clock.h>
14#include <linux/platform_device.h>
15#include <linux/mutex.h>
16#include <linux/clk.h>
17#include <linux/err.h>
18
19#include "soc.h"
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21static struct dev_pm_domain default_pm_domain = {
22	.ops = {
23		USE_PM_CLK_RUNTIME_OPS
 
24		USE_PLATFORM_PM_SLEEP_OPS
25	},
26};
 
 
 
 
27
28static struct pm_clk_notifier_block platform_bus_notifier = {
29	.pm_domain = &default_pm_domain,
30	.con_ids = { "ick", "fck", NULL, },
31};
32
33static int __init omap1_pm_runtime_init(void)
34{
35	if (!cpu_class_is_omap1())
36		return -ENODEV;
37
38	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
39
40	return 0;
41}
42core_initcall(omap1_pm_runtime_init);