Revert "usb: gadget: Add support for more than one configuration in android gadget"

This reverts commit 2a65e7c140d8d97d1fa4e14879c95860b65fabbc.
Revert "usb: gadget: Add support for multiple android gadgets"

This reverts commit 23dc77c36ac1d63e3c452f16592daa3fe0f9253a.
msm_fb: display: add mutex on overlay_play to fix iommu page fault

An iommu page fault may heppen When a pipe_commit is executed
in between of frame dropped and pipe_queue during overlay play.
An mutex is necessary to mutual exclusive between pipe_commit
and overlay_play.

Change-Id: I736e821c6c648a6ebd435303a1906a40e9b75791
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
arm: mm: Add VM_ARM_EMPTY_MAPPING flag to mark the PMD gaps

ioremap optimization to return the addresses from the static mapping
if already present added the feature to add the pmd empty gaps into
the VM area but don't map such gaps in this commit "19b52abe3c5d".

This introduces the problem when the pfn is 0x0 and ends up into the
empty section gap found by the fill_pmd_gaps. If the driver calls
the ioremap(0, PAGE_SIZE) then it will return the address which is never
mapped, and access to that address will result in the crash.

To resolve this mark the empty PMD gaps with new flag VM_ARM_EMPTY_MAPPING
instead of the VM_ARM_STATIC_MAPPING, so that ioremap only checks
the VM_ARM_STATIC_MAPPING flag and skips over the VM_ARM_EMPTY_MAPPING
sections.

CRs-Fixed: 385828
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
(cherry picked from commit 79db1f312b18f7390453c5e5562f35b2ad4f3b46)

Change-Id: I893150e42100c16cbd47dd1c217629c8db3a4372
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
board: msm: Set the backlight using MSM GPIO during suspend

Set backlight during suspend to a non-zero level using MSM gpio
during suspend so that the backlight comes up during resume
on MSM 2.0 REV 8x25 EVB.

Change-Id: Id07da20e2721ad6b9c70d6b6e6ea2b8e649428b4
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: board-7627a: Feed in reserved sizes via variable

ION reservation at boot-time is subject to change via
early parameter or dynamically at runtime. So, let's
not define all the sizes rigidly via macros, instead
use variables.

Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>
(cherry picked from commit cb0a07a12c002d2f4d757466663c67bc34cb3152)

Change-Id: If18f6f8c26f4fdcc9dc805da80084222342334ea
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm_fb: display: fix page fault during supend/resume

There has VG1 pipe commit (pan display) happen after system
suspended. This left VG1 still staged up at mdp mixer. Once timing
generator is enabled at resume, VG1 pipe start fetching contents from
address 0 since VG1 has not yet be configured. This cause page fault.
This patch has sanity check at system suspend to make sure no any pipe
stage up at mixer after suspend.

Change-Id: Idcf974ceb4afe2a3ec55b9603b700fa497f84045
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix mdp crash during overlay unset

Check real_pipe address before refer to it.

Change-Id: I2f8c6fa6f8e657801dc676f7d9887e7eb0f10e73
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: add wait for overlay0 done

Dcs command mode BLT involves both overlay0 done interrupt
and dmap done interrupt. A transaction is start at kickoff and
end with done interrupt.  At some corner cases both overlay0 and
dmap transaction need to be completed before kickoff of new transaction.

Change-Id: I5a3cc6e8255acf2c61fc627d35f990182d226f63
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: cpr: Enable CPR support for 8625

CPR (Core Power Reduction) helps save CPU power by
reducing the chip voltage whenever possible

Change-Id: Ifa32967046b4bb7f5b4f756feb9cefabe8f5bea4
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
msm: kgsl: Ensure correct enable sequence for 2D core clock

Calling clk_set_rate() for both AXI & 2D core clocks without putting
them in async mode causes 2D core hang. Since AXI & 2D core clocks
are in sync mode, ensure that clk_set_rate() is called only for AXI
& 2D core clock is enabled only after it is prepared.

CRs-fixed: 385393
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
(cherry picked from commit 9c4d95c79aa85364664e8e6c3fcec2c48a7b8f9d)

Change-Id: I09e8d107241c2204ff15a39fe5d1dd0dea4d22f6
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
msm: devices-msm7x27a: Only 8x25 v2.0 SoC supports 320MHz GPU

