bt: Fix sizeof-pointer-memaccess warning

This patch fixes wrong memcpy size when copying ltk value to
HCI_OP_LE_LTK_REPLY command.

Change-Id: I44e5e3da15369d4b424581720ccd3bac820ef2e0
cpufreq: Introduce CPU-boost framework

The CPU-boost framework allows you to place hooks in various drivers to boost the CPU for either a specified duration or indefinitely (until it is manually unboosted). If a new boost request is sent while the CPU is boosted then the new boost request will take precedence and immediately override the current boost.

Signed-off-by: Sultanxda <sultanxda@gmail.com>

Conflicts:
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
cpu_boost: Respect max frequency

If the requested boost frequency is greater than the maxfreq then reduce the boost to 2 steps below the current maxfreq (108MHz below the current maxfreq). If the maxfreq is 486MHz or lower then the boost will be canceled.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
cpu_boost: Add sysfs interface
i2c: gp2a_proximity: Disable CPU-boost when proximity sensor is open

When proximity sensor is open, we are expecting the screen to be turning on and off rapidly. Disable CPU-boost when this happens so the CPU isn't boosted every time the screen turns on.

Signed-off-by: Sultanxda <sultanxda@gmail.com>

Conflicts:
	drivers/i2c/chips/gp2a_proximity.c
cpu_boost: Fix unbalanced cpufreq_cpu_get

Also, minor clean-up.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
cpu_boost: Only restore minfreq to CPU0

Previously, when a non-primary CPU core was boosted, if it was offline after a boost expired, then the minfreq on that CPU would still be set to the boost frequency. Minfreq is now synced across all cores in msm/cpufreq, so we only need to restore the minfreq to CPU0.

Signed-off-by: Sultanxda <sultanxda@gmail.com>
cpu_boost: Clean up minfreq restoration

Signed-off-by: Sultanxda <sultanxda@gmail.com>

Conflicts:
	drivers/cpufreq/cpu_boost.c
retain_cpu_freq: Rename to retain_cpu_policy

Conflicts:
	arch/arm/configs/wild_defconfig
	arch/arm/mach-msm/cpufreq.c
cpu_boost: derp

Conflicts:
	flashable/tools/updatewild.sh
cpu_boost: Apply retain_cpu_policy logic to boosts

Policies will fall back to cpu0 if unavailable.
retain_cpu_policy: Add a fail-safe

Deliberately NULLify variables if things are failing, so that the checks will catch it.

Conflicts:
	drivers/cpufreq/retain_cpu_policy.c
cpufreq: Add conditions for when retain_cpu_policy is disabled
doubleshot: Support for Android 4.4.4
doubleshot: Add some cpu boost hooks, but disable for now.