lkml.org 
[lkml]   [2016]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpufreq: brcmstb-cpufreq: CPUfreq driver for older Broadcom STB SoCs
On 17-11-16, 10:38, Markus Mayer wrote:
> No, because I am trying to find the lowest frequency that doesn't
> require safe mode and it's looping through the table from highest to
> lowest. So there could still be a lower frequency after the current
> one that doesn't require safe mode.
>
> What I can do, however, is something like this:
>
> static ssize_t show_brcmstb_safe_freq(struct cpufreq_policy *policy, char *buf)
> {
> struct cpufreq_frequency_table *entry;
> unsigned int safe_freq = 0;
>
> cpufreq_for_each_valid_entry(entry, policy->freq_table) {
> if (!(entry->driver_data & BRCMSTB_TBL_SAFE_MODE))
> safe_freq = entry->frequency;
> }
>
> return sprintf(buf, "%u\n", safe_freq);
> }
>
> This is using the existing data from the frequency table rather than
> re-generating it on the fly by calling freq_requires_safe_mode().


> All my allocations are managed (i.e. using devm* functions), so
> cleanup should be automatic. Do I still need one?


> It's using for a clock node (brcm,brcmstb-cpu-clk-div) which exists
> independently of this driver.

All these seem fine to me.

--
viresh

\
 
 \ /
  Last update: 2016-11-18 04:10    [W:0.127 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site