Revert "power: pm8921-charger: fix a potential array out of bound access"

This reverts commit 0f1be62ee48338994611035d664d26fadabeb2fb.
Revert "power: pm8921-bms: fix the mismatch of container_of member type"

This reverts commit 879df6553254868150616f051a641f2d2e4bdfc6.
Revert "power: pm8921-charger: don't apply kickstart unless it is 8921 pmic"

This reverts commit 22e27d01fe204b41e0ae415cafaf320ac1500234.
Revert "msm: power: update copyright markings"

This reverts commit 3f9f19a7c50fe47e1b963c25c68cc3ed89dd25a8.
Revert "msm: power: update power drivers to msm-3.4 tip"

This reverts commit fae0afd7be3adcb910ea44d772c09d69d0d31375.
Revert "msm: power: Revert LGE power patches"

This reverts commit 2f24cb771c35f6f8826ffb595b9eb0d3c049c417.
power: pm8921-bms: fix soc rising from 99% to 100% during discharging

We observed that SoC suddenly increase from 98% or 99% to 100%
right after charger removal. This issue caused by charging adjusting
algorithm which adjust SoC to sync 100% with end of charging.
During charging adjustment, the adjusted SoC could be smaller than
original SoC. So when we remove charger, charging adjusting algorithm
stop adjusting SoC and then bms report original SoC which is larger
than before.

Previously, bms driver considered most of this case by using previous
SoC when SoC increase during discharging. But if SoC is 100%, previous
patch doesn't work.
So this patch add SoC 100% case by checking if charger is enabled.

Change-Id: I70945d391c9d821eaf875f1bcd1e8787077b98da
power: pm8921-bms: increase accuracy of voltage during charging adjusting

During charging adjustment, the measurement of voltage is not accurate.
Since the measured voltage during charging adjustment is not OCV
(open circuit voltage), it cannot show real battery voltage at CC to CV
point. But current implementation use inaccurate voltage as a voltage of
CC to CV point. This inaccurate voltage of CC to CV point can cause
wrong SoC adjusting. For instance, the SoC could stick at fixed value
until end of charging.
This patch increase accuracy of voltage measurement by using battery
current and battery resister.

Change-Id: I3a4cc4e58e409be5422ec6bf64678a9a92b9fe25
power: pm8921-charger: distinguish between PMIC 3.0.1 and 3.0

Some workarounds that are required for PMIC die version 3.0
differ slightly for die version 3.0.1.

Fix this by checking the PMIC subversion register to distinguish
between 3.0 and 3.0.1.

CRs-Fixed: 403150
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
(cherry picked from commit 913c55e2706c36132fd42f90c05530b8e55a26ed)

Conflicts:

	drivers/power/pm8921-charger.c

Change-Id: I11155d6180de09e1b9e0137f7943603d44102d07
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
power: pm8921-charger: fix sub revision check

Rather than checking for the value 1 check that
bit zero is set.

Change-Id: Ie2842b28648084d8970329d7c76fcf0d0666a847
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
pm8xxx-adc: add the functions to set tuning parameters

We need to tune the board specific adcmap parameters
So need functions to set specific parameters.

void pm8xxx_set_adcmap_btm_threshold(void *pts, int size)
void pm8xxx_set_adcmap_pa_therm(void *pts, int size)
void pm8xxx_set_adcmap_ntcg_104ef_104fb(void *pts, int size)

Change-Id: Ie78c11f5fb998ecc456defa3c8e3e7a3e0b9b45f
sched_avg: add run queue averaging.

Add code to calculate the run queue depth of a cpu and iowait
depth of the cpu.

The scheduler calls in to sched_update_nr_prod whenever there
is a runqueue change. This function maintains the runqueue average
and the iowait of that cpu in that time interval.

Whoever wants to know the runqueue average is expected to call
sched_get_nr_running_avg periodically to get the accumulated
runqueue and iowait averages for all the cpus.

Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
(cherry picked from commit 0299fcaaad80e2c0ac9aa583c95107f6edc27750)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit 5325d8a44f8296170cd8f42e245dd79f7b7347bf)

Change-Id: I92875789886c3f7c2457a063de4b3b6d8c893718
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Revert "use msm8960_defconfig instead of mako_defconfig"

This reverts commit b78236b2d805453985abcfee268a95ccc6d57c03.
power: pm8921-bms: fix divide by 0 issue when charging

The current code can divide by zero in the scale_soc_while_chg
function if calculated_soc drops while charging.
This patch fix it.

Change-Id: I83c7e9c7056990499f474c9e1882f0377df05f0c
Revert "ASoC: msm: Decrease the playback period size of PCM driver"

This reverts commit b0580099ac7d5e735fb42946612a499bf196cda1.

Change-Id: I487797334cf75978daa3c536ff92de8a54b1f7fb
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Revert "Revert "mako: enable lgit lcd driver""

This reverts commit ba14d0b42c04889004bf922271688c8cba279b62.

Signed-off-by: Iliyan Malchev <malchev@google.com>
remove legacy_ion.h

Signed-off-by: Iliyan Malchev <malchev@google.com>
msm_ion: convert enum to #defines

Signed-off-by: Iliyan Malchev <malchev@google.com>
msm_ipc_logging: mark inline functions __always_inline

Signed-off-by: Iliyan Malchev <malchev@google.com>
mako: add missing include to board-mako-camera.c

Signed-off-by: Iliyan Malchev <malchev@google.com>