ARM: tegra: power: Trim Tegra3 hotplug timings

Bug 945921
Reduce delays in going LP->G and G->Gn

(cherry picked from commit 51b7022f328d955cc4dbbf47b35403ea9c5e3a7b)
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>

Change-Id: I10f68196cb64ea20461000e9b0d64999fd714395
Reviewed-on: http://git-master/r/88169
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
ARM: tegra: dvfs: Expand Tegra3 cpu dvfs tables

Expand Tegra3 cpu dvfs tables to add characterization results
for 800mV VDD_CPU.

Bug 817679
Bug 841336

Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/77936
(cherry picked from commit f5b488019895c83e05ded8a8912cf3eb4eea5686)

Change-Id: Id7e5a46c96c67ca80f552b742cf3cf341bb8e1f0
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/80000
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Conflicts:

	arch/arm/mach-tegra/tegra3_dvfs.c
ARM: tegra: dvfs: Update Tegra3 CPU DVFS tables

Bug 817679
Bug 841336

Change-Id: I9a9d9e7a03b64774b1d2ebd8533be85582827515
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/71755
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

Conflicts:

	arch/arm/mach-tegra/tegra3_clocks.c
	arch/arm/mach-tegra/tegra3_dvfs.c
ARM: tegra: dvfs: Update Tegra3 vdd_core floor

To properly account for voltage steps with 12.5mV resolution, moved
up by 25mV all thresholds in vdd_core floor calculation function, and
replaced "less than or equal" comparison with "less than".

Change-Id: I869ecabf4e25a268fbe279e54026d4fd1bf25db6
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/73903
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Reviewed-on: http://git-master/r/74558
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

Conflicts:

	arch/arm/mach-tegra/tegra3_dvfs.c
ARM: tegra: dvfs: Add Tegra3 x7 CPU dvfs entries

Bug 841336
Reviewed-on: http://git-master/r/76912

Change-Id: I2806c8e4f08af49edf57f00a43438b1503d6aedb
Signed-off-by: Alex Frid <afrid@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/78706
Reviewed-by: Automatic_Commit_Validation_User

Conflicts:

	arch/arm/mach-tegra/tegra3_dvfs.c
ARM: tegra: dvfs: Add Tegra3 x7 core dvfs

- Added Tegra3 x7 core dvfs entries
- Increased EMC, graphics, and UART clocks maximum limits
- Updated PLLC configuration table

Bug 841336
Reviewed-on: http://git-master/r/76942

Change-Id: Ifa235e60d66d959ad589574c5ebde90eb0b65385
Signed-off-by: Alex Frid <afrid@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/78707
Reviewed-by: Automatic_Commit_Validation_User

Conflicts:

	arch/arm/mach-tegra/tegra3_clocks.c
ARM: tegra: dvfs: Expand Tegra3 cpu dvfs tables

Expand Tegra3 cpu dvfs tables to add characterization results
for 800mV VDD_CPU.

Bug 817679
Bug 841336

Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/77936
(cherry picked from commit f5b488019895c83e05ded8a8912cf3eb4eea5686)

Change-Id: Id7e5a46c96c67ca80f552b742cf3cf341bb8e1f0
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/80000
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Conflicts:

	arch/arm/mach-tegra/tegra3_dvfs.c
ARM: tegra: dvfs: Fix Tegra3 cbus limit at 1.35V

Signed-off-by: Alex Frid <afrid@nvidia.com>
(cherry picked from commit e031d09197f7b4214ad035b1acf7d6c39049021e)

Change-Id: Ie3dc75aa2997c52b7e5aa80c35165c8c4284b8ec
Reviewed-on: http://git-master/r/83288
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
ARM: tegra: dvfs: Update T30L and T30SL Vcore min values.

Update T30L and T30SL values Vcore min voltage is now
1.2V when Vcpu >= 1.1V. Old setting was 1.3V.

Bug 841336
Signed-off-by: Gaurav Sarode <gsarode@nvidia.com>

Change-Id: I35202189618cffd4ead1fae3db462c3e970a7ed8
Reviewed-on: http://git-master/r/86912
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Tested-by: Gaurav Sarode <gsarode@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
ARM: tegra3: dvfs: Changed max values of clocks

Changed clock frequency of some clocks as per
Automotive POR.

Bug 882186

Signed-off-by: Mohit Kataria <mkataria@nvidia.com>
Reviewed-on: http://git-master/r/75210
(cherry picked from commit 9cc17e9cddfedc6fe977f103c5e21ae3f82c3496)

Change-Id: Ibb0e79e75c2fca7d9f09d373c163ef08cc636819
Reviewed-on: http://git-master/r/90490
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Mohit Kataria <mkataria@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

