Merge branch 'upstream/wm8974' into for-2.6.33
[pandora-kernel.git] / arch / arm / mach-u300 / clock.h
1 /*
2  * arch/arm/mach-u300/include/mach/clock.h
3  *
4  * Copyright (C) 2004 - 2005 Nokia corporation
5  * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6  * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7  * Copyright (C) 2007-2009 ST-Ericsson AB
8  * Adopted to ST-Ericsson U300 platforms by
9  * Jonas Aaberg <jonas.aberg@stericsson.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2 as
13  * published by the Free Software Foundation.
14  *
15  */
16
17 #ifndef __MACH_CLOCK_H
18 #define __MACH_CLOCK_H
19
20 #include <linux/clk.h>
21
22 struct clk {
23         struct list_head node;
24         struct module *owner;
25         struct device *dev;
26         const char *name;
27         struct clk *parent;
28
29         spinlock_t lock;
30         unsigned long rate;
31         bool reset;
32         __u16 clk_val;
33         __s8 usecount;
34         __u32 res_reg;
35         __u16 res_mask;
36
37         bool hw_ctrld;
38
39         void (*recalc) (struct clk *);
40         int (*set_rate) (struct clk *, unsigned long);
41         unsigned long (*get_rate) (struct clk *);
42         unsigned long (*round_rate) (struct clk *, unsigned long);
43         void (*init) (struct clk *);
44         void (*enable) (struct clk *);
45         void (*disable) (struct clk *);
46 };
47
48 void u300_clock_primecells(void);
49 void u300_unclock_primecells(void);
50 void u300_enable_intcon_clock(void);
51 void u300_enable_timer_clock(void);
52
53 #endif