ASoC: wcd9xxx: don't assume PA is off during insertion detection

The mbhc find plug type can possibly run with audio playback on headphone.
This means micbias source can be from vddio as well as hphl status isn't
reliable.
Change micbias source to cfilt and don't refer hphl status when playback
is running with headphone during plug type detection.

Change-Id: Ie902b64927964c787dd91982d9236015ef302891
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
qseecom: Add new IOCTLs to support secure UI feature

User space sends the buffer to TZ to use it for secure UI features.
Buffer shall be protected based on the use case, two APIs are
introduced to support this feature.

- QSEECOM_IOCTL_SEND_MODFD_RESP: is called to modify the listener
response data with physical address replaced at a mentioned offset,
so as to be usable by TZ. Option to protect &/ unprotect the buffer
is provided from user space (based on use case).

- QSEECOM_IOCTL_UNPROTECT_BUF: is called to explicitly unprotect the
protected buffer (use case specific).

Change-Id: If129e7bc0131eee4ec361923c6c1c74de37be130
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
ARM: dt: msm: Change default LED blink for msm8226

With shorter ramp step and more duty cycle values, power
use is improved.

Change-Id: I9aa8085afc1ee275c40d7032c6dcb0880d10e949
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
radio-iris: Fix in the AF_LIST event handling

- Copying more than available size in AF list buffer which leads to crash.
- Added a check to avoid copy more than available size.

Change-Id: I8f00c6dd82e64ee2744bfad63ea4523b206732a6
CRs-Fixed: 498758
Signed-off-by: Venkateshwarlu Domakonda <Venkateshwarlu@codeaurora.org>
msm: Add NULL pointer check before ion cache operation

If the ion buffer is of size zero, NULL pointer
dereferencing may take place. Avoid it by adding
a check before function call.

Change-Id: If6c19a94f70f3658c5323a0742399ec977944da7
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
i2c-qup: Verify that mem resource exists prior to redirection

Redirection may cause a system crush in the case of a missing
memory resource specification. Now when reading a memory
resource from platform data, the return value is checked
before doing redirection on the resource.

Change-Id: Id4ef9c293f65935d6e3bd311720a1e66a2da8f35
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
msm: vdec: Update firmware with input buffer count

If input buffer count is not the same as firmware expects
then firmware should be updated with the new count.

CRs-fixed: 502537
Change-Id: Id952a53ef9e4bccffff5b7f6e67bacebc9183cc3
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
ASoC: wcd9xxx: Avoid mic schmitt trigger while finding plug type

Do not enable mic schmitt trigger when the plug type
determination work is interrupted by another mechanical
or electrical mbhc interrupt. Otherwise, enabling mic
schmitt trigger will cause spurious unwanted electrical
interrupts to be generated while plug type is getting
determined.

Change-Id: I3dce10b874c903ec517a6683cbcbc8d2a3d82c92
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
diag: Add wake_up when HSIC driver is finished writing

When the HSIC driver calls the write complete callback function
in the diag kernel driver, diag does not make a wake_up_interuptible
call. There is a chance that the thread in the corresponding
wait_event_interuptible may not be woken up. Make changes to ensure
that the thread that may be waiting is woken up.

Change-Id: I52032913291aec5c775cc2ff7ca69fe78481ea7a
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
mdss: Add return value when copy_from_user is successful

Return successful when the ioctl MSMFB_OVERLAY_PLAY_ENABLE
is successful.

CRs-Fixed: 492570
Change-Id: Id279be87ed2ccb519109b0dd491511af007c3841
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
ARM: dts: msm: Add led control for battery charging for msm8226 QRD

Set the default-trigger device tree property value of red
led with "battery-charging", and set that of green led with
"battery-full". So red led will be on when battery charging,
and green led will be on when charging done.

CRs-Fixed: 495414
Change-Id: Ie744ea5adba62ed2db10d9644b2ff38ea9f414a7
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
media: dvb: Fix usage of physical addresses

Do not assume that physical addresses are 32bits
long. This is required to support LPAE.

