blob: ba174aab76f2cec518b3adfaa1ac692a997fdc46 [file] [log] [blame]
Ben Dooksa21765a2007-02-11 18:31:01 +01001/* linux/include/asm-arm/plat-s3c24xx/clock.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * linux/arch/arm/mach-s3c2410/clock.h
3 *
4 * Copyright (c) 2004-2005 Simtec Electronics
5 * http://www.simtec.co.uk/products/SWLINUX/
6 * Written by Ben Dooks, <ben@simtec.co.uk>
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 version 2 as
10 * published by the Free Software Foundation.
11*/
12
Ben Dooksc3391e32008-10-21 14:06:37 +010013#include <linux/spinlock.h>
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015struct clk {
16 struct list_head list;
17 struct module *owner;
18 struct clk *parent;
19 const char *name;
20 int id;
Ben Dooks2a513ce2006-02-08 21:09:05 +000021 int usage;
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 unsigned long rate;
23 unsigned long ctrlbit;
Ben Dooksd3468da2006-03-20 17:10:04 +000024
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 int (*enable)(struct clk *, int enable);
Ben Dooks6e8908e2006-03-20 21:00:08 +000026 int (*set_rate)(struct clk *c, unsigned long rate);
Ben Dooks92b7eb82006-06-22 22:18:21 +010027 unsigned long (*get_rate)(struct clk *c);
Ben Dooks6e8908e2006-03-20 21:00:08 +000028 unsigned long (*round_rate)(struct clk *c, unsigned long rate);
Ben Dooksd3468da2006-03-20 17:10:04 +000029 int (*set_parent)(struct clk *c, struct clk *parent);
Linus Torvalds1da177e2005-04-16 15:20:36 -070030};
31
32/* other clocks which may be registered by board support */
33
34extern struct clk s3c24xx_dclk0;
35extern struct clk s3c24xx_dclk1;
36extern struct clk s3c24xx_clkout0;
37extern struct clk s3c24xx_clkout1;
38extern struct clk s3c24xx_uclk;
39
Ben Dooks36c64af2006-03-20 21:00:48 +000040extern struct clk clk_usb_bus;
41
Ben Dooks99c13852006-06-22 22:18:20 +010042/* core clock support */
43
44extern struct clk clk_f;
45extern struct clk clk_h;
46extern struct clk clk_p;
Ben Dooks513846f2006-06-24 21:21:29 +010047extern struct clk clk_mpll;
Ben Dooks99c13852006-06-22 22:18:20 +010048extern struct clk clk_upll;
Ben Dooks513846f2006-06-24 21:21:29 +010049extern struct clk clk_xtal;
Ben Dooks99c13852006-06-22 22:18:20 +010050
Linus Torvalds1da177e2005-04-16 15:20:36 -070051/* exports for arch/arm/mach-s3c2410
52 *
53 * Please DO NOT use these outside of arch/arm/mach-s3c2410
54*/
55
Ben Dooksc3391e32008-10-21 14:06:37 +010056extern spinlock_t clocks_lock;
Ben Dooks36c64af2006-03-20 21:00:48 +000057
Ben Dooks99c13852006-06-22 22:18:20 +010058extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
59
Linus Torvalds1da177e2005-04-16 15:20:36 -070060extern int s3c24xx_register_clock(struct clk *clk);
Ben Dooksce89c202007-04-20 11:15:27 +010061extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Ben Dookse4253822008-10-21 14:06:38 +010063extern int s3c24xx_register_baseclocks(unsigned long xtal);
64
65extern void s3c24xx_setup_clocks(unsigned long fclk,
66 unsigned long hclk,
67 unsigned long pclk);
68
69extern void s3c2410_setup_clocks(void);
70extern void s3c2412_setup_clocks(void);
71extern void s3c244x_setup_clocks(void);
72extern void s3c2443_setup_clocks(void);
73