qpnp: pwm: PM8110 pwm changes for backlight

Qualcomm PMIC chipset PM8110's ENABLE_CONTROL register
definition is different from other pmic chipset. So avoid
modifying the other bits in ENABLE_CONTROL register when
pwm_config is called.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Create for_each_sd_topology()

For loop for traversing sched_domain_topology was used at multiple placed in
core.c. This patch removes code redundancy by creating for_each_sd_topology().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
jiffies conversions: Use compile time constants when possible

Do the multiplications and divisions at compile time
instead of runtime when the converted value is a constant.

Make the calculation functions static __always_inline to jiffies.h.

Add #defines with __builtin_constant_p to test and use the
static inline or the runtime functions as appropriate.

Prefix the old exported symbols/functions with __

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: vidc: Check input arguments correctly

This commit fixes some minor bugs in which input arguments or malloc
return values were being insufficiently validated.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
build: Dont initiate SELinux in Permissive mode

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Report lineout immediately

If extension cable is inserted into the jack, it
is taking 5 sec to report the insertion. Reduce
this delay by reporting high headphone immediately.

Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Notify mbhc when TX1/IN1 path is enabled

Notification is sent to mbhc whenever TX1/IN1 path is used
for audio capture. MBHC then will switch to VDDIO if headset
is inserted. This is to avoid polling noise that gets captured
in the recorded audio due to noise coupling in hardware b/w
TX2 and TX1 paths.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Fix RX Ear register gain values

Rx Ear Gain register on WCD9306 supports different gain
values from 6DB to -12DB. It was wrongly configured with
2DB. This change fixes the issue and adds support for
correct gain values for Ear PA Gain.

Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoc: msm : update speaker gain control.

Configuring speaker max gain as 8 in the SPKR_DRV_GAIN register.
Other wise the gain setting when the invert flag is set will differ.

Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Add support to change bit rate during VoIP call

Add support to change the bit rate for AMR NB and AMR WB
vocoders while in VoIP call. This change is needed as part of
supporting VoWLAN feature.

Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Add support for MBHC 5-pole plug detection

Add support to determine the presence of second microphone
on a 5-pole plug used for active noise cancellation.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ALSA: jack: Add support to report second microphone

ALSA jack framework currently supports reporting only
one microphone. Add support to report presence of
second microphone to the userspace.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Add support for 96KHz/192KHz sample rate playback over HDMI

Add support for 96KHz and 192KHz sample rate audio playback over
HDMI. A mixer control has been added to select 96 or 192 KHz sample
rate on HDMI backend.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Fixup number of channels for FM transmitter

Backend during FM transmission supports only stereo
channels. Fix up the number of channels to 2 for FM
transmitter.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: Parse the jack type property

Parse the property from device tree to check
the jack type.

Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Handle anc headphone detection with slow insertion

When 4 pole/5 pole/6 pole headsets are inserted into jack with
anc support, we need to handle cases of slow insertions as it
might lead to incorrect detection. Reconfirm the plug type in this
case if anything other than headset is found.

Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Use button polling with anc headphone

Anc headphone can be considered as a headset without microphone.
Button polling can be used to catch removal for such headsets.

Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: Add 16 bit PCM as default format for backend

Add 16 bit PCM as default format for backend. This sets
backend tx format to be 16 bit pcm in case of tunnel mode playback

Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: qdsp6v2: Change incall recording to be session based

In current design, recording will be enabled for all the sessions.
When multi sims are supported, recording will be started only on
active session.
Refactor incall recording function to start and stop recording on
a specific session.
Add mixer control to set session vsid.

Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: msm: qdsp6v2: Add DTX support

Add support to set DTX mode ON/OFF for EVRCB, EVRCWB and
EVRCNW vocoder formats.

Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>