Change-Id: I8b1a2661ea2ae41a1fe25dfd905ca575b15bb9e0
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
msm: camera: Add fix to avoid array index out of bound in cpp

  The parameter for number of buffers passed from user space
may be very large. While allocating memory, this could result
in integer overflow. As a result lesser memory will be allocated
then expected. This inturn may result in array index out of bound
error when the pointer is used to access memory.

  The fix is to limit the maximum requested buffers per stream. If
request is greater than the maximum value, error is returned back
to user space.

CRs-Fixed: 489273
Change-Id: I3d316f439610609cd36615eea3e68d0e8a0be0d7
Signed-off-by: Nishant Pandit <npandit@codeaurora.org>
(cherry picked from commit b7126cdd15b764bad8fe9fafe3dbd6ee3e8d44ec)
wcnss: Add PLL status register to register dump list

When a WDI timeout or Watchdog bite happens at WCNSS, log certain WCNSS
register before SSR. Dumping these registers before performing the reset
helps to debug the root cause of the timeout or bite. Add PLL status to
the register dump, recently we have seen WCNSS reset failures becuase
of PLL lock issues.

Change-Id: I7557a46260e6dbd888b4bb1191442fda0bc3c986
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
msm: mdss: Support specific enable and disable load for vregs

Changes are to add support for specifying the enable
and disable load for vregs

Change-Id: I0943237370af1cf6757a8b3617d2b192098f6b7d
Signed-off-by: Arpita Banerjee <cabane@codeaurora.org>
crypto: msm: set ce_shared flag as zero when using BAM HW

CE HW sharing is not supported when BAM hardware is used, so
we need to set the corresponding ce_shared flag as zero in
qcedev_probe().

Change-Id: I28f0cb9c453a473970742f80fc16379ec7183771
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm: vidc: disable h/w load calculation for thumbnail

Thumbnail decode load should not be considered while
calculating the overall h/w load. This is needed
especially on devices with limited h/w capability.
Without this change, we can see thumbnail decode
failing if two thumbnail sessions start in parallel
and h/w capability is exceeded.

CRs-fixed: 504248
Change-Id: Icdceddc5c15cd5beac391fe15dac9d60e5eb35bb
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
msm: clock-8974: Add BCR registers for GDSC-collapsible cores

The GDSC driver allows collapse of cores to be disabled
via device tree. Client drivers may still expect the core
to be reset to a clean state after calls to the GDSC APIs,
however.

Specify .bcr_reg addresses for GDSC-collapsible cores so
that the GDSC driver can assert resets to these cores in
lieu of collapsing them. This is similar to what's already
been done for venus0_vcodec0_clk for the same reason.

Change-Id: I1dfdf9562dd49eee7b38a204a063d6787fc4ce85
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
usb: gadget: ci13xxx: cancel prime timer after disconnect also for ep0

When issue a transfer to the usb hardware core, the prime bit is set
for the desired endpoint. After the hardware finish processing the
transfer it reset the prime bit of that endpoint. In order to debug cases
in which this bit is not reset by the core, a timer was set for 1 second
after issuing the transfer for checking the prime bit status and print
debug messages in case of abnormal state.

However, this mechanism introduced a bug, in which the timer of ep0
was expired after cable disconnect. Therefore the prime bit was checked,
while the hardware is in low power mode, so reading the bit caused a crash.

Fix this by ensuring that the timer will be canceled whenever all the
requests of an endpoint are dequeued, including for the case of ep0.
Also added a warning and protection for such cases when an endpoint
timer expires after core in low power mode.

CRs-Fixed: 505686
Change-Id: I7336ec7372714a4cd04bf94eb31ce230ee0a4241
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
usb: ehci-msm: Fix LOW Speed device enumeration issue

Disable ULPI_TX_PKT_EN_CLR_FIX which is valid only for HSIC core.
It otherwise causes enumeration failures with low speed devices.

Change-Id: I987bba3a8e0d609b6de6b5d33e11ca3bb0e03b1c
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>