usb: msm_otg: Add support for vdd min without phy retention

As a part of usb disconnect, usb will be put into low power mode
by putting phy into retention, voting for xo shutdown and vdd
minimization, also turning off LDOs. But on 8x10 platform,turning
off regulators is causing leakage current due to hardware limitation.
Hence add support for vdd minimization without putting phy into
retention to prevent power consumption. Also disable id pull up
as recommended by hardware team.

CRs-Fixed: 585073
Change-Id: Ie484f93e561664681501337be407e4f8038ac74a
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>

Conflicts:
	drivers/usb/otg/msm_otg.c
arm/dt: 8610: Enable support for vdd min without phy retention

Add device tree entry for enabling support for allowing vdd
minimization without putting phy into retention. This will
avoid power consumption due to leakage current seen on 8610
platform.

CRs-Fixed: 585073
Change-Id: Ib593dcd0a94f3854535913118f5ef11948653283
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
hwmon: qpnp-adc-current: Fix potential race condition

There should be no synchronous Voltage and Current readings
initiated on IADC_USR when a single VADC_USR conversion is
in progress. If a synchronous Voltage and Current read
occures while a VADC_USR is in progress it results in an
invalid state for that single conversion on the VADC_USR.
There is a potential race condition where the above scenario
can occur that is due to an IADC conversion occuring before
the VADC_IADC USR sync conversion is complete and ends up
using the mode select as a VADC_IADC sync request.
Therefore use a single lock for both IADC and
synchronous VADC_IADC request.

Change-Id: Idb451b813bc5f08b7239d371fc0f8fa5e17429b1
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
msm: mdss: Fix MDP hang issue for H2V1 interleaved formats

MDSS HW with decimation block present, uses two SMP clients, Y and UV,
regardless of YUV surface is interleaved or planar. Current code takes
care of planar format but not interleave YUV. Fix this by temporarily
converting those formats to pseudo-planar while calculating SMP
requirements.

CRs-Fixed: 568011
Change-Id: I917f7dfd848144bcc4a6c463cd20fb302c432cc5
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
mdss: display: remove checking of pwm gpio from pwm config

Since pwm back light is driven by pwm lpg channel, pmic_gpio
is not needed. Therefore remove checking of pmic_gpio.

CRs-Fixed: 575245
Change-Id: I7027c71322d122617eb9cbce839c614f2294a0e7
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
sensors: remove the write permisson of sensor class sysfs

The sensor class device sysfs interface shall be read-only. So
remove the write permisson of these interface.

Change-Id: Ifd763247891f39e2ae7f2ce04f8ffe505c1bebe8
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
msm_serial_hs: Add IPC Logging

This patch enables IPC Logging in the high speed UART driver.
The logs are available under sysfs. Log level can be changed by
changing the mask provided in /sys/module.
This patch prints UART Registers while
1)Port Open
2)Port Configuration
3)Rx/Tx Flow
4)Handling ISR and
Prints Tx/Rx Data and Count

Change-Id: I7aef6613ac27a069127ce8450591c97eedb555af
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm_serial_hs: Fix register access issue

Crash is seen in the dump_uart_hs_registers()
function due to improper array offset passed to
access the registers. This patch corrects the
array index during the register access.

CRs-Fixed: 576874
Change-Id: Iba54b72cefa01ff855b17e981aa4dd2886126003
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
defconfig: msm8974: Add NFC for 8974 devices

Add NFC for msm8974 configuration

Change-Id: I24269b5fdad071ccc2a7a1918f6e9e6b6d00db51
Acked-by: Umesh Jagga <ujagga@qti.qualcomm.com>
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
ARM: dts: msm: Add NFC device for 8974 bc

Add nfc nci device to the device tree for 8974 bc

Change-Id: I6caf8c6d6a7354f7b0b75557f8f51ea350ad205f
Acked-by: Umesh Jagga <ujagga@qti.qualcomm.com>
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
msm_serial_hs: Fix the wrong register offset Macro usage

In the msm_hs_tx_empty() API, accessing wrong register offset
macro UARTDM_SR_ADDR.This leading to the unexpected issues
The right register offset macro is UART_DM_SR.
Also the msm_hs_request_clock_off() API is accessing wrong
register macro UARTDM_IMR instead of UART_DM_IMR.

This patch places the right macros at respective points.

CRs-Fixed: 583426
Change-Id: I0eb966adedc44b8e611da318b6d8f4a9279e95a7
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
power: qpnp-charger: fix charging timer

The driver miscalculated the time in minutes. Fix the way it calculates
the value to program for the expected charger timer.

Moreover, before programming a new timer value, the timer had to be
disabled. Update the driver to do this. While at it, fix the register
definitions for CHGR_TCHG_MAX_EN and CHGR_TTRKL_MAX_EN.

Change-Id: I0c798aecf13e2186a9e0684f3168bf16e65c27b6
CRs-Fixed: 575809
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
power: qpnp-charger: check for reverse boost on probe

The accidental reverse boost scenario may occur
before probe.

Fix this by checking the CHG_GONE interrupt status
on probe and running the ARB workaround if necessary.

Change-Id: I6ecc0d5796e7fdacdf61c62eeb14523061a51605
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
diag: diag over uart not working for QSC

On executing diag_uart_log app with QSC option
switching is not happening. On the other hand, MSM
switching is working fine. Added changes in order
to allocate memory to user space data type buffer
during diag char initialization.

Change-Id: I8afd79017e543b088381fd70c2a585f6c0c2ca1e
CRs-Fixed: 576830
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
power: qpnp-bms: disable sw_cc_thresh interrupt after it fires

Currently in the BMS driver, when the software coulomb counter threshold
is reached, only a soc recalculation is scheduled in the irq handler.
This can cause issues where the BMS hardware fires another sw_cc_thresh
irq because the coulomb counter is still over threshold.

Instead, disable the sw_cc_thresh irq when it is handled and renable it
after adjusting the software coulomb counter threshold registers.

Change-Id: I70791fdae1835c8d24b7c045831d22fe86e83fdb
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
ARM: dts: msm8974pro: Update MPM mapping for GIC interrupts

Add cpubw-krait interrupt to the Bypass list as this
intterupt can only be raised when CPU is actively
executing instructions.

Change-Id: Ife1854e933ccefdf5730f22ab94a75a9c642ad79
Signed-off-by: Badhri Jagan Sridharan <badhris@codeaurora.org>
Revert "ARM: dts: msm: Add NFC device for 8974 bc"

Partially revert commit bc2bf21d5ae217b0735443d23686391da940e5a9.

Change-Id: Ia716ca499cd5538862b2aa5332e4e9c50127dfba
Signed-off-by: Houston Hoffman <hhoffman@codeaurora.org>
[media] v4l2-ctrl: add constrained high h.264 profile to menu

Constrained high profile was added as a profile option but the menu was
not updated. This causes dereference an invalid area in case this
profile is selected.

Change-Id: I5811a845a9232bab19125a0dae0be38f9054d250
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
PM / devfreq: Add a new target flag for the performance governor

The new flag for the devfreq profile->target() function is used
by the performance governor to notify the driver that the device
should wakeup on the max frequency.

Change-Id: I91c2d649177bdd1841a087a2125d1cdbc979f5c1
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
ARM: dts: msm: Add CX regulator Phandle to MDP node

The Phandle might change for different
versions of the msm8974 chip. Add the proper
Phandle of CX regulator to 8974 v2 and
8974pro versions.

Change-Id: Ifce120fcb349360e36c4ea74bcaf5ea14e1dece5
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>