Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cpu-freq.h
Go to the documentation of this file.
1 /* arch/arm/plat-samsung/include/plat/cpu-freq.h
2  *
3  * Copyright (c) 2006-2007 Simtec Electronics
4  * http://armlinux.simtec.co.uk/
5  * Ben Dooks <[email protected]>
6  *
7  * S3C CPU frequency scaling support - driver and board
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12 */
13 
14 #include <linux/cpufreq.h>
15 
16 struct s3c_cpufreq_info;
17 struct s3c_cpufreq_board;
18 struct s3c_iotimings;
19 
35 struct s3c_freq {
36  unsigned long fclk;
37  unsigned long armclk;
38  unsigned long hclk_tns; /* in 10ths of ns */
39  unsigned long hclk;
40  unsigned long pclk;
41 };
42 
64  struct s3c_freq old;
65  struct s3c_freq new;
66 
67  unsigned int pll_changing:1;
68 };
69 
70 #define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs)
71 
81 struct s3c_clkdivs {
82  int p_divisor;
83  int h_divisor;
85  unsigned char dvs;
86 };
87 
88 #define PLLVAL(_m, _p, _s) (((_m) << 12) | ((_p) << 4) | (_s))
89 
95 struct s3c_pllval {
96  unsigned long freq;
97  unsigned long pll_reg;
98 };
99 
120  unsigned int refresh;
121  unsigned int auto_io:1; /* automatically init io timings. */
122  unsigned int need_io:1; /* set if needs io timing support. */
123 
124  /* any non-zero field in here is taken as an upper limit. */
125  struct s3c_freq max; /* frequency limits */
126 };
127 
128 /* Things depending on frequency scaling. */
129 #ifdef CONFIG_CPU_FREQ_S3C
130 #define __init_or_cpufreq
131 #else
132 #define __init_or_cpufreq __init
133 #endif
134 
135 /* Board functions */
136 
137 #ifdef CONFIG_CPU_FREQ_S3C
138 extern int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board);
139 #else
140 
141 static inline int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board)
142 {
143  return 0;
144 }
145 #endif /* CONFIG_CPU_FREQ_S3C */