clock.h 2.3 KB
Newer Older
1
/* linux/arch/arm/plat-s3c/include/plat/clock.h
L
Linus Torvalds 已提交
2 3 4 5 6 7 8 9 10 11
 *
 * Copyright (c) 2004-2005 Simtec Electronics
 *	http://www.simtec.co.uk/products/SWLINUX/
 *	Written by Ben Dooks, <ben@simtec.co.uk>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
*/

12 13
#include <linux/spinlock.h>

L
Linus Torvalds 已提交
14 15 16 17 18 19
struct clk {
	struct list_head      list;
	struct module        *owner;
	struct clk           *parent;
	const char           *name;
	int		      id;
20
	int		      usage;
L
Linus Torvalds 已提交
21 22
	unsigned long         rate;
	unsigned long         ctrlbit;
23

L
Linus Torvalds 已提交
24
	int		    (*enable)(struct clk *, int enable);
25
	int		    (*set_rate)(struct clk *c, unsigned long rate);
26
	unsigned long	    (*get_rate)(struct clk *c);
27
	unsigned long	    (*round_rate)(struct clk *c, unsigned long rate);
28
	int		    (*set_parent)(struct clk *c, struct clk *parent);
L
Linus Torvalds 已提交
29 30 31 32 33 34 35 36 37 38
};

/* other clocks which may be registered by board support */

extern struct clk s3c24xx_dclk0;
extern struct clk s3c24xx_dclk1;
extern struct clk s3c24xx_clkout0;
extern struct clk s3c24xx_clkout1;
extern struct clk s3c24xx_uclk;

39 40
extern struct clk clk_usb_bus;

41 42 43 44 45
/* core clock support */

extern struct clk clk_f;
extern struct clk clk_h;
extern struct clk clk_p;
46
extern struct clk clk_mpll;
47
extern struct clk clk_upll;
48
extern struct clk clk_epll;
49
extern struct clk clk_xtal;
50 51 52
extern struct clk clk_ext;

/* S3C64XX specific clocks */
W
Werner Almesberger 已提交
53
extern struct clk clk_h2;
54 55
extern struct clk clk_27m;
extern struct clk clk_48m;
56

L
Linus Torvalds 已提交
57 58 59 60 61
/* exports for arch/arm/mach-s3c2410
 *
 * Please DO NOT use these outside of arch/arm/mach-s3c2410
*/

62
extern spinlock_t clocks_lock;
63

64 65
extern int s3c2410_clkcon_enable(struct clk *clk, int enable);

L
Linus Torvalds 已提交
66
extern int s3c24xx_register_clock(struct clk *clk);
67
extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
L
Linus Torvalds 已提交
68

69 70
extern int s3c24xx_register_baseclocks(unsigned long xtal);

71 72
extern void s3c64xx_register_clocks(void);

73 74 75 76 77 78 79 80 81
extern void s3c24xx_setup_clocks(unsigned long fclk,
				 unsigned long hclk,
				 unsigned long pclk);

extern void s3c2410_setup_clocks(void);
extern void s3c2412_setup_clocks(void);
extern void s3c244x_setup_clocks(void);
extern void s3c2443_setup_clocks(void);

82 83 84
/* S3C64XX specific functions and clocks */

extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable);
85 86 87 88 89

/* Init for pwm clock code */

extern void s3c_pwmclk_init(void);