Re: [PATCH] cpufreq: add frequency table to at32ap driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Around Tue 13 Aug 2013 10:38:14 +0530 or thereabout, Viresh Kumar wrote:
> On 13 August 2013 00:40, Hans-Christian Egtvedt <egtvedt@xxxxxxxxxxxx> wrote:
>> This patch adds a dynamically calculated frequency table to the at32ap driver.
>> In short the architecture can scale in power of two between a maximum and
>> minimum frequency. Min, max, and the steps in between are added to the table.
>>
>> Signed-off-by: Hans-Christian Egtvedt <egtvedt@xxxxxxxxxxxx>
>> ---
>>  drivers/cpufreq/at32ap-cpufreq.c | 47 +++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 46 insertions(+), 1 deletion(-)

<snipp diff>

> Thanks for your patch, I have folded below patch with your patch while
> applying..
> 
> diff --git a/drivers/cpufreq/at32ap-cpufreq.c b/drivers/cpufreq/at32ap-cpufreq.c
> index eaac7cb..c586d3e 100644
> --- a/drivers/cpufreq/at32ap-cpufreq.c
> +++ b/drivers/cpufreq/at32ap-cpufreq.c
> @@ -87,10 +87,8 @@ static int at32_set_target(struct cpufreq_policy *policy,
> 
>  static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
>  {
> -       unsigned int frequency;
> -       int retval;
> -       int steps;
> -       int i;
> +       unsigned int frequency, rate;
> +       int retval, steps, i;
> 
>         if (policy->cpu != 0)
>                 return -EINVAL;
> @@ -126,20 +124,23 @@ static int __init
> at32_cpufreq_driver_init(struct cpufreq_policy *policy)
> 
>         frequency = policy->cpuinfo.max_freq;
>         for (i = 0; i < (steps - 1); i++) {
> -               unsigned int rate = clk_round_rate(cpuclk, frequency * 1000);
> -               rate /= 1000;
> +               rate = clk_round_rate(cpuclk, frequency * 1000) / 1000;
> +
>                 if (rate != frequency)
>                         freq_table[i].frequency = CPUFREQ_ENTRY_INVALID;
>                 else
>                         freq_table[i].frequency = frequency;
> +
>                 frequency /= 2;
>         }
> +
>         freq_table[steps - 1].frequency = CPUFREQ_TABLE_END;
> 
>         retval = cpufreq_frequency_table_cpuinfo(policy, freq_table);
>         if (retval)
>                 goto out_err_kfree;
> 
> +       cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
>         printk("cpufreq: AT32AP CPU frequency driver\n");
> 
>         return 0;
> 

Acked-by: Hans-Christian Egtvedt <egtvedt@xxxxxxxxxxxx>

-- 
mvh
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux