qup_i2c: Use separate variables to store i2c gpios settings

In i2c bus recovery function GPIO settings for both
SCL and SDA are stored in one variable in this order
before writing recovery settings.
So, SCL setting is overwritten with SDA setting.
And when saved gpios settings write it back after
recovery, the setting for SDA is written both on SCL and SDA.
It means the setting of SCL is broken.

Use separate instances of variables to store GPIO settings
of SDA and SCL separately

CRs-Fixed: 447585
Change-Id: I7014a5b12d4c7ef41fd28c543834d45c619695a9
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
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: kgsl: rename iommu version specific data

The iommu hardware versioning scheme recently changed in the iommu driver.
Rename version specific defines and structures in kgsl to match.

Change-Id: Ib2ca5e40d8f5ed6c79b9f4f5a013263fd8d4aae4
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: Bump up the GPU frequency for long batch processing

Compute workloads run without kernel interaction for long periods
of time.  If one is identified early, increase the frequency to
finish it as fast as possible, rather than waiting for the standard
algorithm to do so.

Change-Id: I213ccabfae5e1000cdc34bc1d92bdc3bad86383d
CRs-Fixed: 441847
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
msm: kgsl: Optimize clock call order

Eliminate the possibility of duplicate RPM calls while using
set_rate in addition to prepare/unprepare.

Change-Id: I74905c2f79b7f78047798b6e8022ded2fce5bf33
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
iommu: msm: Let IOMMUv1 use all possible page sizes

Allow the IOMMUv1 to use 16M, 1M, 64K or 4K iommu
pages when physical and virtual addresses are
appropriately aligned. This can reduce TLB misses
when large buffers are mapped.

Change-Id: Iffcaa04097fc3877962f3954d73a6ba448dca20b
Signed-off-by: Kevin Matlage <kmatlage@codeaurora.org>
usb: dwc3-msm: Add voting for mock UTMI clock

Starting with 8974v2 the mock UTMI clock is required to allow
DWC3 to operate properly in host mode.

Change-Id: Ib4e765fd891b2ae82d4cfb591adecf115a08fbf8
Signed-off-by: Jack Pham <jackp@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>
msm: 8226: Add 8226 topology to enable bus scaling

This patch adds 8226 bus devices along with the master/slave
data to build topology for bus scaling.

Change-Id: I963272586cf4e2c1f687b9b9e8e424f58bb1cd24
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: msm_bus: Revert the name change for backward compatibility

Bus driver name changes breaks A-series and some B-series
chipsets.

Change-Id: I523ed7611c831bf4b67716fb6cec1f1ffb7f411b
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
usb: gadget: mbim: Change message level from error to debug

Change level of message to prevent excessive logging and
increase mbim throughput from 800 KB/s to 3 MB/s.

Change-Id: Iffec43825c90c8cb5838f9879342e9a021ef087b
Signed-off-by: Anna Perel <aperel@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>
arm/dt: msm8974: Add power management devices for v2

Add devicetree support for power management devices for rev 2 of
MSM8974 chipset.

The new SAW rev2.1 has support for HFPLL be turned off from the Krait
SPM sequence. The rev 2.0 hardware would force PLL on when resuming even
if the PLL was turned off by s/w.

Change-Id: I653d425c4df58b1157d2753305ad2c5cc66eb93b
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
gpu: ion: Add secure CMA heap

CMA can now be used for large contiguous allocations. Add
a dedicated heap for secure use cases. This heap intentionally
removes some functionality such as mmaping to userspace for
secure requirements.

Change-Id: I7de94499bd005b405fed546826dae44ae8bc4e20
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
cma: redirect page allocation to CMA

CMA pages are designed to be used as fallback for movable allocations
and cannot be used for non-movable allocations. If CMA pages are
utilized poorly, non-movable allocations may end up getting starved if
all regular movable pages are allocated and the only pages left are
CMA. Always using CMA pages first creates unacceptable performance
problems. As a midway alternative, use CMA pages for certain
userspace allocations. The userspace pages can be migrated or dropped
quickly which giving decent utilization.

Change-Id: I6165dda01b705309eebabc6dfa67146b7a95c174
CRs-Fixed: 452508
[lauraa@codeaurora.org: Missing CONFIG_CMA guards, add commit text]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
mm: Don't put CMA pages on per cpu lists

CMA allocations rely on being able to migrate pages out
quickly to fulfill the allocations. Most use cases for
movable allocations meet this requirement. File system
allocations may take an unaccpetably long time to
migrate, which creates delays from CMA. Prevent CMA
pages from ending up on the per-cpu lists to avoid
code paths grabbing CMA pages on the fast path. CMA
pages can still be allocated as a fallback under tight
memory pressure.

CRs-Fixed: 452508
Change-Id: I79a28f697275a2a1870caabae53c8ea345b4b47d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>