修改系統在sys下面的頻率顯示,在/drivers/cpufreq/cpufreq.c
/**
* cpufreq_per_cpu_attr_read() / show_##file_name() -
* print out cpufreq information
*
* Write out information from cpufreq_driver->policy[cpu]; object must be
* "unsigned int".
*/
#define show_one(file_name, object) \
static ssize_t show_##file_name \
(struct cpufreq_policy *policy, char *buf) \
{ \
return sprintf(buf, "%u\n", policy->object);
\
}
#define show_change(file_name, object) \
static ssize_t show_##file_name \
(unsigned int val, char *buf) \
{ \
return sprintf(buf, "%u\n", 1200000);
\
}
show_one(cpuinfo_min_freq, cpuinfo.min_freq);
//show_one(cpuinfo_max_freq, cpuinfo.max_freq);
show_change(cpuinfo_max_freq, cpuinfo.max_freq); //change by azad for change the freq
show_one(cpuinfo_transition_latency, cpuinfo.transition_latency);
show_one(scaling_min_freq, min);
show_one(scaling_max_freq, max);
//show_one(scaling_cur_freq, cur);
show_change(scaling_cur_freq, cur);
cpuinfo.max_freq 系統的最大頻率
scaling_cur_freq 系統當前的頻率
修改這兩個頻率的的接口,不從系統中讀取,直接寫死