PageRenderTime 19ms CodeModel.GetById 10ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/arm/mach-mxs/include/mach/clock.h

https://github.com/AICP/kernel_asus_grouper
C Header | 62 lines | 23 code | 6 blank | 33 comment | 0 complexity | ad7c352b5842fb817513b43514065018 MD5 | raw file
 1/*
 2 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
 3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
 4 *
 5 * This program is free software; you can redistribute it and/or
 6 * modify it under the terms of the GNU General Public License
 7 * as published by the Free Software Foundation; either version 2
 8 * of the License, or (at your option) any later version.
 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA  02110-1301, USA.
18 */
19
20#ifndef __MACH_MXS_CLOCK_H__
21#define __MACH_MXS_CLOCK_H__
22
23#ifndef __ASSEMBLY__
24#include <linux/list.h>
25
26struct module;
27
28struct clk {
29	int id;
30	/* Source clock this clk depends on */
31	struct clk *parent;
32	/* Reference count of clock enable/disable */
33	__s8 usecount;
34	/* Register bit position for clock's enable/disable control. */
35	u8 enable_shift;
36	/* Register address for clock's enable/disable control. */
37	void __iomem *enable_reg;
38	u32 flags;
39	/* get the current clock rate (always a fresh value) */
40	unsigned long (*get_rate) (struct clk *);
41	/* Function ptr to set the clock to a new rate. The rate must match a
42	   supported rate returned from round_rate. Leave blank if clock is not
43	   programmable */
44	int (*set_rate) (struct clk *, unsigned long);
45	/* Function ptr to round the requested clock rate to the nearest
46	   supported rate that is less than or equal to the requested rate. */
47	unsigned long (*round_rate) (struct clk *, unsigned long);
48	/* Function ptr to enable the clock. Leave blank if clock can not
49	   be gated. */
50	int (*enable) (struct clk *);
51	/* Function ptr to disable the clock. Leave blank if clock can not
52	   be gated. */
53	void (*disable) (struct clk *);
54	/* Function ptr to set the parent clock of the clock. */
55	int (*set_parent) (struct clk *, struct clk *);
56};
57
58int clk_register(struct clk *clk);
59void clk_unregister(struct clk *clk);
60
61#endif /* __ASSEMBLY__ */
62#endif /* __MACH_MXS_CLOCK_H__ */