ARM: mutex: use generic atomic_dec-based implementation for ARMv6+

Commit a76d7bd96d65 ("ARM: 7467/1: mutex: use generic xchg-based
implementation for ARMv6+") removed the barrier-less, ARM-specific
mutex implementation in favour of the generic xchg-based code.

Since then, a bug was uncovered in the xchg code when running on SMP
platforms, due to interactions between the locking paths and the
MUTEX_SPIN_ON_OWNER code. This was fixed in 0bce9c46bf3b ("mutex: place
lock in contended state after fastpath_lock failure"), however, the
atomic_dec-based mutex algorithm is now marginally more efficient for
ARM (~0.5% improvement in hackbench scores on dual A15).

This patch moves ARMv6+ platforms to the atomic_dec-based mutex code.

Change-Id: I5cb600b15f891dc692356322b38cae1d692a084c
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
msm_fb: hdmi: Return proper clock get error code

This change returns the proper error code while in probe and trying
to get the required clock and fails. This is required for probe deferral
support.

Change-Id: Ief91b1f634c06d3679157313506b56e5948aa79c
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
ASoC: WCD9304: Add the compander support to wcd9304

The compander system is intended to increase the dynamic
range of an input signal. But for the wcd9304 codec,
this feature is to use companding in a novel way in the DAC
converter path to increase the signal noise ratio.
The change is to add the compander support to wcd9304
codec. The dynamic compander enable/disable during stream
playback is not supported.

Change-Id: If912302ee9d48dde1318e894a982cba591908d8f
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
msm: mdm: change where ssr_count is decremented

In fusion targets with more than one external modem, where
the modems are restarted together, ssr_count keeps track of
how many modems are still left to be completely restarted so
that any new SSR requests would be rejected until all modems
are restarted. Ssr_count should be decremented when the SSR
module sends the SUBSYS_AFTER_POWERUP notification instead of
during the powerup callback in order to be in sync with the
state of the SSR module.

Change-Id: I196f4937d929c54f475d251632f111404a2b3bf1
Signed-off-by: Joel King <joelking@codeaurora.org>
msm: camera: Add state check for sensor power up & down

Sensor state check added to avoid incorrect power up &
power down calls.

Change-Id: I278e8be1e346f93fa410b38086388f08c4f6ae31
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
media: dvb: Add initialization of PES error indicators

Following SDMX notification on PES data the errors indicators
for PES event were not cleared if SDMX did not report any error.

CRs-Fixed: 493108
Change-Id: I89b43ce193b96462b804848c5e484d25343d5f40
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
media: dvb: Fix race condition in DVR thread

When DVR thread is created, it may happen that user sets
DVR buffer mode to external buffer but did not yet set the
buffer itself, meanwhile, DVR thread checks whether the
input buffer was already set and if not the thread terminates.

This causes termination of DVR thread for no good reason.
DVR thread should be terminated only when DVR device is closed.
The change removes termination of the thread when input buffer
is not set yet to avoid such race condition.

CRs-Fixed: 493761
Change-Id: I57c9acd13bd493ae08d28703bf5f6c0dea55c20a
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
msm_fb: display: change TE simulation and read pointer interrupt timing

The current parameters for command mode TE simulation on mdp side are
not straightforward and cause double read pointer interrupts. Now make
read pointer interrupt and line counter reset happen right at h/w
vsync, and kick_off start position and height are set to back porch
and max respectively, so timing is much simplified and the chance of
tearing is reduced.

CRs-fixed: 463273
Change-Id: Ia25710556bc2b031cdfaaf08fee034baab33d124
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
ALSA: PCM: volume API implementation

Introduced a new helper function snd_pcm_add_volume_ctls() to
create control elements representing the volume for each PCM
(sub)stream.

Change-Id: Id483257c4fe84a909e7a4af3a5aa3e4f0d5d9ea5
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: msm: Add PCM loopback volume control

Add PCM loopback volume controls.

Change-Id: I4d942c16b524797ca535dd0467a830d19963e967
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
led: leds-pm8xxx: Add support to control compensation resistor

Add support to control compensation resistor of WLED
passed from the board file platform data.

Change-Id: Id5f36d49a532d8216ea9bc1415e67135d40ee18d
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
arm: board-8930-pmic: Pass WLED compensation resistor value

Pass WLED compensation resitor value via platform data.

Change-Id: I318b2edc817f50181bd2b7c08cb01b15b72cc5e6
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
msm_fb: Correct R and G offsets for correct mapping

R and G colors are swapped when ARGC test cases are executed.
Correct the color mapping to right register offset to fix
the color swapping issue.

CRs-Fixed: 491215

Change-Id: I4997acce577bdbbdf39e22502a678dbecf0bfc37
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
media: dvb: Fix parsing of SDMX results

When playing from memory, it may happen that demux thread
is stalled while parsing SDMX results due to PULL mode.
While thread is stalled it is possible that user asked to
add new filter and therefore the SDMX filter count increases.

When thread gets back from stalling, it may parse additional
filters result even-though they were not processed by SDMX yet,
hence parsing un-initialized data.

Change-Id: Idb9430ec07f5869585ed1ae9ab3d43c4d31ff4d2
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
msm: audio: qdsp6v2: Fix for kernel crash during stability

- Userspace calling AYSN_READ during flush, READ_DONE ack for
  this is coming after FLUSH_DONE which is hitting BUG_ON as
  buffers are removed from in_queue/out_queue during flush.
- Fix is to avoid sending READ requests to DSP until flush
  is complete.

CRs-Fixed: 485288
Change-Id: Ia2a64471a3507b3f5565b695c40cc6dd9081930d
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
Merge "media: dvb: Add initialization of PES error indicators"
Merge "media: dvb: Fix race condition in DVR thread"
Merge "media: dvb: Fix parsing of SDMX results"
msm: display: Proper handling of prepare and unprepare clocks

This change handles prepare and unprepare clocks properly to
fix clock mismatches.

Change-Id: I09986aa1f0e1a5be2e07655a1db0d23760dd0725
Signed-off-by: Sangani Suryanarayana Raju <csuryan@codeaurora.org>
msm: camera: Update op_pixel_clk for ov9724 sensor.

The op_pixel_clk for ov9724 sensor is not updated properly.
Since this decices the VFE clock while using this sensor,
this leads to violation errors from VFE especially during zoom.
Adjust the clk such that VFE clock is upgraded accordingly.

CRs-Fixed: 495462
Change-Id: Ice1bb722143ef24982b5ba7c5e528235bc779123
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>