aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string_helpers.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@nokia.com>2011-03-24 02:45:11 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-03-24 02:50:31 -0400
commit903427955b9ffe1ca4b76c510089774c3b7a4a8a (patch)
treeafa8c53b62bcf460203e6f9fd2648117b0443696 /lib/string_helpers.c
parentddca6a31345cbea8c7c907e6b7e016339cbb6342 (diff)
Input: tsc2005 - use relative jiffies to schedule the watchdog
Use relative jiffies to schedule the watchdog. Otherwise it will run like a mad one. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions
s Torvalds <torvalds@ppc970.osdl.org> 2005-04-16 18:20:36 -0400 Linux-2.6.12-rc2' href='/cgit/cgit.cgi/litmus-rt-ext-res.git/commit/arch/sh/kernel/cpufreq.c?id=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2'>1da177e4c3f4
1da177e4c3f4
cb5ec75b8b04
1da177e4c3f4
ecbef17adbbb
1da177e4c3f4
4e57b6817880
cb5ec75b8b04
3bccf467727c

1da177e4c3f4
3bccf467727c
1da177e4c3f4
cb5ec75b8b04
1da177e4c3f4
3bccf467727c
1da177e4c3f4

1da177e4c3f4


cb5ec75b8b04


1da177e4c3f4
cb5ec75b8b04
3bccf467727c
1da177e4c3f4

ecbef17adbbb
cb5ec75b8b04
1da177e4c3f4
1da177e4c3f4
59a2f7d9fd41
1da177e4c3f4


ecbef17adbbb

cb5ec75b8b04

1da177e4c3f4
cb5ec75b8b04


ecbef17adbbb
1da177e4c3f4
cb5ec75b8b04



8fec051eea73
59a2f7d9fd41
cb5ec75b8b04
8fec051eea73
1da177e4c3f4
ecbef17adbbb
cb5ec75b8b04
1da177e4c3f4


1bcfc723c868








be49e3465f22
1bcfc723c868



be49e3465f22
1bcfc723c868


1da177e4c3f4

3bccf467727c

1bcfc723c868
ecbef17adbbb
3bccf467727c
ecbef17adbbb


cb5ec75b8b04
ecbef17adbbb
cb5ec75b8b04

1da177e4c3f4
1bcfc723c868

1a565cf07fa1
1bcfc723c868
c25d01b3e240


1bcfc723c868
1a565cf07fa1


eb2f50ff93f0
1a565cf07fa1
eb2f50ff93f0
1a565cf07fa1
cb5ec75b8b04
1da177e4c3f4
1bcfc723c868

ecbef17adbbb
cb5ec75b8b04
ecbef17adbbb
cb5ec75b8b04
1da177e4c3f4
cb5ec75b8b04

1da177e4c3f4
1bcfc723c868
cb5ec75b8b04
1bcfc723c868

cb5ec75b8b04
cb5ec75b8b04
1bcfc723c868
1da177e4c3f4



cb5ec75b8b04
cb5ec75b8b04
1bcfc723c868



a8f64decf383
1da177e4c3f4

cb5ec75b8b04
1da177e4c3f4
ecbef17adbbb
cb5ec75b8b04
1da177e4c3f4

cb5ec75b8b04
1da177e4c3f4



cb5ec75b8b04

1da177e4c3f4



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
  

                                            
                                       

                                 






                                                                             
   

                                   



                          
                       
                      
                          
                      
                      
                                                        
                      

                         
 
                                             
 
                                                    
 
                                                                     

 


                                                                            


                                                           
 
                                       
                                                      

                                   
                           
                  
 
                                             
                                                       


                                          

                                  

                                                          
 


                                                                       
                                                                        
 



                                              
                                                      
                                                     
                                   
                                                       
 
                                                     
 


                 








                                                                          
                                                 



                                                                  
                                                 


                 

                                                             

                                                      
                                                   
                           
 


                                         
                             
                                                       

                                       
 

                                                                  
                           
 


                                                                             
                


                                                                         
                                                        
                                                                 
                                                        
                                                                    
         
 

                                                             
                                                               
                                        
                                                      
                                                       
 

                 
 
                                                             
 

                                                      
 
                        
 



                                                  
                               
                                         



                                              
                                               

  
                                              
 
                                                    
                                                           

 
                                               



                                                      

                                    



                                                  
/*
 * cpufreq driver for the SuperH processors.
 *
 * Copyright (C) 2002 - 2012 Paul Mundt
 * Copyright (C) 2002 M. R. Brown
 *
 * Clock framework bits from arch/avr32/mach-at32ap/cpufreq.c
 *
 *   Copyright (C) 2004-2007 Atmel Corporation
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */
#define pr_fmt(fmt) "cpufreq: " fmt

#include <linux/types.h>
#include <linux/cpufreq.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/cpumask.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/sched.h>	/* set_cpus_allowed() */
#include <linux/clk.h>
#include <linux/percpu.h>
#include <linux/sh_clk.h>

static DEFINE_PER_CPU(struct clk, sh_cpuclk);

static unsigned int sh_cpufreq_get(unsigned int cpu)
{
	return (clk_get_rate(&per_cpu(sh_cpuclk, cpu)) + 500) / 1000;
}

/*
 * Here we notify other drivers of the proposed change and the final change.
 */
static int sh_cpufreq_target(struct cpufreq_policy *policy,
			     unsigned int target_freq,
			     unsigned int relation)
{
	unsigned int cpu = policy->cpu;
	struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu);
	cpumask_t cpus_allowed;
	struct cpufreq_freqs freqs;
	struct device *dev;
	long freq;

	cpus_allowed = current->cpus_allowed;
	set_cpus_allowed_ptr(current, cpumask_of(cpu));

	BUG_ON(smp_processor_id() != cpu);

	dev = get_cpu_device(cpu);

	/* Convert target_freq from kHz to Hz */
	freq = clk_round_rate(cpuclk, target_freq * 1000);

	if (freq < (policy->min * 1000) || freq > (policy->max * 1000))
		return -EINVAL;

	dev_dbg(dev, "requested frequency %u Hz\n", target_freq * 1000);