lkml.org 
[lkml]   [2013]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH V2 Resend 19/34] cpufreq: omap: Convert to light weight ->target_index() routine
    Date
    This patch converts existing .target() to newly defined light weight
    .target_index() routine for this driver.

    CPUFreq core will call cpufreq_frequency_table_target() before calling this
    routine and will pass index to it.

    Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
    ---
    drivers/cpufreq/omap-cpufreq.c | 31 +++----------------------------
    1 file changed, 3 insertions(+), 28 deletions(-)

    diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
    index ac552d0..b551271 100644
    --- a/drivers/cpufreq/omap-cpufreq.c
    +++ b/drivers/cpufreq/omap-cpufreq.c
    @@ -51,40 +51,15 @@ static unsigned int omap_getspeed(unsigned int cpu)
    return rate;
    }

    -static int omap_target(struct cpufreq_policy *policy,
    - unsigned int target_freq,
    - unsigned int relation)
    +static int omap_target(struct cpufreq_policy *policy, unsigned int index)
    {
    - unsigned int i;
    int r, ret = 0;
    struct cpufreq_freqs freqs;
    struct dev_pm_opp *opp;
    unsigned long freq, volt = 0, volt_old = 0, tol = 0;

    - if (!freq_table) {
    - dev_err(mpu_dev, "%s: cpu%d: no freq table!\n", __func__,
    - policy->cpu);
    - return -EINVAL;
    - }
    -
    - ret = cpufreq_frequency_table_target(policy, freq_table, target_freq,
    - relation, &i);
    - if (ret) {
    - dev_dbg(mpu_dev, "%s: cpu%d: no freq match for %d(ret=%d)\n",
    - __func__, policy->cpu, target_freq, ret);
    - return ret;
    - }
    - freqs.new = freq_table[i].frequency;
    - if (!freqs.new) {
    - dev_err(mpu_dev, "%s: cpu%d: no match for freq %d\n", __func__,
    - policy->cpu, target_freq);
    - return -EINVAL;
    - }
    -
    freqs.old = omap_getspeed(policy->cpu);
    -
    - if (freqs.old == freqs.new && policy->cur == freqs.new)
    - return ret;
    + freqs.new = freq_table[index].frequency;

    freq = freqs.new * 1000;
    ret = clk_round_rate(mpu_clk, freq);
    @@ -200,7 +175,7 @@ static int omap_cpu_exit(struct cpufreq_policy *policy)
    static struct cpufreq_driver omap_driver = {
    .flags = CPUFREQ_STICKY,
    .verify = cpufreq_generic_frequency_table_verify,
    - .target = omap_target,
    + .target_index = omap_target,
    .get = omap_getspeed,
    .init = omap_cpu_init,
    .exit = omap_cpu_exit,
    --
    1.7.12.rc2.18.g61b472e


    \
     
     \ /
      Last update: 2013-10-18 16:41    [W:4.150 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site