blob: 64baf3bc47c2bd7c83936a873e6a03978a0379f3 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef __ARCH_ARM_MACH_MSM_CLOCK_VOTER_H
15#define __ARCH_ARM_MACH_MSM_CLOCK_VOTER_H
16
17struct clk_ops;
18extern struct clk_ops clk_ops_voter;
19
20struct clk_voter {
21 bool enabled;
22 unsigned rate;
23 struct clk *parent;
24 struct clk c;
25};
26
27static inline struct clk_voter *to_clk_voter(struct clk *clk)
28{
29 return container_of(clk, struct clk_voter, c);
30}
31
32#define DEFINE_CLK_VOTER(clk_name, _parent) \
33 struct clk_voter clk_name = { \
34 .parent = _parent, \
35 .c = { \
36 .dbg_name = #clk_name, \
37 .ops = &clk_ops_voter, \
38 .flags = CLKFLAG_SKIP_AUTO_OFF, \
39 CLK_INIT(clk_name.c), \
40 }, \
41 }
42
43#endif