blob: b88a1b16b2e965b29c88417b0c153e662a382e5f [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
Jean-Christop PLAGNIOL-VILLARD6d803ba2010-11-17 10:04:33 +010013#include <linux/clkdev.h>
wanzongshun0e4a34b2009-06-10 15:50:44 +010014
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 +010017
18struct clk {
19 unsigned long cken;
20 unsigned int enabled;
21 void (*enable)(struct clk *, int enable);
22};
23
24#define DEFINE_CLK(_name, _ctrlbit) \
25struct clk clk_##_name = { \
wanzongshun35c92212009-08-21 07:07:46 +010026 .enable = nuc900_clk_enable, \
wanzongshun0e4a34b2009-06-10 15:50:44 +010027 .cken = (1 << _ctrlbit), \
28 }
29
wanzongshundb58e902009-07-14 15:10:43 +010030#define DEFINE_SUBCLK(_name, _ctrlbit) \
31struct clk clk_##_name = { \
wanzongshun35c92212009-08-21 07:07:46 +010032 .enable = nuc900_subclk_enable, \
wanzongshundb58e902009-07-14 15:10:43 +010033 .cken = (1 << _ctrlbit), \
34 }
35
36
wanzongshun0e4a34b2009-06-10 15:50:44 +010037#define DEF_CLKLOOK(_clk, _devname, _conname) \
38 { \
39 .clk = _clk, \
40 .dev_id = _devname, \
41 .con_id = _conname, \
42 }
43