msm: msm_bus: Add support for 64-bit bandwidth requests

With 8974, bandwidth requests are exceeding integer size.
Update ab and ib to ensure values over 4Gbps can be requested.
For 64-bit support, there are four changes in this patch:
Changes in the bus driver structures and functions to
update ab and ib values to uint64.
Updates in client drivers to ensure that the bus APIs
are called with the right types.
Updates to the device-tree. Device-tree nodes don't
provide a clean mechanism to read a combination of u32
and u64 variables within the same property name. So, the
ab and ib values must be specified in kbps instead of
bytes/sec from the device tree. The bus driver function
will convert the ab and ib values read from device-tree
to Mbps.
Change the existing property names to make them consistent
with the convention used by the new property  name, which
abides to the Device Tree convention.

Change-Id: Ib0a6db0e221af366c61c51cc21ac722f02cb7a34
CRs-Fixed: 408786
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
msm_fb: display: get mipi frame rate from panel file

If frame rate value for mipi video panel is coded in panel file it can
be directly used to avoid calculation error.

Change-Id: I6ad86226c81da4bcf36196385f9ff4bea0bef0ca
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
power: pm8921-charger: force 19.2Mhz clock before accessing registers

The charger was observed to be in locked up state upon booting up. The
initialization time configurations were being ignored causing charging
to not happen.

Fix this by forcing the charger to run from 19.2Mhz clock prior to
accessing any charger registers. This made the charger come out of the
locked up state and accept writes to it.

Change-Id: I0d86c328d4c7022a3bd46c62cb28b12318053f74
CRs-Fixed: 372383
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
power: pm8921-charger: change BOOT_DONE configuration

Set the BOOT_TIMER_EN bit when writing the
BOOT_DONE configuration. This is required to make
sure the boot timer will be enabled during the
next phone boot.

Change-Id: I0c43de3a0c285979f7bccd42e464ca0d2fbbe42a
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
ASoC: core: Update ALSA core  to issue restart in underrun.

When compressed and pcm session is started the buffer pull will
Be from the DSP, in mmap mode for the scenario Hardware pointer
Is same as application pointer implies application has not filled the
Buffer to be send to DSP, and platform driver has to break and restart
The de queue process when the application has sufficient buffers.

When hardware pointer is same as application pointer it is an under run
Scenario where the ALSA framework has to trigger the under run and in HAL
The session has to re-prepare and re-triggered. based on the stop
Threshold, but in our system the stop threshold is INT_MAX which
Indicates that under run is not triggered in practical cases.

We have a brodcast usecase in which the mentioned under run case
Is hit mulitple times, and every time re-prepare and re-trigger will be
Expensive

Update the ASoC core framework to restart de queue process stopped
By platform Driver when the under run is hit, based on the available
Buffer and render flag, so the System will recover from the hang state.

To restart de queue process the ASoC core will be calling the restart
Callback registered by platform driver and this callback will be running in
Atomic context.

Change-Id: Ic9ea05a0dc6246346e9913493232882e2f5447d1
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
ASoC: msm: Fixes for underrun issue in LPA Playback

Update LPA platform driver to register restart callback.
The implementation of the callback is to issue a pending buffer
written by the application to restart the session when the dequeue
process is stopped due to underrun issue.
The callback is triggered from ALSA core when the framework
detects that the renderer stopped pulling data but the application
is still writing data. It runs in atomic context.

Fixes:
-A disturbance was heard when switching from one song
to the other, or when the song is paused for greater
than 3 seconds and then resumed
-This was due to the previous value of the track
volume being used in the lpa driver
-This was fixed by setting 0 as the initial volume

Change-Id: I035760937d032038fb3f3383dc87ecbdc5f4700d
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>

Conflicts:

	sound/soc/msm/msm-pcm-lpa.c
msm_thermal: prevent setting max freq
ASOC: msm: Fix random issues
gpu: ion: add pointer null checks in map and unmap

Clients may pass incorrect arguments to ION causing crashes.
Add checks to validate input for ION APIs.

Change-Id: Idafa4535b3ef71184ca11fb2c0c4ab073a52ac2f
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
nohz: Fix update_ts_time_stat idle accounting

