Linux Audio

Check our new training course

Loading...
v3.15
 1/*
 2 * linux/arch/arm/mach-pxa/clock-pxa2xx.c
 3 *
 4 * This program is free software; you can redistribute it and/or modify
 5 * it under the terms of the GNU General Public License version 2 as
 6 * published by the Free Software Foundation.
 7 */
 8
 9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/io.h>
13#include <linux/syscore_ops.h>
14
15#include <mach/pxa2xx-regs.h>
16
17#include "clock.h"
18
19void clk_pxa2xx_cken_enable(struct clk *clk)
20{
21	CKEN |= 1 << clk->cken;
22}
23
24void clk_pxa2xx_cken_disable(struct clk *clk)
25{
26	CKEN &= ~(1 << clk->cken);
27}
28
29const struct clkops clk_pxa2xx_cken_ops = {
30	.enable		= clk_pxa2xx_cken_enable,
31	.disable	= clk_pxa2xx_cken_disable,
32};
33
34#ifdef CONFIG_PM
35static uint32_t saved_cken;
36
37static int pxa2xx_clock_suspend(void)
38{
39	saved_cken = CKEN;
40	return 0;
41}
42
43static void pxa2xx_clock_resume(void)
44{
45	CKEN = saved_cken;
46}
47#else
48#define pxa2xx_clock_suspend	NULL
49#define pxa2xx_clock_resume	NULL
50#endif
51
52struct syscore_ops pxa2xx_clock_syscore_ops = {
53	.suspend	= pxa2xx_clock_suspend,
54	.resume		= pxa2xx_clock_resume,
55};
v3.1
 1/*
 2 * linux/arch/arm/mach-pxa/clock-pxa2xx.c
 3 *
 4 * This program is free software; you can redistribute it and/or modify
 5 * it under the terms of the GNU General Public License version 2 as
 6 * published by the Free Software Foundation.
 7 */
 8
 9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
 
12#include <linux/syscore_ops.h>
13
14#include <mach/pxa2xx-regs.h>
15
16#include "clock.h"
17
18void clk_pxa2xx_cken_enable(struct clk *clk)
19{
20	CKEN |= 1 << clk->cken;
21}
22
23void clk_pxa2xx_cken_disable(struct clk *clk)
24{
25	CKEN &= ~(1 << clk->cken);
26}
27
28const struct clkops clk_pxa2xx_cken_ops = {
29	.enable		= clk_pxa2xx_cken_enable,
30	.disable	= clk_pxa2xx_cken_disable,
31};
32
33#ifdef CONFIG_PM
34static uint32_t saved_cken;
35
36static int pxa2xx_clock_suspend(void)
37{
38	saved_cken = CKEN;
39	return 0;
40}
41
42static void pxa2xx_clock_resume(void)
43{
44	CKEN = saved_cken;
45}
46#else
47#define pxa2xx_clock_suspend	NULL
48#define pxa2xx_clock_resume	NULL
49#endif
50
51struct syscore_ops pxa2xx_clock_syscore_ops = {
52	.suspend	= pxa2xx_clock_suspend,
53	.resume		= pxa2xx_clock_resume,
54};