Ensure that only 8x25 v2.0 SoC supports 320MHz as GPU frequency. Older
versions can only support 300MHz as max GPU frequency.

Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
(cherry picked from commit 5fb30ef0a28442acd6b7bda755fb5eb55d9e4d87)

Change-Id: I4a9bc0780ef5cbc45e2d69de1df7c9104e32b59c
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
ASoC: wcd9310: force slimbus ports to disconnect during error cases

With shared data channel architecture, SLIMBUS driver
only removes slimbus channel when all clients vote to
have channel removed. In case of subsystem restart,
client such as MDM can go down without withdrawing
vote. During CODEC path shutdown, CODEC driver will
receive slimbus slave interrupt in time indicating
port disconnection because slimbus channel has not
be been voted off. Then, CODEC driver blindly
shutdown rest of CODEC path. This results in
overflow error on Rx path and underflow error on
Tx path. In case of time out waiting for port disconnect
interrupts to arrive, force ports to disconnect

Change-Id: I33f5aba16c02fe4bfdb903b50120460e460acefb
CRs-Fixed: 388030
CRs-Fixed: 388967
Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
msm_fb: HDMI: HDCP: Start HDCP authentication as a work item

HDCP authentication should be kicked off as a scheduled work
item so as to ensure that MDP is already configured and frames
are being transmitted over the HDMI channel prior to the start
of the HDCP authentication procedure.

Change-Id: I27cab44babfc24d91a318b0641674f85910cc33f
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
msm: kgsl: Update pagetable on context destruction for A20x

Ensure that pagetable is updated during context destruction. This
resolves stability issues during Camera launch/exit scenarios. Applies
only to A20x GPUs. This change is already done for Z180 device.

Change-Id: I978cbce49ed2b45be0209c2939b1b8423c68d5ec
CRs-fixed: 381875
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
msm: kgsl: Return error code when ION setup fails

ion_import_dma_buf() can return a NULL without an error code. Detect
this condition & return a -EINVAL as error.

Change-Id: I18d058fd374a8d00c00bb943f496f446c9f1c90d
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
ASoC: Add locking in DAPM widget power update

While playback and capture is done concurrently the dapm widget
data is accessed parallelly which results in data corruption and
kernel panic. Fix this problem by serializing the stream event
operation by adding lock

dapm_seq_run will invoke dapm power sequence for pre-sorted list
of widgets to be powered up. Kernel panic issue is observed
during stability runs with the above sequence caused by null
pointer dereference in dapm_seq_run_coalesced. Fix kernel panic
issue by checking for valid snd_soc_dapm_context pointer in
dapm_seq_run before invoking dapm_seq_run_coalesced

Widget list in dapm is getting corrupted during concurrent
use cases where dapm_power_widget is accessed. This corruption
is resulting in kernel crash in dapm. Fix the issue by adding
protection in dapm_power_widgets API.

Change-Id: I49d19860277726cf3152e104ab40627fd56c021c
CRs-Fixed: 388785
Signed-off-by: Sriranjan Srikantam <cssrika@codeaurora.org>
slimbus: Decrement channel reference during reconfigure now

Slimbus clients can specify multiple add/remove channel requests
through control_ch API, followed by reconfiguration request (also
known as "commit request"). Clients may rely on the reconfiguration
request to actuate the channel activation/removal and not the
control-channel API.
So the channel reference should be decremented during reconfiguration
request, and not control_ch API.

CRs-Fixed: 389518
Change-Id: Id6ff57c6a4cad878e35004937fb08daf3b9afe7b
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
slim_msm: Keep track of satellite reconfiguring a channel

With mutiple clients able to use the same channel, it is not correct
assumption that a channel was active due to satellite client's
reconfiguration only. So during sub-system restart of a satellite,
rely on satellite-reconfiguration vote for a channel instead of
channel status to remove channels that were setup by the satellite
before sub-system restart.

CRs-Fixed: 389514
Change-Id: I825381f15cb55396fece5b390d395c7f0a7580ff
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Asoc: msm: 8064: Set channel number based on recording mode

The shared channel number can be overwritten by front-end
DAI's channel setting. Add fixup function to set the correct
channel number based on recording mode in the machine driver.

CRs-Fixed: 389709
Change-Id: I98088885c346618abb4ffd682ebbb652e84a436c
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>