sched: Remove get_online_cpus() usage

Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9xxx: Synchronize button press with notifiers

Button press handler and event notification handler needs
to be syncronized so that they do not interfere in the
excution leading to incorrect register writes or threshold
updates.

CRs-Fixed: 637805
Change-Id: I51ebf1d546aa59e219ce71517970b35730589b6c
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: camera: Avoid memory corruption by changing order of enum

SET_POSITION is added above MOVE_FOCUS which makes kernel prone to
memory corruption as MOVE_FOCUS enum is changed. when CFG_POSITION
is not present and userspace calls MOVE_FOCUS kernel misinterprets
MOVE_FOCUS as SET_POSITION and thus copies user structure to wrong
structure and makes memory to corrupt.

Change-Id: I335ee28d9af6ec25b00262d71701e503a06e21c5
Signed-off-by: Lokesh Kumar Aakulu <lkumar@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
mmc: core: fix the issue with clock scaling in HS400 mode

Clock scaling feature would scale up/down the MMC interface clock
frequency based on the load on storage. During clock scale up in HS400
bus speed mode, SW is unncesserily doing the tuning even after HS400
switch is done. This change fixes this bug.

CRs-Fixed: 660534
Change-Id: I4de06962a3fe6dba2e7ff8420d9a3e3997b33ba1
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
camera: isp: create debug fs entry to log vfe overflows

Added entry in fs to log occurence of overflow from vfe

CRs-Fixed: 661343

Change-Id: Id398d11aaa84fca4ea63ea523c78c564c7eb6999
Signed-off-by: Katta Santhisindhu <kattas@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ARM: dts: msm: Update bus bandwidth votes for sdhci on 8974

Some versions of 8974 supports eMMC HS400 mode providing maximum
throughput of 400MB/s. Update the list of bus bandwidth votes to
make sure appropriate vote is placed in this mode.

CRs-fixed: 656702
Change-Id: I5e3bed70d8c8c1c6423483f7469849823e3ebb2c
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: ultrasound: support up to eight TX and RX channels

Ultrasound digital pen service requires six TX channels for
the service performance improvement.

Change-Id: Id01f9cf2c9df6a55a72bfa395ffe1c2e85d8cdc7
Signed-off-by: Ravit Dennis <rdennis@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: Set HPH bias currents to low power mode

Setup the headphone path PA and DAC bias currents to low power
mode to increase power consumption efficiency

CRs-fixed: 485961
Change-Id: I9492e70f404f96502c7283b38f0d1f3738647d4c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: remove hard coded mad mic bias

Currently MICBIAS1 is hard coded as bias needs to be turned on
by MAD HW. Expose a control to user space to set MIC input needs
be used by MAD. Based on the mic, set the correct mic bias to be
used by MAD HW by scanning machine audio routes.

CRs-Fixed: 538266
Change-Id: Ib85be87e50554b9587f7bafb5b58333a88df6766
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: Fix the VI feedback enable/disable sequence

Speaker protection is supported only in slimbus mode.
Voltage and current data is captured using TX11/TX12
ports in slimbus mode.For I2S mode Voltage and current
data can be captured using TX9 and TX10 ports.
Quad mic recording usecase uses TX9/TX10 ports, hence
in slimbus mode TX9/TX10 ports shouldn't be used for
speaker protection.Change removes the enable/disable sequence.

CRs-Fixed: 561097
Change-Id: I9642e703d3ab884ae1260569020853b71e26709d
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: Update buck control and mode registers

Leave BUCK control registers as default and set to lower BUCK ref voltage
for avoid pop noise during playback initiation.

CRs-fixed: 506099
Change-Id: I47c068fc8344108dcd5b2c63f8a5c0a5e40a4c8b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9xxx: fix class H controller driver to handle concurrency

Fix class H controller driver's finite state machine to handle concurrent
playback.  This makes audio playback quality to be better with less power
consumption.

CRs-fixed: 506099
Change-Id: I621fa5a4df9964fda6c51c70e50ece2e783cafb6
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: Configure codec hardware in optimal mode

Update class H controller registers to configure codec in optimal mode.

CRs-fixed: 506099
Change-Id: I26ec0ad04bcec511ea2a37d2e357bae0345bd2a1
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: Handle overflow/underflow slimbus interrupts

When slimbus overflow/underflow interrupt is observed on a slimbus port
interrupts will be firing continously. This change will disable
interrupts from the port when undeflow/overflow interrupt is recieved
to avoid continous interrupts. When port is being enabled codec driver
will turn on interrupts if they are disabled.

CRs-Fixed: 576679
Change-Id: I5155eeb08b9a7b81260e4320d1f97c9e44df9918
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: Prevent calling PA event unnecessarily during ANC

When Headphone ANC is enabled, do not call the headphone PA event
in pre-power down case, only in post-power down.
Headphone PA event will only process this call in post-power
down case.

Change-Id: I61ba96ae038c2e0aa4dc3d01048f33e6a5e97d86
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: wcd9320: increase DMIC CLK drive-strength

Increase DMIC CLK drive-strength for WCD9320 codec from 2mA
to 4mA. This increase will improve setup and hold times for
DMICs in WCD9320 codec.

Change-Id: Id8603a994281b9c7f1a3eeb2d258ce2805f03575
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
[media] Revert "[media] v4l2: vb2: one more fix for REQBUFS()"

This reverts commit 31901a078af29c33c736dcbf815656920e904632.

Queue should be reinitialized on each REQBUFS() call even if the memory
access method and buffer count have not been changed. The user might have
changed the format and if we go the short path introduced in that commit,
the memory buffer will not be reallocated to fit with new format.

The previous patch was just over-engineered optimization, which just
introduced a bug to videobuf2.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Change-Id: I537d5dcc025a176111fefc4bcdad934266373573
Git-commit: bf7b73efb7f52abf56b512546c3bbc35001dd696
Git-repo: https://github.com/torvalds/linux.git
Signed-off-by: Pushkaraj Patil <ppatil@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: remove interruptible timeout waits

Currently display driver contexts are not utilizing interruptible
wake-ups while using wait_for_completion_interruptible_timeout. This
can lead to incorrect context wake-up and un-predictable outcome. Since
there is already a timeout attached to these kind of context sleeps, it
is safe to replace them with wait_for_completion_timeout.

Change-Id: Ia528debf34aef0acdda2bea1219a128c200c3651
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: mdss: Make notify update waits interruptible

Wait for completion in notify update call are uninterruptible
causing excessive delay during suspend cases. Making them
interruptible.

Change-Id: I1a4ff6ce3e0add21d4e46a41372b076b277d10f5
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: kgsl: Fix nice level for higher priority GPU start thread

Before, we were actually setting the lowest possible priority.

Signed-off-by: Dan Trifan <jimsth@gmail.com>