blob: f5816a06eed6aa415bffd21b5dbd708266d404dc [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
wanzongshun35c92212009-08-21 07:07:46 +010015void nuc900_clk_enable(struct clk *clk, int enable);
16void nuc900_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 = { \
wanzongshun35c92212009-08-21 07:07:46 +010027 .enable = nuc900_clk_enable, \
wanzongshun0e4a34b2009-06-10 15:50:44 +010028 .cken = (1 << _ctrlbit), \
29 }
30
wanzongshundb58e902009-07-14 15:10:43 +010031#define DEFINE_SUBCLK(_name, _ctrlbit) \
32struct clk clk_##_name = { \
wanzongshun35c92212009-08-21 07:07:46 +010033 .enable = nuc900_subclk_enable, \
wanzongshundb58e902009-07-14 15:10:43 +010034 .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