/* if moving to higher frequency, up the voltage beforehand */ if (pdata->set_voltage && new_freq > old_freq) {
ret = pdata->set_voltage(idx); if (ret) return ret;
}
ret = clk_set_rate(armclk, new_freq * 1000); if (ret) return ret;
if (cpufreq.asyncclk) {
ret = clk_set_rate(cpufreq.asyncclk, cpufreq.asyncrate); if (ret) return ret;
}
/* if moving to lower freq, lower the voltage after lowering freq */ if (pdata->set_voltage && new_freq < old_freq)
pdata->set_voltage(idx);
return0;
}
staticint davinci_cpu_init(struct cpufreq_policy *policy)
{ int result = 0; struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data; struct cpufreq_frequency_table *freq_table = pdata->freq_table;
if (policy->cpu != 0) return -EINVAL;
/* Finish platform specific initialization */ if (pdata->init) {
result = pdata->init(); if (result) return result;
}
if (!pdata) return -EINVAL; if (!pdata->freq_table) return -EINVAL;
cpufreq.dev = &pdev->dev;
cpufreq.armclk = clk_get(NULL, "arm"); if (IS_ERR(cpufreq.armclk)) {
dev_err(cpufreq.dev, "Unable to get ARM clock\n"); return PTR_ERR(cpufreq.armclk);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.