CHROMIUM: ARM: dts: kitty: change pwm period

Change the pwm frequency from 1KHz to 23KHz.

BUG=chrome-os-partner:34151
TEST=emerge-nyan_kitty, measure the pwm frequency.

Change-Id: Icb5b88d5fc82aed03c1c5818b96cf6d03e8c4edc
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/232178
Tested-by: Titan Lee <titanlee@nvidia.com>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
UPSTREAM: cpufreq / intel_pstate: Fix max_perf_pct on resume

If the system is suspended while max_perf_pct is less than 100 percent
or no_turbo set policy->{min,max} will be set incorrectly with scaled
values which turn the scaled values into hard limits.

References: https://bugzilla.kernel.org/show_bug.cgi?id=61241
Reported-by: Patrick Bartels <petzicus@googlemail.com>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 52e0a509e5d6f902ec26bc2a8bb02b137dc453be)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>

BUG=chromium:435372
TEST=With entire patch series, on Squawks w/N2830 SKU:
     cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
     and
     cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq
     both report 2.41 GHz
TEST=echo 50 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
     cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
      -> 50
     powerd_dbus_suspend
     echo 100 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
     cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
      -> 100

Change-Id: If92a2962c7ada0f8ad12ec89ecc214746ac60220
Reviewed-on: https://chromium-review.googlesource.com/231190
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
Commit-Queue: Ullysses A Eoff <ullysses.a.eoff@intel.com>
UPSTREAM: intel_pstate: Take core C0 time into account for core busy calculation

Take non-idle time into account when calculating core busy time.
This ensures that intel_pstate will notice a decrease in load.

References: https://bugzilla.kernel.org/show_bug.cgi?id=66581
Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit fcb6a15c2e7e76d493e6f91ea889ab40e1c643a4)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>

BUG=chromium:435372
TEST=With entire patch series, on Squawks w/N2830 SKU:
     cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
     and
     cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq
     both report 2.41 GHz

Change-Id: I2c4aeff3a178af803bdb3a3baf659c5fa403bcf3
Reviewed-on: https://chromium-review.googlesource.com/231191
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
Commit-Queue: Ullysses A Eoff <ullysses.a.eoff@intel.com>
UPSTREAM: intel_pstate: Change busy calculation to use fixed point math.

Commit fcb6a15c2e (intel_pstate: Take core C0 time into account for
core busy calculation) introduced a regression on some processor SKUs
supported by intel_pstate. This was due to the truncation caused by
using integer math to calculate core busy and C0 percentages.

On a i7-4770K processor operating at 800Mhz going to 100% utilization
the percent busy of the CPU using integer math is 22%, but it actually
is 22.85%.  This value scaled to the current frequency returned 97
which the PID interpreted as no error and did not adjust the P state.

Tested on i7-4770K, i7-2600, i5-3230M.

Fixes: fcb6a15c2e7e (intel_pstate: Take core C0 time into account for core busy calculation)
References: https://lkml.org/lkml/2014/2/19/626
References: https://bugzilla.kernel.org/show_bug.cgi?id=70941
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit e66c176837462928a05a135bbe16cdce70536d6e)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>

BUG=chromium:435372
TEST=With entire patch series, on Squawks w/N2830 SKU:
     cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
     and
     cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq
     both report 2.41 GHz

Change-Id: I16af5176a82982a199a5c91f900ff96082fb16de
Reviewed-on: https://chromium-review.googlesource.com/231192
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
Commit-Queue: Ullysses A Eoff <ullysses.a.eoff@intel.com>
UPSTREAM: intel_pstate: Fix BYT frequency reporting

BYT has a different conversion from P state to frequency than the core
processors.  This causes the min/max and current frequency to be
misreported on some BYT SKUs. Tested on BYT N2820, Ivybridge and
Haswell processors.

Link: https://bugzilla.yoctoproject.org/show_bug.cgi?id=6663
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit b27580b05e6f5253228debc60b8ff4a786ff573a)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>

BUG=chromium:435372
TEST=With entire patch series, on Squawks w/N2830 SKU:
     cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
     and
     cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq
     both report 2.41 GHz

Change-Id: Ib3b640e33667a3e59940ccac438024c99e9dd65b
Reviewed-on: https://chromium-review.googlesource.com/231141
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
Commit-Queue: Ullysses A Eoff <ullysses.a.eoff@intel.com>