USB: u_serial: Don't push data to line discipline in interrupt context

Currently setting low_latency flag in u_serial driver which causes
pushing data from tty layer to line discipline in interrupt contect.
As part of this, calling sleeping function from atomic context which
could crash. Fix this by not setting low_latency flag.

CRs-Fixed: 393614
Change-Id: Id79b8972cfa823c173de158e0ccf08a6d052057f
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: u_serial: Fix NULL pointer dereference in unthrottle callback

TTY may call unthrottle callback after port is closed.  This is
happening when tty is hung up during cable disconnect.  The tty's
driver data is set to NULL in port close.  Don't access driver data
in unthrottle callback.  There is nothing to do unthrottle callback
when port is closed.

CRs-Fixed: 463195
Change-Id: Iacedc30f6a5bc8e840d103e6e29f2f5b72b4f007
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
usb: serial: csvt: Fix control signal definitions

The carrier detect and ring indicator control signals are defined
incorrectly.  Fix it.  The USB CDC specification did not define
CTS signal.  Assume CTS is always high.

CRs-Fixed: 458326
Change-Id: Ie005261fe89f32fcdb145dd09dcc4bbfb4ce3fc1
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
usb: gadget: serial: Limit write permissions to root

android compatibility test suite complains if others have write
permission. Hence, limit the file permissions to root.

Change-Id: I3f607b307b7ecb6c01180bc752681b02e6e54c7a
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
Asoc: msm: Set the right topology during in call voice recording

Obsereved silence in incall voice recording with dual mic, when fluence is
enabled.Fluence topology is applied even on audio recording path.Default topology
is set for incall voice recording.

CRs-Fixed: 454359
Change-Id: I9d34f00e424355fdc183ce1a5769c4083b6ae6a7
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
ASoC: wcd9310: Update compander configuration sequence

Update compander configuration sequence for headphone path
to prevent the concurreny of ANC and compander in addition
to bypass the delay buffer for ANC and class G to avoid the
audio delay change between class G enabled and disable modes.

CRs-fixed: 456565
Change-Id: I561cb878906b9e31d8c1b04c145c533090f80f1f
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
ASoC: wcd9310: Update compander gain implementation

When compander is enabled, PA has no impact on the playback
path. In order to keep the output audio level consistently during
compander enabling and disabling so we have to apply the same
gain/attention in PA to digital gain to compensate the PA gain.

CRs-fixed: 456565
Change-Id: Idf760bac35b25aab419a23ce5803c68831850856
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
mmc: card: abort the suspend if the card is busy

mmc_blk_suspend() is triggered when system is going into suspend which
then waits for the mmcqd thread (which processes active MMC transfer
requests) to complete all queued transfer requests but if mmcqd has
multiple requests to be processed at this point, mmc_blk_suspend() may
very well sleep for duration longer than DPM (Device Power Management)
timeout (currently 12 sec) causing the DPM timeout bug.

To fix this issue, mmc_blk_suspend() checks if there are any more pending
MMC requests in progress or not and if there are any, it returns error
which should abort the ongoing system suspend.

CRs-Fixed: 439192
Change-Id: Ic7ba2f013d10a1952c30ea2ed93f74b831fcc27d
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: msm_sdcc: fix the clock selection logic in DDR mode

MSM SDCC controller requires the internal clock frequency to set be
doubled when running in DDR (Dual Data Rate) mode and existing
clock selection logic used to work fine until the MMC clock scaling
functionality got added. With clock scaling now, clock (ios->clock)
might get scaled down from 50MHz to 25MHz during DDR mode operation
and existing clock frequency selection logic may not change the clock
frequency when we move back from 25MHz to 50MHz.

This patch fixes the above issue and also simplifies the clock frequency
selection logic in DDR mode.

CRs-Fixed: 458926
Change-Id: I60f9ae2d5a7f92031fb46d9b16676c74363e7b9f
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: msm_sdcc: fix data timeout calculation for DDR bus speed mode

When card operates in DDR (Double Data Rate) bus speed mode,
most of the HW logic of SDCC controller needs to have clock
frequency that is twice the clock frequency going out to card.
For example, if a card operates at 50MHz clock in DDR mode then
internally SDCC controller logic will operate at a clock of 100MHz.

But SDCC controller's data timeout logic works on the clock rate
that actually goes to card. So this change calculates the data
timeout value based on the clock frequency that goes to card rather
than SDCC controller's clock frequency.

CRs-Fixed: 450675
Change-Id: Icd8b648eae0ad4efad2598749bed7b0bd65c65c9
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
msm: audio: qdsp6v2: Fix seek issue in tunnel player

