wcnss: Fix AXIM select and CTRL select bit fields

When a WDI timeout happens, WLAN driver will initiate SSR. Dumping
these registers before performing the reset helps to debug the root
cause of the timeout. Fix AXIM select and CTRL select bit fields
of testbus register while doing the A2XB testbus register dump.

Change-Id: Ic9c7ddf2e4cee07b43cc8fe06afca04755856eeb
CRs-Fixed: 540586
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
ARM: dts: msm: revert max-hw-load to fix concurrency usecases

This reverts commit 8da43bfcfa577e54ab516e06ec63ea99d611ca08.
The commit 8da43bfcfa577e54ab516e06ec63ea99d611ca08 was reducing
the maximum load which fails the concurrent usecase 1080p WFD with
4096*2160 playback.
During concurrency usecase 4096*2160 24fps Decode + 1080p 30fps WFD encode,
the MBs/sec is calculated based on default fps i.e. 30 with resolution
as 4096*2160. So eventually it becomes 4096*2160 30fps Decode + 1080p 30fps
WFD encode. This exceeds the max supported load and playback is aborted.

Change-Id: I699f2dbbb5d7807cc5800b47f7616c52b6fac11b
CRs-Fixed: 668061
Signed-off-by: Balamurugan Alagarsamy <balaga@codeaurora.org>
Merge "ARM: dts: msm: revert max-hw-load to fix concurrency usecases"
videobuf2-core: Avoid locking userpages if no current->mm.

If vb2_qbuf is called within the context of a kthread with no "user
memory map", current->mm will be NULL causing a fault when attempt to
lock the non-existent pages.

As such, perform a cursory check for a non-NULL current->mm before
locking the userspace pages.

CRs-Fixed: 623719
Change-Id: I138ba4d1611fae821e723a11b01046e5fc4f9092
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Natiq Ahmed <mnatiq@codeaurora.org>
Merge "videobuf2-core: Avoid locking userpages if no current->mm."
usb: dwc3: otg: Don't set psy type to BATTERY if no charger connected

USB driver incorrectly sets USB power supply type to BATTERY on
charger disconnect. Some userspace client may fail to work properly
by assuming that usb_psy i.e. '/sys/class/power_supply/usb' is
of type battery and subsequent reading of battery status from this
USB supply will fail. Hence, set this to POWER_SUPPLY_TYPE_UNKNOWN.

CRs-fixed: 676051
Change-Id: I0a93b607f8cb328486397fa7bc96ff2177db5a77
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
msm: camera: fix camera crash after daemon reboot

The camera crash occured because the eeprom memory
was freed after first eeprom read from userspace
leading to a non functional camera if the camera
daemon reboots.

Change-Id: I74517a47a6c3832b7bfc5f020b502ff13415f9fb
Signed-off-by: Shivaramraje Nimbalkar Joshi <nimbalkars@codeaurora.org>
msm: camera: sensor: remove unnecessary logs

Use CDBG instead of pr_err for non-error logs.

Change-Id: If09d576040011e4036dda830b50d84473ec806b7
Signed-off-by: Xu Han <hanxu@codeaurora.org>
msm: Increase start voice command timeout

Start voice command timeout is exceeding 300ms
on ADSP.BF.2.2. Increase it to 500ms to avoid
timeout errors.

CRs-fixed: 681025

Change-Id: I940a55a6cd8444ea3ff6fdba0576d7a1f7e8d98c
Signed-off-by: Karthik Reddy Katta <a_katta@codeaurora.org>
msm: kgsl: Add hang interrupt and change HW fault generation

Add a sysfs property to dynamically control HW hang interrupt.
HW fault is generated for hang interrupt only.

Change-Id: Ib50c57476e54cccfef0ae18a0cbb42fce29457c1
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Increase the timeout value for fault detection

Increment the timeout value for detecting faults from 50ms to
200ms. The fault detection mechanism is a backup to hardware
fault detection. 50ms is small since it has been observed that
this mechanism triggers false positives with 50ms.

CRs-Fixed: 630776
Change-Id: I8f382051e06bdc47f152309a2868092e1980604e
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Enable hang interrupt by setting right bits for A330V2

A330V2 hang interrupt bit is at a different location compared to
other A3XX cores. Set the right hang interrupt bit for A330V2.

Change-Id: I702f1653ed31907a708b19c7b2288644e2d45220
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Enable hang interrupt for a330v2

Enable hang interrupt for a330v2 by default during
GPU initialization.

Change-Id: I0dd2054b8d640cf3b17afd3e2f8c4b88d575fce2
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
power: qpnp-charger: if OTG is on and DC_IN removed resume charging

In the case DC_IN is charging and an OTG device is connected
subsequently and the DC_IN charger removed, battery would be still
reported as full despite the fact that no charger is connected.

Fix this by checking if OTG is enabled in
qpnp_chg_dc_dcin_valid_irq_handler.

Change-Id: Id0f7588fdcfb86261e129ab5b73e7da587889713
CRs-Fixed: 654771
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
USB: ehci-msm2: Correct USB PHY RESET sequence

Existing code assumes that USB PHY is reset as part of block
reset using GCC, but that is not the case. This results in
PHY access failures later when ulpi accesses are performed,
or device enumeration fails as CORE can't access PHY.
Correct PHY reset sequence by using USB_PHY_PON bit with
USB_OTG_HS_PHY_CTRL register as per hardware programming
guidelines. Since, driver supports selection of primary or
secondary PHY with CI controller, choose PHY_CTRL_REG
accordingly. Also, debug out important USB register when
ulpi read/write timeout is seen with USB PHY.

CRs-fixed: 676343
Change-Id: Ie69e44a1134c1f4458619ae93520e722aad9e0c8
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
ASoC: msm8974: Set tx bit rate for slim tx params

Set tx bit rate format in slimbus tx hw fixup params.

CRs-Fixed: 659408
Change-Id: I02b7cb88ca180cac033e9f5b63af287b2d932c10
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
msm_serial_hs: Fix the logic for numbering the serial device

This patch fixes the way the UART nodes are enumerated when
aliases are used to identify the nodes. The atomic variable that
used to hold the next available node number was incorrectly being
incremented and if that number were to hold a number that was also
used in an alias, the probe would fail. This patch corrects it.
It also removes the atomic variable and introduces two apis to set
and get the next device number and this logic is protected by a mutex.

Change-Id: Iaee655603b527f3283e1f12d90b1220e9315b529
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Merge "ASoC: msm8974: Set tx bit rate for slim tx params"
Merge "power: qpnp-charger: if OTG is on and DC_IN removed resume charging"
Merge "USB: ehci-msm2: Correct USB PHY RESET sequence"