Skip to content

Commit

Permalink
UID_CPUTIME: restore func
Browse files Browse the repository at this point in the history
  • Loading branch information
clamor-s committed Aug 6, 2017
1 parent 9998f31 commit 27c35a3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions arch/arm/mach-tegra/board-cardhu-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,3 +1331,32 @@ void tegra_booting_info(void )
printk("tegra_booting_info-normal\n");
}
}

int cpufreq_stats_platform_cpu_power_read_tables(int cpunum, u32 *out_values, size_t num)
{
static const u32 powerVals[] = {100000, 107000, 116000, 123000, 135000, 138000, 142000, 148000, 150000, 153000, 156000, 160000, 163000, 166000, 170000};
static const u32 cpuWeights[4] = {16384, 6717, 7700, 8847};
int i, numVals = sizeof(powerVals) / sizeof(*powerVals), numCpus = sizeof(cpuWeights) / sizeof(*cpuWeights);

/*
* Our data source (power_profile.xml) only gives us values for 1st core,
* and not per core as requested, so we weigh these. With weights: 100%, 54%.
* This is the same thing as what hammerhead does (for 1st and last core), for
* better or worse.
*/

if (num > numVals) {
pr_err("cpufreq_stats_platform_cpu_power_read_tables asked for too many values (wanted %u have %u)\n", (int)num, numVals);
return -1;
}

if (cpunum > numCpus) {
pr_err("cpufreq_stats_platform_cpu_power_read_tables asked for too many CPUs (wanted %u have %u)\n", cpunum, numCpus);
return -2;
}

for (i = 0; i < num; i++)
*out_values++ = powerVals[i] * cpuWeights[cpunum] >> 14;

return 0;
}

0 comments on commit 27c35a3

Please sign in to comment.