Conflicts:

	arch/arm/mach-tegra/tegra3_clocks.c
Revert "ARM: tegra: dvfs: Set Tegra3 VDD_CORE min to 1.1V"

This reverts commit db462754240e2ee6cf85e1253b1475a330ea0dfe -
temporary work-around for bug 870300 is no longer needed.

Change-Id: I3b76c01eef89cd80134210926e6623f0494626dd
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/89874
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
ARM: tegra: dvfs: correct LCD frequency for 1V

Bug 841336

Reviewed-on: http://git-master/r/82996
(cherry picked from commit 5850c8f4968fd7acbb22e377a56a476e37ac5117)

Change-Id: I61d5c1576a6f5caf82b3efec2123c47eb64889b2
Signed-off-by: Ray Poudrier <rapoudrier@nvidia.com>
Reviewed-on: http://git-master/r/88865
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
cpufreq: Export user_policy min/max

Add sysfs nodes for user_policy min and max settings.

Bug 888312

Change-Id: Ife8ec07f8faebc0c04e7ecf6e24976a311bad73b
Reviewed-on: http://git-master/r/72201
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/75882
Reviewed-by: Automatic_Commit_Validation_User
cpufreq: Enforce PM QoS min/max limits

Observe PM QoS CPU frequency minimum and maximum in addition
to policy settings.

Bug 888312

Change-Id: Ia4f60a1649a9952e02f6847c8add3b2ea5d47524
Reviewed-on: http://git-master/r/72207
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/75884
Reviewed-by: Automatic_Commit_Validation_User

Conflicts:

	drivers/cpufreq/cpufreq.c
cpufreq: properly clamp QoS min/max

typically PM QoS clients request the maximum cpu frequency by
setting cpu_freq_min to INT_MAX. Therefore, we need to clamp INT_MAX
to whatever the maximum frequency allowed by the policy to make
the requested cpu_freq_min is same as the maximum allowed cpu
frequency. Inverse logic applies to the cpu_freq_max as well.

Bug 932477

Signed-off-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-on: http://git-master/r/78401
(cherry picked from commit 9688430a621515f3afe3e0ab358ea7ad5aab6d91)

Change-Id: Ie5edcd4a873ed5cce45ec0f9b981f28db6091ff1
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/80002
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
cpufreq interactive governor: Reduce permissions

Reduce permissions on the max_boost and go_maxspeed_load, the init
scripts will change their owner so the current users continue to work.

Bug 906796

Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Reviewed-on: http://git-master/r/79096
(cherry picked from commit f1d91095baff48e58a04af0062f579f394094b47)

Change-Id: Id9542a202bcf02f886cfee9c0bbe69cc83b8c200
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/82726
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>

Conflicts:

	drivers/cpufreq/cpufreq_interactive.c
cpufreq interactive governor: Unify attribute store functions

Change our added attributes' store functions to Google style

Change-Id: I5dc641112085698918e87b52378fe3a5bfe44360
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/84452
Reviewed-by: Satya Popuri <spopuri@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
cpufreq: ondemand: Prevent sysfs create race

Protecting sysfs_remove_group() in CPUFREQ_GOV_STOP with dbs_mutex

Bug 946462

Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/86426
(cherry picked from commit d1131158e2ad4d5ccc53b3008743c29385650d86)

Change-Id: Iae810e83eaa6f0f7d970b56238cbcb61118af610
Reviewed-on: http://git-master/r/87392
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com>

Conflicts:

	drivers/cpufreq/cpufreq_ondemand.c
cpufreq: change min_sample_time

We prefer a min_sample_time of 30ms. This is tied to our cluster switch
and auto-hotplug artificial delays.

Signed-off-by: satya popuri <spopuri@nvidia.com>

original commit message:

cpufreq: reduce min_sample_time

Reduce the minimum amount of time the interactive governor spends at a
frequency before ramping down. This parameter (min_sample_time) was 80ms
now reduced to 30 ms based on perf and power sweep numbers.

Reviewed-on: http://git-master/r/86900 (cherry picked from commit
581f20a5b7b8c3e4ee2c211b28dbc81510af2ae7).
Signed-off-by: satya popuri <spopuri@nvidia.com>

Change-Id: I24f4cd52737950fd4e78a36b4ee34a84551e0e12
Reviewed-on: http://git-master/r/89217
Reviewed-by: Satya Popuri <spopuri@nvidia.com>
Tested-by: Satya Popuri <spopuri@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

Conflicts:

	drivers/cpufreq/cpufreq_interactive.c
Revert "cpufreq: Enforce PM QoS min/max limits"

This reverts commit 6500c229c35f3c31a496f19064d20ac2db8a7527.