regulator: onsemi-ncp6335d: add support for tlmm spare register control

Certain Qualcomm chips mux the output of some GPIOs using the TLMM_SPARE
register. Add support for a device tree property which can be used to
specify a mask and value to write into this register so that the VSEL GPIO
can be toggled successfully on affected devices. When the appropriate bits
in the TLMM_SPARE register are written, the physical output of the GPIO can
be controlled normally via GPIO control registers.

Change-Id: Ic8a0886886a44687931ab5cb8150383cd84db2f6
Signed-off-by: Ke Liu <keliu@codeaurora.org>
regulator: onsemi-ncp6335d: add device tree support for mode selection

Add support to the onsemi-ncp6335d driver to select which regulator
operating mode to utilize. There are two possible mode selections: PWM mode
and auto mode. If no mode property is specified in device tree, the
regulator will operate in the hardware default mode.

CRs-Fixed: 607899
Change-Id: I2e21c452a3ea3963146d9abbc7e89e811fd90388
Signed-off-by: Ke Liu <keliu@codeaurora.org>
Revert "USB: dwc3: ep0.c: Disable U1 and U2 low power modes"

Commit 4f1de530f4d5989022d9594413132ea175c2845e disabled U1 and
U2 low power modes to avoid USB reenumeration issue seen during
data transfers in superspeed mode. This USB reenumeration is
resolved by commit Ibd5d8180202b2f877304be3da9d976fe54df3eed
"USB: dwc3: core: Set elastic buffer mode to zero". Hence revert
the commit to reenable U1 and U2 low power modes, otherwise USB3
complaince tests fail.

CRs-Fixed: 483202
Change-Id: I87443c9dc4cac443137f64998ced9fda1e583a44
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
sched: convert WARN_ON() to printk_sched() in try_to_wake_up_local()

try_to_wake_up_local() is called with the rq lock held. Printing to
console in this context can result in a deadlock if klogd needs to
be woken up. Print to the kernel log buffer via printk_sched()
instead which avoids the wakeup.

Change-Id: Ia07baea3cb7e0b158545207fdbbb866203256d3c
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
ASoC: msm: qdsp6v2: check if backend active before querying RMS

RMS query to dsp should be done only when the relevant back end is
active to avoid un-necessary errors. Put a check to see if the
backend is active.

CRs-Fixed: 597886
Change-Id: I1ed402272eb34aa6120adbb97d1627a3f7f9b3c5
Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
msm: vidc: Bail out if ocmem allocation failed

We shouldn't need to call venus_hfi_set_ocmem if the allocation of ocmem
failed.

Change-Id: I805f914af4d340fd50beecdb63b87c4cbda19fb0
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
ASoC: msm: Destroy all CVD sessions after ending VoLTE call

MVM and CVS sessions are not destroyed after ending VoLTE or
CS call. Due to memory limitation on the DSP (only 2 sessions
can be pre-allocated), VoWLAN call will fail if attempted
after one CS call and one VoLTE call. To resolve this memory
limitation, changes made to destroy MVM and CVS sessions at
the end of VoLTE call.

Change-Id: I47b2f445f1b9ba2f9359ff840e9de0def11cc27f
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
msm: vidc: add LTR support for video encoder

Enable LTR support for VP8 codec to add robust error resilience.

Change-Id: I3b87c5cdaef836a6d02d5b9fe71b7165b7f13581
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

Conflicts:
	drivers/media/platform/msm/vidc/hfi_packetization.c
	drivers/media/platform/msm/vidc/vidc_hfi_api.h
usb: dwc3_otg: Turn on VBUS before starting host

Currently the VBUS regulator is enabled only after initializing
the xHCI host stack, which can result in enumeration failures
for certain devices. This is likely due to VBUS having a
finite rise time when it is turned on, especially when a load
is already attached. Mitigate this by enabling VBUS first before
starting the host stack.

CRs-Fixed: 599498
Change-Id: I9785ae4682d0a2dfbcec921b869fc03550e0db82
Signed-off-by: Jack Pham <jackp@codeaurora.org>

Conflicts:
	drivers/usb/dwc3/dwc3_otg.c
input: misc: add input driver for HBTP

This driver provides service to Host Based Touch Processing
in three aspects:
- It serves as an input device driver to send touch events from user
  space to the kernel input core.
- It monitors LCD on/off and sends uevent accordingly.
- It performs power management for the touch AFE (Analog Front End).

Change-Id: Ibfb7c6a8d2c895ea0a277b8f0bf810e0263260e6
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
msm: mdss: Update wr mem fields with correct names

wr mem start and continue were incorrectly named in
the documentation and dtsi files. Changing the names
to wr-mem-start and wr-mem-continue to more accurately
reflect the fields.

Change-Id: If2cdd410fd50a4690dcb6c87cb0b9f4818848848
CRs-Fixed: 578028
Signed-off-by: Casey Piper <cpiper@codeaurora.org>

Conflicts:
	arch/arm/boot/dts/dsi-panel-truly-wvga-cmd.dtsi
sched: renamed printk_sched to printk_deferred
power: qpnp-charger: handle usb short to gnd OTG case

Over current protection (OCP) at USBIN depends on USB voltage to
function. Thus, a short at USBIN before OTG is enabled causes OCP to
fail.

The workaround uses the inductor current limit during boost to limit
the current drawn during a short and detect a short. If no short
was detected, the inductor limit is raised again. If a short happens
after the limit is raised the OCP circuitry will trigger and protect
the device.

CRs-Fixed: 600036
Change-Id: Ib8d46e9065b8b09100507a46718ed85336e12084
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
msm: vidc: Add generic LTR mode support

Use generic LTR HFI APIs for h264 and vp8 formats.

Change-Id: I9f307046d7ec6de4eb6d43704686be902356882a
Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
[media] v4l2: Add enum for frame level QP extra-data

This option is intended to be used to request as extra-data
the frame level QP.

Change-Id: Icaf88bd5a48ac394d1ed7ded8dc320cfeebc2765
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Add support to request frame level QP information

The resulting QP information for H264 is the slice level
QP averaged over whole frame; for all other codecs its
frame level QP.

Change-Id: I288904b05d886c1e94fc113b8bd3fba5b13b48f3
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>

Conflicts:
	include/media/msm_vidc.h
[media] v4l2: Add enums to request frame bits info as extra-data

This option is intended to be used to request as extra-data
the size in bits from frame header and frame itself.

Change-Id: I207045cda8c8038981bcf4548eb3d221502a67e1
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Add support to request frame bits info as extra-data

Provides information regarding number of bits in the frame (i.e frame
size expressed in bits) & also the number of bits in frame header (i.e
frame header size expressed in bits).
Number of bits in header is reported as:
For H264, sum of all slice headers bits for all the slices in the frame.
For all other codecs, number of bits in the frame header.

Change-Id: I6caeca025ff0ce059a20891a6d657b47c4b452b3
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Return meaningful information for extra-data plane

Sending meaningful information in the extra-data plane structure
instead of trashy values for some uninitialized fields.

Change-Id: I6d1a5debb801836f48e4cdbd6129b5086ec18a63
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: Add support for MBI extradata

Macro Block Information extradata (if enabled) allows interested
clients to query for metadata about each macroblock.

Change-Id: Icfee32770018338e28ae149e1ccb654f5a48cbec
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>