blob: d2f0e50a70bfaafc628a4831830933e547be5ff6 [file] [log] [blame]
wanzongshun0e4a34b2009-06-10 15:50:44 +01001/*
2 * linux/arch/arm/mach-w90x900/clock.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 *
6 * Wan ZongShun <mcuos.com@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License.
11 */
12
13#include <asm/clkdev.h>
14
15void w90x900_clk_enable(struct clk *clk, int enable);
wanzongshundb58e902009-07-14 15:10:43 +010016void w90x900_subclk_enable(struct clk *clk, int enable);
wanzongshun0e4a34b2009-06-10 15:50:44 +010017void clks_register(struct clk_lookup *clks, size_t num);
18
19struct clk {
20 unsigned long cken;
21 unsigned int enabled;
22 void (*enable)(struct clk *, int enable);
23};
24
25#define DEFINE_CLK(_name, _ctrlbit) \
26struct clk clk_##_name = { \
27 .enable = w90x900_clk_enable, \
28 .cken = (1 << _ctrlbit), \
29 }
30
wanzongshundb58e902009-07-14 15:10:43 +010031#define DEFINE_SUBCLK(_name, _ctrlbit) \
32struct clk clk_##_name = { \
33 .enable = w90x900_subclk_enable, \
34 .cken = (1 << _ctrlbit), \
35 }
36
37
wanzongshun0e4a34b2009-06-10 15:50:44 +010038#define DEF_CLKLOOK(_clk, _devname, _conname) \
39 { \
40 .clk = _clk, \
41 .dev_id = _devname, \
42 .con_id = _conname, \
43 }
44