2008-10-21 06:06:43 -07:00
|
|
|
/* linux/arch/arm/plat-s3c/include/plat/clock.h
|
2005-04-16 15:20:36 -07:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2008-10-21 06:06:37 -07:00
|
|
|
#include <linux/spinlock.h>
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
struct clk {
|
|
|
|
struct list_head list;
|
|
|
|
struct module *owner;
|
|
|
|
struct clk *parent;
|
|
|
|
const char *name;
|
|
|
|
int id;
|
2006-02-08 14:09:05 -07:00
|
|
|
int usage;
|
2005-04-16 15:20:36 -07:00
|
|
|
unsigned long rate;
|
|
|
|
unsigned long ctrlbit;
|
2006-03-20 10:10:04 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
int (*enable)(struct clk *, int enable);
|
2006-03-20 14:00:08 -07:00
|
|
|
int (*set_rate)(struct clk *c, unsigned long rate);
|
2006-06-22 14:18:21 -07:00
|
|
|
unsigned long (*get_rate)(struct clk *c);
|
2006-03-20 14:00:08 -07:00
|
|
|
unsigned long (*round_rate)(struct clk *c, unsigned long rate);
|
2006-03-20 10:10:04 -07:00
|
|
|
int (*set_parent)(struct clk *c, struct clk *parent);
|
2005-04-16 15:20:36 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
2006-03-20 14:00:48 -07:00
|
|
|
extern struct clk clk_usb_bus;
|
|
|
|
|
2006-06-22 14:18:20 -07:00
|
|
|
/* core clock support */
|
|
|
|
|
|
|
|
extern struct clk clk_f;
|
|
|
|
extern struct clk clk_h;
|
|
|
|
extern struct clk clk_p;
|
2006-06-24 13:21:29 -07:00
|
|
|
extern struct clk clk_mpll;
|
2006-06-22 14:18:20 -07:00
|
|
|
extern struct clk clk_upll;
|
2008-10-21 06:07:00 -07:00
|
|
|
extern struct clk clk_epll;
|
2006-06-24 13:21:29 -07:00
|
|
|
extern struct clk clk_xtal;
|
2008-10-21 06:07:00 -07:00
|
|
|
extern struct clk clk_ext;
|
|
|
|
|
|
|
|
/* S3C64XX specific clocks */
|
|
|
|
extern struct clk clk_27m;
|
|
|
|
extern struct clk clk_48m;
|
2006-06-22 14:18:20 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
/* exports for arch/arm/mach-s3c2410
|
|
|
|
*
|
|
|
|
* Please DO NOT use these outside of arch/arm/mach-s3c2410
|
|
|
|
*/
|
|
|
|
|
2008-10-21 06:06:37 -07:00
|
|
|
extern spinlock_t clocks_lock;
|
2006-03-20 14:00:48 -07:00
|
|
|
|
2006-06-22 14:18:20 -07:00
|
|
|
extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
extern int s3c24xx_register_clock(struct clk *clk);
|
2007-04-20 03:15:27 -07:00
|
|
|
extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-10-21 06:06:38 -07:00
|
|
|
extern int s3c24xx_register_baseclocks(unsigned long xtal);
|
|
|
|
|
2008-10-21 06:07:00 -07:00
|
|
|
extern void s3c64xx_register_clocks(void);
|
|
|
|
|
2008-10-21 06:06:38 -07:00
|
|
|
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);
|
|
|
|
|
2008-10-21 06:07:02 -07:00
|
|
|
/* S3C64XX specific functions and clocks */
|
|
|
|
|
|
|
|
extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable);
|
2008-11-21 03:36:05 -07:00
|
|
|
|
|
|
|
/* Init for pwm clock code */
|
|
|
|
|
|
|
|
extern void s3c_pwmclk_init(void);
|
|
|
|
|