- Seeking to 0 position during tunnel playback, music stream
  jumps to incorrect postion.
- Initial buffer after seek to new position is corrupted as
  flush ioctl is not synchronous. Ioctl FLUSH is posting
  CMD_FLUSH to DSP, but WRITE_DONE to user space are posted
  even before it receives FLUSH ack from DSP.
- Fix is to wait for FLUSH ack from DSP, then post the
  WRITE_DONE events to user space, which will ensure FLUSH
  is completely handled.

CRs-Fixed: 425420,458910
Change-Id: Ieca3353dba3a67af39a2967659034f073acf5277
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
msm_fb: display: Wait for DMAE for external interface (DTV)

When calling FBIOPAN_DISPLAY for external, there is no wait
which results in irregular fps when tested with fbtest.
Enable DMAE wait to wait until DMAE is over thereby fixing
irregular fps shown in fbtest results.

Crs-fixed: 438078
Change-Id: Iff528ccc17a1e4078c8825b35d4778a7d9e40e7f
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: mdm: modify qsc power up sequence on sglte2 platform

The sglte2 platform has an external qsc modem that is powered
up by asserting two pmic gpios from the apps processor. One gpio
is connected to PS_HOLD on the pmic of the qsc modem and needs to
be pulled high when the apps processor boots up. The other gpio
emulates a keypad power keypress and needs to be asserted only
when the qsc is powered up for the first time. The PS_HOLD gpio
can be toggled later to perform a soft reset of the qsc.

The keypad gpio may be inverted on some platforms so add a flag to
platform data so that this can be indicated to the kernel driver.

Change-Id: I5fdcf5f9ed867a6178b1a4f782e4cc65951831c3
Signed-off-by: Joel King <joelking@codeaurora.org>
msm: wfd: Map double the size of reconstruction buffer

The MFC core has a hardware bug which causes it to access memory beyond
what is given.  This commit adds a workaround by mapping double the
buffer size into IOMMU.

Change-Id: Ib20a44f140f6c34d3e85205afb1cd00ee74f263c
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: vidc: Invalidate cache when allocating buffers

We need to remove stale entries in the cache when allocating buffers, as
the ION driver doesn't invalidate the cache.

CRs-Fixed: 456500
Change-Id: Ibe931251b6f06c6acbe6bc8a095b0e925dc08857
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
msm:rq_stats: Add hotplug disable attribute

Register for suspend and resume notifications from kernel. This should
be done as part of core_initcall so as to receive notification as close
as possible to the actual event. Add hotplug_disable attribute to
rq-stats node. Set/clear this attribute based on the suspend/resume events.

CRS-fixed: 452456
Change-Id: I76fee349b57f47df40785e9c2503e2e1cc6e064e
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
mmc: msm_sdcc: check for pending_resume in SDCC system suspend

If system comes out of suspend, msmsdcc_pm_resume() sets the
host->pending_resume flag if the SDCC wasn't runtime suspended.
Now if the system again goes to suspend without any SDCC activity
then host->pending_resume flag will remain set which may cause the SDCC
resume to happen first and then suspend.

To avoid this unnecessary resume/suspend, make sure that pending_resume
flag is cleared before calling the msmsdcc_runtime_suspend().

CRs-Fixed: 438081
Change-Id: I2b667bec704f938a532d4780dd9b7937e2eb12c7
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Bluetooth: GAP: Disconnect ACL immediately after Auth failure.

The patch fixes issue of ACL lingering for 2 seconds after
Authentication failure. Another Auth request during this
time results in improper connection reference and hence
resulting in ACL to persist forever if remote doesn't
disconnect.

Change-Id: Ief920af97d8f27e93460130dc86113b40dc5f6a5
Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
msm_fb: hdmi: Remove supported resolution check

The change will remove the supported resolution check while turning
on the HDMI. The supported resolution is updated on parsing EDID for
VIC and matching it with default mode in HDMI. This may fail in case
the default video mode is not available in EDID of TV resulting in
HDMI turn on failure.

Also, this check is not needed because we now have the HDMI display
pipe line check which will make sure we do not turn on HDMI if it
is not supposed to be turned ON.

CRs-Fixed: 461486
Change-Id: I09ba863cb6f56c6c5d599b91516855f0540f17c3
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: hdmi: Update frame rate on resolution change

On resolution change, we need to update the frame rate as well.
Video mode programming in HDMI can also be based on frame rate.

CRs-Fixed: 461486
Change-Id: I4cf1192796482ec0aa7aa130297f740c96115e08
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>