| Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Clock management for AT32AP CPUs | 
|  | 3 | * | 
|  | 4 | * Copyright (C) 2006 Atmel Corporation | 
|  | 5 | * | 
| Andrew Victor | 9d04126 | 2007-02-05 11:42:07 +0100 | [diff] [blame] | 6 | * Based on arch/arm/mach-at91/clock.c | 
| Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 7 | *   Copyright (C) 2005 David Brownell | 
|  | 8 | *   Copyright (C) 2005 Ivan Kokshaysky | 
|  | 9 | * | 
|  | 10 | * This program is free software; you can redistribute it and/or modify | 
|  | 11 | * it under the terms of the GNU General Public License version 2 as | 
|  | 12 | * published by the Free Software Foundation. | 
|  | 13 | */ | 
|  | 14 | #include <linux/clk.h> | 
| Alex Raimondi | 300bb76 | 2008-09-22 21:40:55 +0200 | [diff] [blame] | 15 | #include <linux/list.h> | 
|  | 16 |  | 
|  | 17 |  | 
|  | 18 | void at32_clk_register(struct clk *clk); | 
| Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 19 |  | 
|  | 20 | struct clk { | 
| Alex Raimondi | 300bb76 | 2008-09-22 21:40:55 +0200 | [diff] [blame] | 21 | struct list_head list;		/* linking element */ | 
| Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 22 | const char	*name;		/* Clock name/function */ | 
|  | 23 | struct device	*dev;		/* Device the clock is used by */ | 
|  | 24 | struct clk	*parent;	/* Parent clock, if any */ | 
|  | 25 | void		(*mode)(struct clk *clk, int enabled); | 
|  | 26 | unsigned long	(*get_rate)(struct clk *clk); | 
|  | 27 | long		(*set_rate)(struct clk *clk, unsigned long rate, | 
|  | 28 | int apply); | 
|  | 29 | int		(*set_parent)(struct clk *clk, struct clk *parent); | 
|  | 30 | u16		users;		/* Enabled if non-zero */ | 
|  | 31 | u16		index;		/* Sibling index */ | 
|  | 32 | }; | 
| Alex Raimondi | dd5e133 | 2008-12-09 16:17:13 +0100 | [diff] [blame] | 33 |  | 
|  | 34 | unsigned long pba_clk_get_rate(struct clk *clk); | 
|  | 35 | void pba_clk_mode(struct clk *clk, int enabled); |