blob: 235b753cd877a94d290201196e9a845be9733853 [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
13struct clk {
14 struct list_head list;
15 struct module *owner;
16 struct clk *parent;
17 const char *name;
18 int id;
Ben Dooks2a513ce2006-02-08 21:09:05 +000019 int usage;
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 unsigned long rate;
21 unsigned long ctrlbit;
Ben Dooksd3468da2006-03-20 17:10:04 +000022
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 int (*enable)(struct clk *, int enable);
Ben Dooks6e8908e2006-03-20 21:00:08 +000024 int (*set_rate)(struct clk *c, unsigned long rate);
Ben Dooks92b7eb82006-06-22 22:18:21 +010025 unsigned long (*get_rate)(struct clk *c);
Ben Dooks6e8908e2006-03-20 21:00:08 +000026 unsigned long (*round_rate)(struct clk *c, unsigned long rate);
Ben Dooksd3468da2006-03-20 17:10:04 +000027 int (*set_parent)(struct clk *c, struct clk *parent);
Linus Torvalds1da177e2005-04-16 15:20:36 -070028};
29
30/* other clocks which may be registered by board support */
31
32extern struct clk s3c24xx_dclk0;
33extern struct clk s3c24xx_dclk1;
34extern struct clk s3c24xx_clkout0;
35extern struct clk s3c24xx_clkout1;
36extern struct clk s3c24xx_uclk;
37
Ben Dooks36c64af2006-03-20 21:00:48 +000038extern struct clk clk_usb_bus;
39
Ben Dooks99c13852006-06-22 22:18:20 +010040/* core clock support */
41
42extern struct clk clk_f;
43extern struct clk clk_h;
44extern struct clk clk_p;
Ben Dooks513846f2006-06-24 21:21:29 +010045extern struct clk clk_mpll;
Ben Dooks99c13852006-06-22 22:18:20 +010046extern struct clk clk_upll;
Ben Dooks513846f2006-06-24 21:21:29 +010047extern struct clk clk_xtal;
Ben Dooks99c13852006-06-22 22:18:20 +010048
Linus Torvalds1da177e2005-04-16 15:20:36 -070049/* exports for arch/arm/mach-s3c2410
50 *
51 * Please DO NOT use these outside of arch/arm/mach-s3c2410
52*/
53
Ben Dooks36c64af2006-03-20 21:00:48 +000054extern struct mutex clocks_mutex;
55
Ben Dooks99c13852006-06-22 22:18:20 +010056extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058extern int s3c24xx_register_clock(struct clk *clk);
Ben Dooksce89c202007-04-20 11:15:27 +010059extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
61extern int s3c24xx_setup_clocks(unsigned long xtal,
62 unsigned long fclk,
63 unsigned long hclk,
64 unsigned long pclk);