power: pm8921-charger: resume charging based on SOC

At EOC, the battery is disconnected from the charger and starts
discharging. This can result in SOC dropping to around 93% before
charging starts again.

Manually set the CHG_VBAT_DET threshold high to restart charging once SOC
drops below keep_charge_percent.

CRs-Fixed: 404909
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
(cherry picked from commit 14e8fa1e42c02ea643d16d3f833b5d8e1b5753e6)

Conflicts:

	arch/arm/mach-msm/board-8064-pmic.c
	arch/arm/mach-msm/board-8930-pmic.c
	arch/arm/mach-msm/board-8960-pmic.c
	drivers/power/pm8921-charger.c

Change-Id: Iceb49784ec6be2c45076e33d04aac73cb9992a03
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
spi_qsd: Runtime configuration of spi gpio's

Configure the spi clk, mosi, miso, cs gpio's on per
transaction basis and unconfigure otherwise.
It will remove the conflicts if same gpio's are
being used by different modules if no SPI device
is present.

CRs-Fixed: 387043
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
(cherry picked from commit 66554a1317d40fbacd1a7e1e3210de8fb947ad57)

Conflicts:

	drivers/spi/spi_qsd.c

Change-Id: I7f121d1b663af352162064c0387e5bdf34276fec
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()

Use the observation that it is more efficient to check the wakeup
variable once before the loop reporting tasks that were not
frozen in try_to_freeze_tasks() than to do that in every step of that
loop.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Conflicts:

	kernel/power/process.c

Change-Id: I2abf3a9ef06c5b90beb12bbc542a87f79e42a14a
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()"
Merge "power: pm8921-charger: resume charging based on SOC"
Merge "spi_qsd: Runtime configuration of spi gpio's"
Bluetooth: Fix for LE cancel Create Connection not working

Added management method to send LE cancel create connection
HCI command

(cherry picked from commit 907d523eaeab6e6fda9589191b5684f26a502a10)

Change-Id: Iab2d8dc909b618036496f1c6abb9478d61b1e031
CRs-fixed: 366284
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
Revert "PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()"

This reverts commit 9b276da61ab9827f99b9fc836ae78d6fd4649bec.

Change-Id: I2a89c4ba7c914d2b87e3ac6ad309fa832cbf7b35
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()

Use the observation that it is more efficient to check the wakeup
variable once before the loop reporting tasks that were not
frozen in try_to_freeze_tasks() than to do that in every step of that
loop.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Conflicts:

	kernel/power/process.c

Change-Id: I0bd9e71b638e565773f4861899ca175f82f2a4cc
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "Revert "PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()""
Merge "PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()"
Merge "Bluetooth: Fix for LE cancel Create Connection not working"
USB: msm_otg: Acknowledge PMIC BSV events, if ID is set

Currently not all the PMIC BSV events are handled due to check
that was introduced for handling spurious interrupts in Host Mode.
Rather than checking the OTG state as apart of these spurious interrupts
which gets updated in workqueue context, check for ID state and return
only, if ID is clear. This will fix all the corner cases and race
conditions as part of handling ACA use cases as well.

CRs-Fixed: 411036
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
(cherry picked from commit 2e1048bfda3f7eec6b9ba21ad9962f6b9388d89f)

Conflicts:

	drivers/usb/otg/msm_otg.c

Change-Id: Ie8c6f68bfd6111d9f8ad95b24e66856967b07e72
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Merge "USB: msm_otg: Acknowledge PMIC BSV events, if ID is set"
diag: Improve handling of IOCTLs

DIAG kernel driver interacts with user space processes using
IOCTLS. This change adds conditions to avoid potential integer
over/underflow, incorrect buffer copy.

CVE-2012-4220
CVE-2012-4221

Change-Id: If62cbdc953d67436a0a785f43f263a2cb0a76973
CRs-Fixed: 385352
CRs-Fixed: 385349
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
msm: kgsl: Set sysfs max clock for devices with no power scale policy

When the sysfs entry for max clock is updated, set it immediately for the
devices that has no power scale policy. This prevents the device from
running with undesired clock.

(cherry picked from commit 6ca8011b4feb30c29e8e6fb5b3571fd2314879e0)

Change-Id: I3a4d689d90036edc243fa97562a79394ace94c2a
CRs-fixed: 408963
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
Merge "msm: kgsl: Set sysfs max clock for devices with no power scale policy"
Merge "diag: Improve handling of IOCTLs"
msm: vidc: Avoid memset of list elements in the buffer entry.

- Due to race condition between free buffer and flush output buffers,
  invalid buffer is getting accessed sometimes.
- Reset all the members in buffer entry except list elements.

(cherry picked from commit 8105df366cf6b9f1ddbc15d561fb6a5f12540416)

Change-Id: Ia3eaebdae102e4dff513cfffe31850350176d25f
CRs-Fixed: 411197
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Merge "msm: vidc: Avoid memset of list elements in the buffer entry."