msm: camera: Fix for inverted preview with front camera in 8930
             fluid device.

             Changed mount angle for front sensor(mt9m114) in 8930
             fluid from 90 to 270.

Change-Id: I47b7b211507963a1c25e67cb5b6131b3143ba349

Signed-off-by: Sai Kumar Sanagavarapu <ssanagav@codeaurora.org>
msm: camera: Fix flash issue timeout

Add timer and refresh logic for flash to work
in torch mode until user changes flash stae.

Change-Id: I9f6e5fb8de60015d354234c65fd0e53733bcb4f5
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: display: provide mdp bandwidth parameters from board file

Underrun issues can be solved by changing mdp bandwidth parameters:
max_bw, ab_factor and ib_factor. However these parameters are not
universally same for all targets, and one set of values that works for
one target could cause underruns or higher power on other
targets. This is board side change.

CRs-Fixed: 464492
Change-Id: I2a8fbb9018011ddf42dfa50b371e450e38f4351a
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: get mdp bandwidth parameters from board file

Underrun issues can be solved by changing mdp bandwidth parameters:
max_bw, ab_factor and ib_factor. However these parameters are not
universally same for all targets, and one set of values that works for
one target could cause underruns or higher power on other
targets. This change is driver change which makes those parameters
target dependent.

CRs-Fixed: 464492
Change-Id: Ib23ebc431caabbe91c7ae3bd96bb38789d7ddc90
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: vidc: Fix possible memory corruption

This change fix the possible memory corruption
by increasing the local array sizes in video
encoder.

Change-Id: If03cee2f428c3cef863178da70bc083159f203f5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: kgsl: pwrscale functions should be run while GPU is ACTIVE

Base the decision to call power scaling functions on the current
state, not the requested state.  The GPU may not transition to the
requested state; call through based on current GPU state instead.

Change-Id: I1524bc92c908dc50a60b5815f2221ae3feef59be
CRs-Fixed: 441847
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
msm: ipc: Security updates to IPC Router

In order to provide fine-grained access control to QMI services,
a security script from user-space will feed the security rules to
IPC Router. The security rule implies that in order to send a QMI
message to a service, a client process should belong to a specific
Linux/Android group. IPC Router, after receiving the security rules,
will enforce the access control rules.

Change-Id: I49f8d7c0067fc37cb0b4de2ccb46a575905ef64f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Allow QMI clients to send messages after IRSC is complete

Currently there exists a small time interval during initialization
where QMI clients in user-space can communicate with QMI services
before the IPC Router Security Configuration(IRSC) is complete.

Only allow clients to communicate after IRSC is complete.

Change-Id: I773ad5b3cb02c51a725cd60a77466876c1498b64
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
msm: ipc: Security updates to IPC Router

With the fine-grained access control in place for QMI clients, default
security check in socket create operation is redundant. Update the
IPC Router to perform the default security check only for the
bind operation, which is used during QMI service registration.

Change-Id: I967dbc3d414d39d307c071ff49c319828b5ed19e
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
ASoC: wcd9310: Disable Mic Bias Pull down prior to enable micbias

Pull down Mic Bias and add a delay of 250ms to avoid issue
of something else pulling up the mic voltage other than mbhc
polling prior to enable micbias when recording starts.

CRs-fixed: 431573
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
(cherry picked from commit 1b9a309c9a58bfd47d0e6dee75cfd6fea12e0760)

Change-Id: I575cc61c1f0d9956958768f8852b87695bb2211c
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
ASoC: Avoid putting stream state to STOP when stream paused

When multiple Front-end are using the same Back-end, putting
the stream state for a Front-end to STOP will make the the Backend
stream to be released, when the front-end is paused. This will avoid
the Backend to be released (when another active front-end stream is
present).
Instead, put the stream state to PAUSED, which will keep the Back-end
ON.

Change-Id: Ic31bf90a09b605b91f6b9fe3c09361b1145581fb
CRs-fixed: 428825
Signed-off-by: Banajit Goswami <bgoswa@codeaurora.org>
ASoC: WCD9304: Fix Headphone + Lineout concurrent audio playback

During concurrent playback on headphone and lineout, it is observed that
headphone is enabled in class G mode. This causes incorrect routing to
lineout. Fix by making sure headphone does not operate in class G mode
when there is concurrent playback on headphone and lineout.

CRs-fixed: 421247
Change-Id: Ib1f38deb453d6dbbcf86f69a117e6dc812b61546
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
msm_fb: Fix adb shell start/stop issue when bypass enabled

Currently when 2/3/4 layer bypass is enabled, doing a adb shell
stop/start is failing overlay and composition happens through
GPU. Fix this issue by proper overlay configuration during this
scenario.

Change-Id: Ia04f1839bf80ed552671e48445af63a4dcd6bdfd
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: ipc_logging: Update function stubs

If IPC Logging is not enabled, but is still used, then the stubs will be
multiply defined because they are not static inline.

Make the stubs static inline.

CR-fixed: 456106
Change-Id: Id39c8f27acb952228b40012726e6b761defd16fb
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Signed-off-by: Arun Kumar Neelakatam <aneela@codeaurora.org>
msm: sglte2: prevent early bootup of the external qsc modem

The gpio connection to the KPD_PWR_N pin of the external qsc modem
is not inverted as it was in previous sglte targets so configuring
the gpio LOW initially was causing the qsc modem to boot up too
early. Change the configuration to HIGH and set the platform data
flag that tells the mdm driver that this connection is not inverted.

Change-Id: I240f056443aa2eb2fb2bfa192894054b610e91ff
Signed-off-by: Joel King <joelking@codeaurora.org>
msm: mdm: add a parameter for the name used to register for SSR

The name that that mdm driver uses to register with SSR is used
by other drivers to register for notifications, so it must be a
system-wide, known string. The mdm driver was previously generating
an arbitrary string that only it knew about. The name needs to be
passed to the mdm driver instead of it being auto-generated.

Change-Id: If8dab185b5599e95f2087bab97d48e5c72311279
Signed-off-by: Joel King <joelking@codeaurora.org>
gpio: msm-common: Fix irq_set_type for dual edge trigger

msm_gpio_update_dual_edge_pos() function will set correct
trigger type based on the current gpio level in case that
the interrupt type is both edge trigger type (IRQF_TRIGGER_RISING
|IRQF_TRIGGER_FALLING). Later again we set the msm_gpio_irq_extn
set_type with mpm to set it as IRQF_TRIGGER_RISING.

Avoid configuring the type with mpm if it is dual edge trigger.

CRs-Fixed: 421325
Change-Id: I049362e7f7eacdeab13d4c6b190262c015419efd
Signed-off-by: Taniya Das <tdas@codeaurora.org>
msm: vidc: Fix codec config frame with EOS flag issue

This change fixes the issue with improper handling of
codec config frame with eos flag in smooth streaming
scenario.

CRs-fixed: 467211
Change-Id: Iafd0a1a5a9073458fd139ed5845585747e51be8a
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: camera: Add proper camera close sequence

Update camera driver to handle closing sequence properly
when there is a crash in userspace threads to restart
camera again.

Change-Id: Ic1956975fd18d262e9cf503055fb09d391f8c7d7
CRs-Fixed: 467053
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
msm: camera: Add proper camera close sequence

Update camera driver to handle closing sequence properly
when there is a crash in userspace threads to restart
camera again.

Change-Id: I2adc459c53114ce0f8fdd3e7d86425fce63d7e76
CRs-Fixed: 467053
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>