update_ts_time_stat currently updates idle time even if we are in
iowait loop at the moment. The only real users of the idle counter
(via get_cpu_idle_time_us) are CPU governors and they expect to get
cumulative time for both idle and iowait times.
The value (idle_sleeptime) is also printed to userspace by print_cpu
but it prints both idle and iowait times so the idle part is misleading.

Let's clean this up and fix update_ts_time_stat to account both counters
properly and update consumers of idle to consider iowait time as well.
If we do this we might use get_cpu_{idle,iowait}_time_us from other
contexts as well and we will get expected values.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Cc: Dave Jones <davej@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Link: http://lkml.kernel.org/r/e9c909c221a8da402c4da07e4cd968c3218f8eb1.1314172057.git.mhocko@suse.cz
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[CPUFREQ] Remove wall variable from cpufreq_gov_dbs_init()

CPUFREQ Remove wall variable from cpufreq_gov_dbs_init()

Remove wall variable from cpufreq_gov_dbs_init() as
get_cpu_idle_time_us() no longer updates the last_update_time
unconditionally. Passing non-NULL last_update_time address
will result in accounting additional idle time with
update_ts_time_stats() before returning idle_sleeptime.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Dave Jones <davej@redhat.com>
--
 drivers/cpufreq/cpufreq_ondemand.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
cpufreq / ondemand: update frequency when limits are relaxed

Reevaluate CPU load and update frequency immediately whenever limits
are changed. Currently ondemand doesn't do that when limits are
relaxed, wasting power on systems with relatively low sampling rate.

Signed-off-by: Michal Pecio <mpecio@nvidia.com>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Conflicts:

	drivers/cpufreq/cpufreq_ondemand.c
sync: don't log wait timeouts when timeout = 0

Signed-off-by: Erik Gilling <konkers@android.com>
base: sync: Include seq_file.h in sync.h

sync.h uses struct seq_file in some function table prototypes. This
causes compile failures when including the header in files that do not
otherwise include seq_file.h

Signed-off-by: Jonathan Hamilton <jonathan.hamilton@imgtec.com>
sync: fix timeout = 0 wait behavior

Change-Id: I8b9254e92c26d9f44abbc0c77fb44624de947013
Signed-off-by: Jamie Gennis <jgennis@google.com>
pm: pm8921_charger: add dc uevent for off mode charger

Change-Id: Ia50d5757a9dcf04936875b40d68905810adaf311
power: pm8921-charger: increase hearbeat if battery is low

When the battery percent charge goes low we want to increase the
frequency of state of charge updates. This helps the correction
algorithm ample opportunities to correct the state of charge and
prevent a low voltage shutdown.

Change-Id: Ie846350ee4c1fd70198d28646779b20349134ef7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>

Conflicts:

	drivers/power/pm8921-charger.c
Revert "power: pm8921-charger: change BOOT_DONE configuration"

This reverts commit b157ff75f967cc72c51f6eae3feaa6ba7a432c87.

Enabling BOOT_TIMER may cause an inadvertent shutdown in the subsequent
boot cycle for certain valid scenarios. Do not enable this bit.

(cherry picked from commit 953e63d6cda58957d5e34ff6c43c651f13bb04bb)

CRs-Fixed: 434578
Change-Id: I0d657c2e0d47af32cc35cd66b902be72952e5438
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
power: pm8921-charger: fix EOC worker not starting

There are situations when we observe that charging is in progress
but the end of charge (EOC) worker is not running. This leads to
problems like
-never detecting end of charge
-not adjusting vddmax
-not preventing suspend while charging.

The reason is that the bootloader could have started charging already,
causing a fastchg interrupt to not happen. If the fastchg interrupt is
missed the driver will never start EOC worker.

Check the real time status of the fastchg interrupt and if it is fast
charging invoke the handler so that the eoc worker could be
started.

(cherry picked from commit 7f1d97fd69c3afe66577e731105207e5db544ab2)

CRs-Fixed: 393301
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>

Change-Id: I5c0ba3b8f0653c5f9d64f35346601763c059505a
Signed-off-by: Neha Pandey <nehap@codeaurora.org>