Add audio backend to hwdep interface. This is to provide ioctl
interface to communicate to routing driver.
CRs-Fixed: 661018
Change-Id: Id38cce4be2cebd89bbedc100553c733aa9e90739
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Different headphones have different impedance that results in
volume level difference on ears, as lower impedance headphone
will have higher volume with the same gain on PAs while the
headphone with higher impedance will have lower volume.
Add support for impedence detection for WCD9330 codec which
can be used to adjust the headphone volume levels.
Change-Id: I1f785ca040f83e45e2f999fd124ce2000e9cba44
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Add the check for the DSP return status code before using the size
to copy the data into the destination buffer. If the DSP returns
an error, the size should not be used, an error should be returned
instead.
CRs-fixed: 668331
Change-Id: Ia27de9f59fbd14ac5c829ba3f1d89a0175f7a7a1
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
default hw boost setting for analog_current is disabled.
Enable it to avoid PMIC heating problems.
update boost settings for speaker as per qcrg.
CRs-Fixed: 675258
Change-Id: I86722a8066877538ea62f7ddc57b1c6b07a23e62
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Implement AFE get and set parameter interfaces. These new
interfaces are used to support AFE real-time calibration
through QACT tool as part of AANC tuning process.
Change-Id: Ieba57a9a79fae3906fb3cb7f59b00d221ad07738
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
When kernel is compiled for 64 bit and userspace client is in 32 bit
mode compat ioctl path will be taken.If platform driver supports compat
mode asoc framework should call compat function pointers.
Change adds support in asoc framework to support compat mode.
Change-Id: I4929bc89c2ad467cdc83f5a00fe9d38e425c3ca2
Signed-off-by: Gopikrishnaiah Anand <agopik@codeaurora.org>
Update machine driver with different functions for SEC
MI2S interface BE, which will cleanly enable the params
required for the respective BE.
CRs-Fixed: 673156
Change-Id: Iac61cd96314cb76e05d607b7a50370ac705bf5af
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
The ASoC machine driver provides callback to codec driver to setup
certain settings that are specific to the machine. It is possible that
machine driver does not provide this callback when there are no machine
specific settings. In such cases the callback will be NULL. Make sure to
not access the callback if it is NULL to avoid null pointer dereference.
CRs-fixed: 673401
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Change-Id: If952e99310c9b633429fe0c803336a393ef0085c
The ASoC machine driver provides callback to codec driver to setup
certain settings that are specific to the machine. It is possible that
machine driver does not provide this callback when there are no machine
specific settings. In such cases the callback will be NULL. Make sure to
not access the callback if it is NULL to avoid null pointer dereference.
Change-Id: Ibd9aeb1157ac3b44525ba5ce2562c02981a88f51
CRs-fixed: 673401
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
pcm lib of alsa framework doesn't expect any userspace structures being
passed for a ioctl command.If compress driver recieves a ioctl not
supported by it return error instead of calling pcm library.
CRs-fixed: 664419
Change-Id: I2f46e087f95ce7edeac1a9b82f76ed2fb6f2d195
Signed-off-by: Gopikrishnaiah Anand <agopik@codeaurora.org>
Update the RCO enable and calibration sequence for wcd9330 to achieve
the best drift performance.
Change-Id: Id4d1e27462b811aa94f459b5ff48bc19f55f00f3
CRs-fixed: 665318
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Enable qfuse sensing for wcd9330 so that the qfuse data
can be correctly read back by other application afterward.
Change-Id: I6f50be93ae4bbd6b41af937842de594306006996
CRs-fixed: 665318
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Add Qfuse sensing function for wcd9330 so that qfuse data
registers will get updated with correct values which will
then be used for other codec functionalities.
Change-Id: I69c9bb00f0fc094e5d49d7c970ebf090e1ba2352
CRs-fixed: 665318
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Output channel gain is product of per channel gain and master gain.
Hence if only per channel gain is set and master gain is set to 0
then no audio is heard at the output.
Ensure that if we change per channel gain then we set master gain
to unity and vice versa. This enables only one gain to be effective.
Change-Id: I4cc2990efbb3e86edcc3d4328761cb64ed8fa775
Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
Repeat mode is not working in pcm offload path. When two streams
are used in a single session pcm format block should be sent
specific to each stream. Data sent on stream 2 is ignored by DSP
because pcm format block is always sent on stream 1. Fix is to
update pcm media format block to use correct stream id before
data is sent to DSP.
CRs-Fixed: 673510
Change-Id: Id9369f9927fbd301ed6020ea9e35942b54305610
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Locks in voice driver is acquired in a specific order
i.e common_lock first and then voice_data lock. However,
in voc_disable_cvp(), voice_data lock is acquired and
common_lock in voc_set_ext_ec_ref() which will lead to
a deadlock if called in different thread contexts.
CRs-fixed: 669106
Change-Id: I73fd9960198190f9b4a7f1eb2aa29bd46749d14b
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
During fast switching of audio playback, we need to wait
for 5ms for the LINE PAs to get settled down before enabling
them again for playback. Same delay is also required after PA
is enabled. Add the required delays after LINE PAs are enabled
or disabled.
CRs-Fixed: 668339
Change-Id: Ie51a88c7a3359660aa416bb23131ca4ac0c49b7a
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
The present ear boost enable sequence enables the boost clock
and the disable sequence disables the bypass before disabling
the boost module. The change does not enable the boost clock
and the boost module is disabled before the bypass is disabled.
CRs-Fixed: 673800
Change-Id: Id347cc816b4985220bb76b6f6baea88ade343302
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Power down the static supplies during the suspend and power the
supplies back in the resume. This approach reduces the power
numbers during the suspend use cases.
CRs-Fixed: 671163
Change-Id: Ib03a460b1517f66e992b6655f9b4d29a8df63a7c
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Add suspend and resume call backs to the codec driver to make
sure the clocks are disabled.
CRs-Fixed: 662773
Change-Id: I7e68721b7249e948d5660bac0da8c97131fefd3c
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
8916 ULT audio core can support 9.6 and 12.28 MHz master frequency
and the frequencies can be used differently when internal codec only
or internal codec with external PA.
Add mclk frequency property in dtsi to inform machine driver to
configure master clock based on the value sent from the dtsi.
CRs-Fixed: 662773
Change-Id: I30880e13593477fe7f0c1211907ba6f3a1e2cd36
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Improve debug logs by adding function names. This
change is required to fix rarely reproducible
customer issues.
Change-Id: Ifb94a235cbe0f9df9ad40c82d3a38862dbd6b6cc
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
MCLK is tied with the audio session, and if there is a device
switch during the sessoin mclk should not be disabled.
Update machine driver MCLK event to handle this scenario.
CRs-Fixed: 664913
Change-Id: I9155a63cd7c31160215b23a8112b941f845967ac
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
8916 target supports external PA over secondary interface.
Add a property to inform machine driver about the external PA
present on the target add the pin control settings for
secondary MI2S interface to route to external world.
CRs-Fixed: 660843
Change-Id: Ic8b8699d7c018d8735080255e43a88da63bb98ed
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Update PCM platform driver to handle the reset events during
SSR and also unblock the write wait according to
the new SSR design.
CRs-Fixed: 661491
Change-Id: Id0b4950ffc0eb130dbfdce36375629a683752044
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Update codec driver to reduce the time for wait to check Q6 core
is ready.
Disable all sound end devices(headset, earpiece and speaker)
during codec down and codec up to reduce the noise output
during Sub System Restart time frame.
CRs-Fixed: 661491
Change-Id: I06f7124dda56bf867df32c3a03a63e1ee0e2bd94
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
On pmic 2.0, headset record is failing due to
mux setting is not taking effect.
As ADC2 MUX is not mapped to any register from
codec hardware, it needs to be declared as virtual
mux.
Change-Id: Ie236f16dc33b0b8f1e74822e8556a2d5bcf49e88
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
When speaker is powered up after headphones in combo device
use case, the power up sequence disables DAC_REF_EN bit of 0x193
causing no audio on headphones.
When headphones is powered down in combo device use case,
the power down sequence of headphones tears down the pdm clk
causing no audio on speaker.
The change adds a counter check that ensures that required resources
are not disabled in combo device use cases.
Change-Id: Ib2d0fcfe07dd5764a264739a9fb7ab706cd22342
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Invoke class AB sequence for headset path dynamically based on
module parameter. Change enables headset path in high performance
mode when module parameter is set to one.
Change-Id: If92d5c8516fbd903a9585785dba47c800be63dbc
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add 2nd Harmonic Distortion (HD2) tuning coefficients
for HPH path. HD2 coefficients get turned ON during HPH
enable and turned OFF during path tear down. Enabling HD2
coefficients would increase the Headphone PA efficiency during
audio playback.
Change-Id: I24bc053e6401d5b8f45dc62d88c7fe6a5ba01447
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Proxy port is used in audio usecases like wifi display, usb headset
playback.Memory map handle for proxy port was not cached since the
calibration index was not cleared after DSP responded to calibration
memory map command which resulted in audio mute for wifi display/usb
headset playback usecases.
Change clears the calibration index once a response for calibration
memory map is received.This change will ensure that proxy port memory map
handle is cached which resolves the audio mute issue.
CRs-fixed: 669389
Change-Id: I43c76d472daa9e539168f198969be36af5a0a10c
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Add register changes as per flatfile for rev 2.0
and maintain backward compatible.
Change-Id: I0060c4369ae66e624ea9d181048449d4e0cdf4f2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
LAB feature is used in listen for capturing PCM
data on successfull keyword detection from codec.
This change adds support for reading PCM through
pcm ops and controling LAB feature to enable, disable
and to stop LAB after capturing required amount of
PCM data.
Change-Id: I39d3f9e98442f0880fc33d8f7a7144134311db09
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Improve debug logs by adding function names. This
change is required to fix rarely reproducible
customer issues.
Change-Id: Iea1ee6e91853f24e53608699c0b82fb4373bc8eb
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Add VoWLAN dai link to the machine driver
to enable Voice over WLAN.
CRs-fixed: 662362
Change-Id: I3ada1f10436e5724670052901b648f46885d3bf6
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
LAB feature is used in listen to capture PCM data
once the keyword is detected. This change is used
for sending the IPC commands to CDSP to control LAB
feature. Platform driver will be able to start
and stop lab with the commands sent from CPE core.
Change-Id: I734a559f5cf4654a3ddeb8b658a9aad549a8bb04
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
After the SSR is triggered there is possibility of the mismatch
among the cache register values and the actual hardware registers
values. Due to this some of the registers doesn't gets updated when
the enable sequence is triggered. This results incomplete path
getting enabled resulting in no audio.
Fix by updating the registers to the reset state and updating the
cache also. Also restart the mbhc for the proper headset detection
CRs-Fixed: 663477
Change-Id: I851c303928dad1a0f36951ad40ac0b6a912e1757
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Update machine driver to handle MCLK enable properly for the
new sub system restart(SSR) design.
CRs-Fixed: 661491
Change-Id: Ib23e70fc253ca5fa6feaad25087795f1dd39df64
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Register a notifier for APQ8084 Liquid devices with USB
driver, which will be called-back everytime the device
is docked or undocked.
CRs-fixed: 651732
Change-Id: I8e87ee031fcffb7790b385f566b350efd5ca27f2
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
8916 supports external audio codec (tapan) over I2C\I2S.
Add suport for tapan audio codec and also add pinctrl support
for codec reset GPIO.
Change-Id: I3f2820139c644bd993c17e12e27f7a54f58f692e
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
While reading data via IN2 path, cross talk is observed.
To reduce it, we need to set 0x142 register to 0x2
at powerup for IN2 path.
CRs-Fixed: 668998
Change-Id: If2815134fe493196f2fded83c6ac789776cc4e5a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
In 8916, codec loopback cannot work due to the MCLK being disabled.
As codec loopback only happens during development test and
MCLK enabling/disabling is tied to sessions in normal use case,
add the Loopback MCLK mixer control to enable/disable the MCLK
dynamically via tinymix command along with other codec loopback tinymix
commands, while ensuring the SSR can work fine in normal use cases
CRs-Fixed: 664068
Change-Id: I5098496973c6142950413b64dc7213176dd27349
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Improve debug logs by adding function names. This
change is required to fix rarely reproducible
customer issues.
Change-Id: I61559b91e2bc735547821e808be6d796cd2af744
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
To reduce the click and pop from analog TX path, it is recommended
to adjust the TX FE corner frequency during path enablement.
Corner frequency is set to a higher value before the ADCs are enabled
and once the TX path is enabled completely, set it back to its default
value.
Change-Id: I939bf8a1ba45a49d89c9214d0c573ad833c6bdeb
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add mutex locks to prevent sending multiple mem map
commands unless the previous one returns, because otherwise
the mem_handle is overwritten.
CRs-fixed: 646752
Change-Id: I2a472430d4505c9f74ed033260e1e99cb787e03a
Signed-off-by: Vicky Sehrawat <vickys@codeaurora.org>
Check the pointers before memcpy when the application queries
the adsp capability for compressed audio. Invalid pointer
can cause kernel panic when doing memcpy.
CRs-fixed: 665297
Change-Id: I522deffc42f792b8dfdcf50272a80cd0d1e5a9ee
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
In MSM8916, battery monitoring system(BMS) goes into a low power
state when APSS is suspended. This can cause loss of BMS accuracy,
if APSS goes to suspend during a voice call.
Fix this by setting BMS power state to high/low during start/end
of voice call.
CRs-Fixed: 660545
Change-Id: I9b0c89e0626eadddbd46234fa99db15ae8d32a39
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
For 32u and 64k configuration, compat ioctl is added for
get_rtac_adm_info and get_rtac_voice_info.
Change-Id: I15aa20f7cd96a1c8d20360d8b76ffef306b1ca42
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
Current software hardcodes threshold registers, due to this we can not
detect all buttons properly.So update button threshold
registers to detect buttons with different resistances.
CRs-Fixed: 662091
Change-Id: Ie487163bffbcc57dc1c0cfae78f47d4c21643c7a
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Invoke class AB mode for headset path when sample rate
is set to 192KHz and bit width is set to 24. Change enables
headset path in Ultra High Quality Audio(UHQA)mode.
Change-Id: I6cd05952114b88602fc9dcc883d83a39214311b9
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
In case ADC TX FE gain is set in driver while powerup,
it overrides user setting from mixer_paths xml.
Change-Id: I9f3d01f0b0be0661a442899840b63458a812a94f
CRs-Fixed: 668665
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
PM takes more than 100ms to resume and then codec fails to acquire
pm_qos because of timeout.
Increase the WCD9XXX_SYSTEM_RESUME_TIMEOUT_MS to 300ms so that
the interrupt can be handled properly during suspend mode.
Change-Id: Ieaa2e6da678b9e4d6606d2354c195bda318524d0
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Do not enable CPE for wcd9330 codec unless specifically requested to
enable CPE through sysfs.
Change-Id: Ib017217c3acbfcda8fb0d3ffc19d414c368e39c1
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Update all kernel driver calibration clients to use
new msm_audio_cal audio calibration driver. Remove
old msm_audio_acdb calibration driver.
Change-Id: Ie38c566c5c39546972042257b083cdcf55f08e85
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Machine driver registers the board specific dailinks
with ASoC framework which is required for sound card
registration. Change adds dailinks to 8994 machine driver.
Change-Id: I67e35bcd3b6f0901f6d1f10f90ec79c79efaf86c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
During the powerup and powerdown of the HPHL and HPHR widget no
register is expected to be modified. So, the current implementation
uses virtual registers but since actual register values
are not modified, it results in inconsistent state during the
powerdown callback.
Replace the virtual register implementation with the virtual mux
widget present in the framework, which doesn't check against
change in register values during powerdown.
CRs-Fixed: 654640
Change-Id: I8c2ef0d601ecd8e8e659cf9d25e647631e9d4fd8
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Remove this driver as it is not used in B-family.
Change-Id: Ic2a06caa51a2cfbaeaf4076302f37c2549aad33d
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Current code resets the pa select from ear to hph
before ear pa is disabled. By disabling the ear pa first
and then resetting the pa select bit reduces the
ear turn off pop to 0.45uV.
CRs-Fixed: 643991
Change-Id: I5ca10ce7aca5ef07c8266fde93ef06ef809f81e9
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Add support to set analog gain for all TX paths.
CRs-Fixed: 661442
Change-Id: I6a106be77b490a468199018932172040d7426dfe
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
request_firmware called by MAD configuration requires
user space daemon to locate MAD codec calibration data.
When system is in suspend state either due to sleep or
user space daemon not ready or filesystem is down then
it needs be up briefly before accesing the codec
calibration data. This change fixes the accesing the
codec calibration data by codec when in suspend state.
Crs-Fixed: 609223
Change-Id: Id2d87363276619c9bd841ee335dc92c58bcc27c0
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
HDMI Tx core driver API "hdmi_cable_status" returns 0
if cable is not connected and returns "1" if cable is
connected. Audio session should only be started when
HDMI cable status is "1". Update HDMI codec driver to
have this status correctly conveyed to HDMI audio
sessions on startup to notify the active audio session
not to proceed with HDMI audio settings any further.
Change-Id: Iabe450c28ac2ff5463a1f7d6dbb6c31b5ff1d80c
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Add q6core commands to send license info to dsp.
Add kcontrol to send license info to dsp for validation.
Change-Id: I8b287b572844f7df1a7635e782d994a8df938b51
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
implements store_meta_info and get_meta_info API
metainfo is supplied by userspace to kernel driver via
store_meta_info, later this info is sent to ADSP by querying
using get_meta_info
Change-Id: Ic1202b906422baecf7d42738eca827b7f6046da2
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
Change the mixer to match userspace mixer control.
Fix the null pointer dereference caused in soc core.
This null pointer exception was found in monkey run.
Change-Id: I0b3ca551fd2c057edd54a9771a13354ce6f0b7d2
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Add volume mixer control per device id for pcm use case.
Change-Id: Ieab721541a5cdf494b7fad78abc06d4f667b4baf
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
The interface is needed to run Vibra audio on ULL
without PP at 48KHz.
CRs-Fixed: 659928
Change-Id: I0b883ee6a4211aec3282c6b03e7c1f88acc0e977
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
The combination of New AFE port and new backend added can be
used for multiple use cases and hence rename to more appropriate
nomenclature.
CRs-Fixed: 659928
Change-Id: Ibe7086be20abbb0aff894dd5033575a87a3a93b9
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Check pointer against NULL before passing it to function
to avoid crash when dereferencing it.
Change-Id: I1f3df67863f6b3caee25532a4376c2b99c02318b
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
If dpcm_fe_dai_open doesn't find a valid path,memory allocated for list
of dapm widgets is being freed.List is accessed in function after
freeing and it is being freed at the end.
This change will ensure that list is freed at the end to
prevent double free and any invalid access in case of error conditions.
CRs-fixed: 663092
Change-Id: I1c345459d8ba6f4b8e2d2545b298ea3c0c1797a2
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Change adds compat ioctl for supporting 32 bit userspace
client when kernel is compiled for 64 bit.
Change-Id: I3ac51187f9c53feaec4b2ea309beaefc4e9acf53
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
SVA feature is used for user voice recognition
and activation. Add mixer controls to support
SW only SVA over tertiary I2S in 8x16.
Change-Id: I5196f782d207fac2831b0acfed1ba97a366fae4e
Signed-off-by: Yamit Mehta <ymehta@codeaurora.org>
MultiMedia6 front-end dai link is added to supportasm loopback test.
Change-Id: I975d99d97bc32fa8b7d6bf00e2064fa90c09e7c7
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
Update wcd9330 codec register default values based on
the version (v1.0 or v2.0) that is detected.
Change-Id: I55d9b3a240a9a9c3ca9a33d96ccb99dca83a2e02
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Listen is a feature used for voice recognition and
activation. Listen can support upto 5 sessions at
present. This change adds FE DAI links in MSM8226
machine driver for Listen feature.
Change-Id: I27255b1f7fb38debef71e192a6355987d9ed7e13
Signed-off-by: Yamit Mehta <ymehta@codeaurora.org>
Increase proxy buffering to support 7.1
channels in Proxy. This is required
to support 7.1 WiFi display
CRs-Fixed: 634644
Change-Id: I735754b2c534f304d6b3fd9782e826bd7d5308b4
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Multikeyword supports different sound models. Keyword detection
status for sound model V1 and V2 are different. This caused the
event status for sound model V1 to fail even though the events
were from ADSP were correct. This change fixes the issue of
detecting the status correctly for Sound model V1 and V2 types.
Crs-fixed: 654078
Change-Id: Ia11a4e98813e40e80fd68e458fb9d33a37402035
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Add routing control to loop the data from primary I2S tx
to rx in asm module. And add the routing to support the asm
loopback on primary AUX PCM interface.
Change-Id: I1f9567617e02e791b2c4f5d4b70a01ad129eeff5
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
Compat driver should support compress ioctls when
COMPAT mode is enabled. Change adds support for
handling compress ioctls.
Change-Id: If7223ace326253240a1cd65bc9a111b8903977f1
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
The device configuration are different in case of MTP
and other device like QRD/CDP.
To differentiate based on target we need to register
different sound cards.
Change-Id: Ic6da013170c1e382c8229059643df605dc1ab56c
CRs-Fixed: 643801
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Enable smartboost for speaker configuration from codec. With this
configuration, the voltage will switch between 5V(boost voltage)
and Vbat(boost bypass mode) based on audio level. This allows for
an additional efficiency gain at lower audio levels when a boosted
voltage is not required.
Change-Id: I86f99cbd459bb62d836d24eb6be1e6c8b494b8eb
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
commit 415d555e6b upstream.
The recent fixups for HP laptops to support the mute LED made the
speaker output silent on some machines. It turned out that they use
the NID 0x18 for the speaker while it's also used for controlling the
LED via VREF bits although the current driver code blindly assumes
that such a node is a mic pin (where 0x18 is usually so).
This patch fixes the problem by only changing the VREF bits and
keeping the other pin ctl bits.
Reported-and-tested-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 4f8e940095 upstream.
PCM pointer callbacks in ice1712 driver check the buffer size boundary
wrongly between bytes and frames. This leads to PCM core warnings
like:
snd_pcm_update_hw_ptr0: 105 callbacks suppressed
ALSA pcm_lib.c:352 BUG: pcmC3D0c:0, pos = 5461, buffer size = 5461, period size = 2730
This patch fixes these checks to be placed after the proper unit
conversions.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 1555b65297 upstream.
The mask bits values were wrong for the SOC_VALUE_ENUM_SINGLE for the mono mix controls.
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit d31a33dd77 upstream.
The mask bits values were wrong for the SOC_VALUE_ENUM_SINGLE for the PCM/ADC Swap controls
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 7272e05115 upstream.
The shift values for the ADC,PCM, and Analog kcontrols were wrong causing wrong values for the SOC_DOUBLE_R_SX_TLV macros
Fixed the TLV for aout_tlv to show -102dB correctly
Fixes: 1d99f2436d (ASoC: core: Rework SOC_DOUBLE_R_SX_TLV add SOC_SINGLE_SX_TLV)
Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add the headset micbias type property and check it in MBHC driver.
If the external micbias is used for headset mic, don't enable the
internal micbias during headset type detection, otherwise the type
detection will be unreliable.
Change-Id: Id29bb61c581f8ecf845e84e4a3d2f3df53b1435b
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
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>
Enable internal micbias for IN1 to power up primary
mic.
CRs-Fixed: 656061
Change-Id: Id2a87bb0b1458a38d6acb2ff32a3207960d126f3
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
MSM8916 uses Mono Speaker and hence hardcoding of
channel needs to be fixed for Speaker path. A
hardware params fixup function is added for speaker
path to set the number of channels to one.
CRs-Fixed: 651438
Change-Id: Ie64c3b3919d0c12ba5d77b09a05bb0b3a6e262f8
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
While enabling the FLL clock for CPE, the test clock was accidently
enabled. Remove the enablement of test clock as this is not required and
used for test mode only. This will reduce leakage on the codec.
CRs-fixed: 658905
Change-Id: I3be31005bef1a9ab5babcc852c7fab9d9b639561
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Add support to set external EC reference. The external
reference are set to start along with multimedia
capture session.
Change-Id: I209b0dbb9c8f126f4c88cd53a77da719ad89f357
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Add route to connect ANC FB tune signal back to decimator
DEC7 to DEC10. These paths are used to evalute the device acoustics
and provide a way to tune ANC algorithm. In addition, a logic is
implemented to cache the TX HPF bypass control to allow user
bypass the TX HPF during ANC tuning.
Change-Id: I9aacd9d8717bfadbf4de750d7dfccd1f38da4bc8
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
Add route to connect ANC FB tune signal back to decimator
DEC7 to DEC10. These paths are used to evalute the device acoustics
and provide a way to tune ANC algorithm. In addition, a logic is
implemented to cache the TX HPF bypass control to allow user
bypass the TX HPF during ANC tuning.
Change-Id: Id6b8a046480fcfb5a4d0fb1876f7c364796d4378
Signed-off-by: Jay Wang <jaywang@codeaurora.org>
It is possible that codec private data will
be accessed without creating memory when
sound card is not registered. Avoid kernel
crash by checking it for NULL and return without
access.
CRs-Fixed: 657811
Change-Id: I4d8636252d2b75aa964eaf0c1b3d44e3f0976771
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Make logs more meaningful by logging values where ever
applicable.
Change-Id: I0fd0e62e543480762096d64c7ee7c92eb1204126
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Dirty widget list can be accessed by multiple paths
in dapm framework. Dirty list is protected by dapm mutex.
Since dapm_set_pin and dapm_force_enable_pin function
accesses the dirty list, protect it using the dapm mutex.
CRs-Fixed: 637323
Change-Id: I8c265072083e142c0858b6cc7a983d07e7d75af0
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
VIfeedback capture widget was added in the speaker RX path.When speaker
is enabled, the VI feedback capture widget would be turned on.
During the shutdown of speaker RX path VI feedback codec path is
shutdown first and then the AFE port is closed. This will cause the
underflow errors during the shutdown seqeunce.
Change removes the vifeedback capture widget from playback path and
creates a new capture path.Userspace module will enable/disbale the VI
feedback path via mixer control.
Change-Id: Id49f0cf2b1513b57014f1893d0facd72554166ed
CRs-fixed: 591723
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
In the case when headphone or headset is removed at the
other end of extension cable, unsupported jack event is
never cleared. Further headset/headphone insertion event
will always have the unsupported jack bit ON in the hph_status.
Change-Id: I5ea046b09cf8db4702c2e6d97fa1c8d23ba2702c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Auxpcm data can be placed in multiple slots in one frame.
The number of slots that can be in one frame is determined by
diving the number of bits per frame with bits per sample. For example
in 256 bit frame size configuration with 16 bits per sample
there will be 16 slots. ADSP currently supports receiving
information on four slots, however the driver only supports
one slot. This change adds support for multiple auxpcm slots.
Change-Id: Icfa3fd0cba5d2009be89d9230494d2a33a7b930c
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Update input and output DAPM widgets with ignore suspend flags
this prevents DAPM in disabling the widgets during suspend scenario.
CRs-Fixed: 651918
Change-Id: I237c68336d7973e13002048e9266d96ca3f8935a
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Remove the support for MSMSAMARIUM and MPQ8092 targets.
Change-Id: I63f81ba5fe8fe65ecfc8bf4114834715f7431295
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
If micbias is disabled after recording is stopped,
buttons won't work. Dont disable micbias, instead
keep it on till headset is inserted and disable
when headset is removed.
CRs-Fixed: 653668
Change-Id: Id601355921abf91d24d3890bf280a961bb4f3479
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
When headset is removed during playback, it takes
~3 secs for PA to be disabled. If again headset is
inserted within this time, it can cause wrong
detection issues, as we use HPHL/HPHR schmitt triggers
to check cross connection. Results of HPHL/HPHR
schmitt triggers are not reliable when PA's are on.
CRs-Fixed: 653658
Change-Id: Ifcad2109403324a084f925496baac67ffe40c342
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>
When a USB Headset is unplug from usb host port during audio is playing,
the system is very possible to clear the urb buffer before urb completion
handler is done. Then, clear_bit call in the completion handler will access
the freed pointer and caused the system crash. Check the dev state and skip
the clear_bit call when dev stat is USB_STATE_NOTATTACHED.
CRs-fixed: 647140
Change-Id: If51175196b598ec06b3ca0700eded18e42c363fd
Signed-off-by: Guang Jian Zeng <gzeng@codeaurora.org>
For the usecases where stream's post processing is needed in DSP,
the playback is offloaded at its native sample rate and channel
mode to DSP. Currently only one offload playback session is
supported. Add more offload or compressed front ends to support
multiple playback sessions in concurrent.
Change-Id: I29c0410a3fd61a439d2932b77349458212b5ab89
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
In the current implementation the gain is muted while enabling
the interpolator and unmuted while enabling the DAC/PA.
If the sidetone is enabled the mixer controls enable the
DAPM sequence from the Tx to the IIR Rx path. After this when
the Rx path is powered up, only the interpolator is started
and not the end point(since it is already powered up by the IIR path).
This leads to the mute in the whole playback path.
Since there are no pops observed by removing the mute while
enabling the interpolator, hence removing the mute.
CRs-Fixed: 643806
Change-Id: I9d130363bab155a6240bb051a54bf6a6866e16c1
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
The memory that is not unmapped from DSP should not be used until
DSP clears it. Do not free iom memory if the DSP unmap has
failed.
CRs-fixed: 599780
Change-Id: I4ceae34e0f8d6381efc34ce642babbc30ca5e57e
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
After the SSR, codec registers are to be restored
to the ASoC cached values so that the state of the
codec registers are in sync with DAPM. This would
make sure that the use case gets teardown properly
when userspace issues close command after the SSR.
CRs-Fixed: 651939
Change-Id: I4fbcc15c1a42493315327d03e9eb30f6f70a3ce0
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Tapan codec has two variants wcd9306 and wcd9302.
WCD9302 codec does not have compander block and hence
the DEM-2 mux input should always be selected to NZ_SHAPER.
Selecting the mux to CLASS_H_BUFFER would cause audio mute
if the CP clock is not enabled, which is the case when RX2
interpolator path is shared for HPHR and LO.
Change-Id: I7ea00a30d0554cc9e012fd0975c9a28e7cdf12f0
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add support for compat ioctl in rtac driver with
adding required structures and functions to support
compat mode.
Change-Id: I9b241856be096eeebf32ce40863bea5cf58a9b94
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
When SLIMBUS data channel is to be torn down, CODEC driver
waits for channel removal interrupt from SLIMBUS slave device
with 1 second timeout as measure to prevent system from lock
down in case channel removal interrupt never arrive due to
known reason. When ADSP SSR happen, SLIMBUS would be reset
hence data channel will be gone inherently. Waiting for 1
second will only prolong SSR recovery latency. Update to
avoid the delay after SSR.
Change-Id: Ic6a94ddd1150ba143f4dd33aac1785d7d2ee7653
CRs-fixed: 653504
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Soft-pause (i.e pause ack after a timeout) adversely affects
audio/video sync during pause/resume use cases leading to some
frame drops. Disable this feature for compress playback.
Change-Id: I3ce444dadf1e4b94c1e8d6f017a1c639b082285f
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
CRs-Fixed: 636328
Mute/unmute is not getting reflected in call that was
switched to ACTIVE from CALL_HOLD. lch_mode variable
is not reset after LCH_STOP is received is causing the
issue. Fix this issue by resetting the lch_mode when
LCH_STOP is received.
CRs-Fixed: 652400
Change-Id: Ide4a6a399accd84384199e723cdeabb722ab41e1
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
SECONDARY_I2S_RX as EC reference port is needed for msm8x10.
Add support to enable SEC_I2S_RX as EC reference port.
CRs-Fixed: 646310
Change-Id: Ie114dd29afc16ff324388743377fb5c755f4ad7b
Signed-off-by: Venkata Narendra Kumar Gutta <vgutta@codeaurora.org>
Asoc framework supports parallelization of operations
which reduces the startup latency. Machine driver will
specify which usecases support parallelization. This
change updates the machine driver to enable the parallelization.
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Change-Id: I5b26bfb6f8b7a3c128b4c853400b10e70ecccb25
Asoc framework supports parallelization of operations
which reduces the startup latency.
Moving hw_params into prepare further reduces this start
up latency.
Change-Id: If38df2ba22daa94afdff8a7cd90263f4a1fafae7
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
This patch parallelizes FE (front end) and BE (back end)
when playback/capture path is set up. FE's and BE's which can
be parallelized should be indicated in corresponding machine file.
All the operations can be started asynchronously provided the usecase
supports asynchronous operation.
Parallelizing reduces the startup latency as both FE and BE opeations
run in parallel.
Change-Id: I9eeaf500b6d90d4def0adc1bdd6c219e49f676c7
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Add the dai link to support listen using CPE hardware bloack on the
codec.
Change-Id: Ib5d1c4ccbe5d7c1b8016ed197115b8f78ba3fd43
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
LSM (Listen Service Manager) driver enable the listen feature. Add lsm
driver to enable lsm feature using the CPE (codec processing engine)
hardware block on the codec.
Change-Id: Ic54ecfec02c02f8294594679bcb462eaf76b3bcd
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Input parameters are wrongly used. Fixed tx channel parameters
for the proper usage.
Change-Id: I68ca13efd581bacf9199fa24e3a2e8e0de6ae4f6
Signed-off-by: Fred Oh <fred@codeaurora.org>
For 32bit I2S mode use Q6AFE_LPASS_IBIT_CLK_3_P072_MHZ and use exisitng
Q6AFE_LPASS_IBIT_CLK_1_P536_MHZ for 16bit I2S.
Change-Id: I329f3b6f26d9e78ae78851bea765009d74deb4df
CRs-Fixed: 652063
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
1) For targets where micbias is shared, we do not
use vddio to identify special headset. We want
micbias to be enabled always with any headset
inserted for such targets. Currently, if headset is
inserted during recording, we check for this vddio
flag as well. Since, it is null for the above mentioned
targets, we never touch the code to enable micbias
always for any type of headset.
2) Again for the above mentioned targets, if micbias
is enabled by voice call, and we insert the headset.
Now if headset is removed, we try force diable of
micbias. This results in Tx mute. The count to disable
micbias needs to be corrected.
Change-Id: I022a54578c47485ebf7eef27c405e31ea6395ecf
Signed-off-by: Simmi Pateriya <simmip@codeaurora.org>