msm: 8660: Remove the PMEM audio devices

Move the PMEM audio device under USE_ION config ifdef
so that audio does not excercise any PMEM related devices.

Change-Id: I962e22db86a6b542d3d28ae2f0f0ee073d2b5902
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
msm: 8660: include msm-specific ion header

All msm_ion clients need to use <linux/msm_ion.h> instead of
<linux/ion.h>

Change-Id: I9a6e95048b9c7a89e6a01c456a36a315ce79e64b
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: 8660: include msm-specific ion header

All msm_ion clients need to use <linux/msm_ion.h> instead of
<linux/ion.h>

Change-Id: I8572215d3826824044e71f624143d612637dd4b2
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: audio: change ion kernel map function and flags.

Change-Id: I6aa6ba95beb05d560dd4fa25b1964aefbaff3e56
lib: genalloc: Change chunk allocation to vmalloc

Change the chunk allocation from kmalloc to vmalloc for
allocations greater than a page. This allows large
chunks to be allocated from physically non-contiguous
memory and increases the chance of the allocation
succeeding.

CRs-fixed: 387655
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit 0614b96dc8e4c8a0dd0db41aec5a79daa3bdf091)

Conflicts:

	lib/genalloc.c

Change-Id: Ic0dedbad9d277d0842591b1f075ce3b80c8c05de
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
cpufreq: Add a boostpulse interface to ondemand

For applications that require a one-shot increase in frequency,
the boostpulse interface would help to scale to max for the time
specified in boostime. This helps applications that currently
increases scaling_min_freq and resets later after a fixed duration.
Instead of changing scaling_min_freq applications can directly write
to boostpulse and governer resets during regular timer after the time
expires.

Change-Id: Ie5f490ff06b41364aa76dd468573433495da28a4
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: Add cpu utilization statistics to aid decisions made by userspace.

Understanding system load as seen by cpufreq can help userspace
algorithms make better decisions to improve system responsiveness.
One such example would be the MP decision algorithm which mines
various system info to make decisions on hotplugging in/out
the additional cores.

Signed-off-by: Anitha Anand <anithas@codeaurora.org>
(cherry picked from commit cbeef6aafc4964c4a6cfafd26b23eaccd40804b4)

Change-Id: I8a5fb95380af898076fe0e246fb21e3aa48b33b1
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
cpufreq: fix utilization statistics for sync cpus

If the cpus are using related_cpus policy, then the
current implementaion will overwrite the the calculated
load for every iteration in the for loop. Hence, mpdecision
will read incorrect value, if the cores are using related
cpus policy. With this change mpdecision will read the
sum of the loads of all cpu's, if related cpu policy is
used.

Change-Id: I242c8fe39fd75dc3e48750a5b78a5d218b536ddd
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
cpufreq: notify avg load for short sampling_rate

If the sampling rate is less than 50ms reporting
the actual load may lead to poor decision making
at user space. So, for sampling rates less than 50ms
report the average of load across two samples.

Change-Id: I0d1cf00801732bee8e4380158d7e892758226594
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: boost the sampling rate on touch event

For better Ux responsiveness ondemand sampling rate
needs to be 20ms. But, a 20ms sampling rate increases power
consumption. So, boost the sampling rate to 20ms on every
touch event for 2.5 ms and later reset to default rate.
Also, change sampling down factor proportional to the
sampling rate.

Change-Id: I111b1cf3b8ed133347149afc34d329d0384ecfcb
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: ondemand: Fix the boostpulse interface

  * Boostpulse was not working because no default frequency was set.
  * We don't need an input handler to push the freq to max, userspace
    does a better job with the Power HAL.
  * Tweak boost time to 500ms

Change-Id: Ice8c26b758747d265976263296a2da3380b864f7
Revert "Kernel: Battery status Shows wrong capacity."

This reverts commit ba81378a234aba56088ed9a5e71e2644ab9d0535.

Change-Id: I5f866d082049ab3318d11d05857e57e6750d9dc5
Revert "power: pm8921-charger: do not open OVP when USB is suspended"

This reverts commit 64c89ccf93aa2d03dab92bc3324e3be822502939.

Change-Id: I7432921d8ea0f6e4f677bb6fb6b92ce15c03cc35
Revert "Revert "power: bms: add desay calibration data""

This reverts commit 0a988954cb0f9140779c7a2893237297b6205138.

Change-Id: I147b511461ea941bf3ecfeb375181654b987d31c
Revert "Revert "msm: 8960/8064: robust battery detection""

This reverts commit 0ada7951ca6d286cf5484eca723905028ad88db3.

Change-Id: Ib4cc442ada9568e9b0a0e4d5f2c301e5b71acd9a
Revert "Revert "power: bms: split battery data for different battery""

This reverts commit eed37aec6f371c495f9f0f0a085dbe1bfccb8564.

Change-Id: I3e17ab59567e50dde8e70ede41f70b044f34d29a
Revert "Revert "power: pm8921-bms: add delta param to bms""

This reverts commit 37faadc5ec8ef89d28577a02cd2d910fc6fe4d48.

Change-Id: I63e3256f978fce5fff04def2ff742a5d31849a09
usb: otg: Add support for power supply API for USB charging

With this commit, USB Driver will start using Power Supply
API rather than calling direct pmxxx driver API for USB charging.
This will allow hiding specific charger model (such as
external LTC4088 charger used for MDM9x15) from USB driver.

In case the power supply API is not support, fallback to legacy
API which uses pm8921 driver.

Change-Id: Ic0f302e3aa8aa60f6483a0fdeec9389a0ded1fac
Signed-off-by: Amit Blay <ablay@codeaurora.org>
(cherry picked from commit 0f7edf7796c170f8dc4d87e71dcd77c24c93c39a)

Conflicts:

	drivers/usb/otg/msm_otg.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
USB: OTG: remove pm8921_set_usb_power_supply_type

This custom notifier is no longer required to determine
wether a wall charger is connected to the PM8921 charger
or not.

The pm8921-charger driver determines AC charging solely
dependent upon maximum input current from the charging
device.

CRs-Fixed: 339841
Change-Id: I564fa01c61286d013be6b263d038e87568a297f2
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
(cherry picked from commit 34b874562012c3453da20059094992140ca1ea61)

Conflicts:

	drivers/usb/otg/msm_otg.c

Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
USB: OTG: Reduce ACA ID polling timer period

The current ACA ID timer period is 2 sec. If charger is plugged
in or removed, the UI update will take 2 sec in the worst case.
Reduce the current period from 2 sec to 500 msec for better
UI experience.

CRs-Fixed: 346923
Change-Id: Iea768b326491e4cc3dd49916a022c7445c7c4c8c
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>