EHCI: HSIC: Implement new reset sequence to workaround PHY lockup issue

commit 8e6edcb (usb: ehci: Avoid phy lockup due to SOFs during port
reset) implements a workaround for PHY lockup issue during port reset.
The workaround relies on a hardware debug feature which allows driving
strobe and data lines to reset using ULPI interface.  This is not
working some times for unknown reason.

This patch implements a new reset sequence to workaround the PHY lockup
issue.  The controller drive reset signaling for ~50 msec when reset bit
is set in PORTSC register.  The controller automatically clears this bit
after finishing the reset signaling.  The software can also finish the
reset signaling any time by clearing the reset bit.

According to USB2 spec, Host controller should drive reset signaling for
50 msec for root hub ports.  But HSIC spec allows shorter reset signaling
time (20 msec).  Clear the reset bit in PORTSC register after 20 msec and
start controller immediately to send SOF.  Use controller internal timers
to achieve this.  If reset bit is not cleared in time, perform the sequence
in a loop with interrupts disabled.

CRs-Fixed: 445659
Change-Id: I884cfcd8a53b111bc9434e47ef483dde64fcc1ed
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
usb: rmnet : Add support for QTI transport

Add support for USB-QTI(Qualcomm Tethering Interface)
interface through a user space device file mechanism. QTI
can now read and write QMI control packets from user space.

Change-Id: I199bcc8943576566b0b7a9589d248e04273e88da
Signed-off-by: Bar Weiner <bweiner@codeaurora.org>
leds: leds-qpnp: Correct driver bugs

Flash headroom address should be offset 0x4a, not 0x49.
Additionally, WLED_MOD_SRC_SEL_REG must be set.

CRs-fixed: 452968
Change-Id: I102be8d420126fbe7743b41dcbd01d5f3a34ed95
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
msm: vidc: Change order of operations

The video driver needs to call into IOMMU driver which then calls
into secure environment to unlock access to IOMMU bfb registers before
the video driver brings the video core out of reset. This is
because the IOMMU driver needs to program the IOMMU bfb registers
before the video core is brought out of reset.

Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Change-Id: Ica80eaec53e8512b7d614f31eca33ca2908f3722
ASoC: wcd9xxx: Add resource manager conditional register updater API

This new APIs will give an ability to codec drivers to disable its
functionalities when it should be disabled by availability by out side
of codec driver.
There are situations that PA and micbias cannot be on.

Change-Id: I17fe73de969859b346c2b8e9e985b1c880dc8f53
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
ASoC: wcd9320: Use resmgr conditional register updater for micbias 2

The wcd9320 codec's micbias 2 is dedicated micbias for MBHC so that
the micbias 2 shouldn't be on when headset isn't present.
If micbias 2 is on during insertion and removal, enabled micbias can lead
click and pop noise.
Use resource manager's conditional register updater for enabling micbias 2
so it can be disabled whenever there is no present headset.

Change-Id: I3c2b49ca5a71539fe3a643afe4ea8d86b1cf21e7
CRs-fixed: 422936
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
usb: gadget: u_bam: Fix NULL pointer dereference crash

port->port_usb could be NULL as part of assigning to in endpoint, so,
check port->port_usb is valid before assigning the endpoint.

CRs-Fixed: 451723
Change-Id: I00acc5e7a3ca2f47046908c345e4a0ed050fe122
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
msm: 8974: remove incorrect mhl gpio config

An incorrect gpio configuration causes duplicate
installation of msm gpio. This duplicate installation
causes conflict with the gpio configuration of another
module (ks8851) that is intended to use it. Remove
incorrect gpio installation from the gpio mux settings.

CRs-Fixed: 446281
Change-Id: I9c2d100005373dc4506777eb1d840c1db71f83b7
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
msm: kgsl: Resize the CP ROQ for a330/a305b

The ROQ for the CP block has the instruction
prefetch space partitioned evenly between
RB, ST, IB1, and IB2. As we don't normally
use ST, and RB is used minimally, we can
reappropriate some of that space to be used
for prefetching more IB1/IB2 instructions.

Change-Id: I6aadb3ad94885d660401f3999051eb0b0283a38e
Signed-off-by: Kevin Matlage <kmatlage@codeaurora.org>
msm: vidc: Set default bitrate mode as VBR

Venus, by default, has rate control turned off, which isn't consistent
with the default value in the driver. This causes userspace's attempts
to put Venus into CBR mode to be ignored, as the driver thinks that
Venus is already in CBR mode.

Change-Id: Ieded873f8468a786bd084f1831cf894467baf126
CRs-Fixed: 448182
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
ASoC: msm: Fix to avoid ignoring shrink/grow notification

This change is to avoid ignoring shrink and grow
requests from ocmem during start and end of the playback.

Change-Id: I2361d5c9012c3149900a185f47b0591c42b1b559
CRs-Fixed: 429210
CRs-Fixed: 441281
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
input: synaptics_i2c_rmi4: Read config ID correctly

Config ID uses 4 bytes, not 8.  Read this value w/4 bytes
to avoid extra reads.

Change-Id: Idab21afbd8ed37e16d9e6ce80ae7641df19d04e6
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
arm/dt: msm8226: rename PM8026 to PM8226 and add regulator devices

Edit the MSM8226 device tree files to reflect the name change
of PM8026 to PM8226.

Also, add regulator devices to the appropriate MSM8226 device
tree files.

Change-Id: Idf3c20a6b6eb1ab08f60c8eeb49780ca3820e86a
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
arm/dt: msm8226: Add devices for PM8226 gpio and mpps

Add GPIO and MPP devices for PM8226 PMIC. There are
8 MPPs and 8 GPIOs on PM8226.

Change-Id: Ie05d1795bb5a5d33757fdb1ec2925e5f048761aa
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
arm/dt: msm8226: Add GPIO pin configuration

Add pin definitions for GPIOs into board specific file
to allow board specific configurations.

Change-Id: I67c8046c02cfedb5e4e841f5d24714874fc1a7f6
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
defconfig: msm8226: Enable CONFIG_GPIO_QPNP_PIN

This provides support for PM8226 GPIOs and MPPs.

Note that MSM8610 and MSM8226 share the same defconfig file.

Change-Id: I2d628e6ee186478dd6074e50e1cf8bc9dfbc44ee
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
power: pm8921-bms: add capacitive resistance

The current code only accounts for the series resistance via a lookup
table. Add a configurable parameter to account for capacitive resistance.

Change-Id: I6a844b51970a6bdf40cfc1340fa31f580efc1c9e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
power: pm8921-bms: fix the mutex usage

get_reading() should be protected by the ocv mutex not the bms output
mutex.

Change-Id: I24eea963611a8df87ce350120d318319cd1a6c3a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
power: pm8921-bms: optimize finding ocv

The current code returns if the OCV is within 1% of the expected
percent charge. This is suboptimal and instead it should try to
be find an OCV that results exactly in the desired percent charge.

Change-Id: If0918d0fb386719487c2e0dfa24c255b3c32c5dc
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
msm: camera: Add timestamp for vb2 buffers

In recording, timestamp is checked by video layers,
to validate frame. Add support for timestamp in
vb2 buffers.

Change-Id: I6f93dd89f39b8f5db26c100c3838cb479f23a8cc
Signed-off-by: Jignesh Mehta <jigneshm@codeaurora.org>