Add range check for ucontrol value to avoid array
overflow.
Change-Id: I7b699519bec6f605e5ca5ece8f67badbefc7a094
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Update swr_tx slave port config to use slave provided port params
and remove slave port static tables.
Change-Id: Icfedf1229a88432e80c2294e13f2ccc3949417c5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
VA AMIC requires micbias to be enabled in pullup
mode. Pullup mode for micbias is required for SVA usecase.
Change-Id: Ied71147bc813cee2ad95b0c8b342788b9c0ba10b
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
hw_refine failing for clips of sample rate
384000 as codec is configured to support 192000
sample rate as max. Due to this playback is not
happpening over headphones.
Change the max to 384000.
Change-Id: I2f9cad3bc708f3e4cc8cd38eb2ef2a98ec640f57
Trigger SSR during headset recording may cause recording
mute after SSR. Before dev_up is set to true, micbias
enablement for headset detection will return error and micbias
enabled for recording return true. After headset is done,
micbias is disabled. Move 500ms after dev_up to the end to
resolve this issue.
Change-Id: I7b9e094321997d64c96cf0e86a4f447d97b5fdb6
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Add null check for wcd938x component and wcd938x_priv
before use.
Add array bounds check for slave channel index before
accessing the array.
Change-Id: Ida6b2044f5f9b9a65f4b45d868040af8bd2116eb
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Update the bit 0x08 of WCD938X_DIGITAL_CDC_ANA_CLK_CTL
to 0 during DAPM post PMD.
Change-Id: Iea7d3878e9c56f8e219240007b8dbe30683d3161
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
Add enum names defined for callback between wcd and bolero in
separate file and include that file in order to have same enum
across wcd and bolero.
Change-Id: I808c2ad3de37655c1ba2b8e096def60703ced7f2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Update the soundwire clock rate based on the number of TX paths enable
to avoid noise issue.
Change-Id: I8c73bfd73751d4b79de30f3347081929501a877e
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update SWR clock rate based on active ADC modes
for concurrency during powerup and teardown.
Change-Id: I610aa205a857a5fac2163a248de4800f3c8042f7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
swr_slvdev_datapath_control should be called after
wcd938x_tx_connect_port to cleanup disconnected ports.
Change-Id: I53e6e9140ed0be5a0a0704358e3e7f600ab62863
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Add notification from wcd938x to sound wire dmics
during SSR. Remove device down from dev ops to avoid
deadlock scenarios.
Change-Id: Ifdcbebb748c10deb89ad51ada1a8ce1cf33f2462
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Enable ADC Mode and tx channel cfg as part of enable_adc.
This should be enabled before enabling bolero dec so as
to reduce glitch or saturation for headset.
Change-Id: I94045d0c3b7b96744afb9e6a9a3eecf0abc5a55f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
During SSR, when usbc analog device is disconnected, the
respective disconnect interrupt is not handled and hence userspace
is not notified. When ADSP recovers, fsa driver sends a disconnect
notification. So handle device disconnect and notify jack/userspace
through this notification.
Change-Id: Ic695c2267c9289f9528d50202938ec09f634de8a
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Retry for soundwire slave enumeration during bootup before
EPROBE_DEFER to avoid soundcard enumeration failures.
Change-Id: I083ec76fc84a2b367f93a2dc166a1419a75ff8b4
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
With multicodec approach, codec widgets are added much earlier during sound
card registration than aux codec approach. The connections between bolero and wcd938x
are done via device tree at a later point. DAPM does power checkup for codec widgets
before the codec-codec path is connected. This results in wcd938x dapm inputs/output
to be considered as endpoints, which results in playback/record failure once after
bootup. Hence, add dummy output/input widgets to wcd938x dapm inputs/output which are not
codec endpoints.
Change-Id: I5ab4839e9b76adba24c9254ae56dc784b4448af7
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
To set correct swr clk rate in concurrency,
use WCD ADC modes as status mask bit to confirm
ADC paths active and control set clock rate.
Change-Id: Id3401d6ed59bd617e0751e7c704268346b36dac4
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Add dapm ignore suspend for playback and capture DAIs to
avoid wakeup during power collapse.
Change-Id: If023597542423253a565dcf0f13ee9f08b357b93
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
For power saving during RBSC, need to vote for minimum
or zero current on load for respective regulator to
enter LPM mode. Add required support from audio WCD/WSA
to vote accordingly during suspend/resume.
Change-Id: I578195b84ba18a0b69dde3b93a3f6461efa85f7f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
On lagoon, vdd-buck need to be dynamic supply.
Add required support to handle buck as dynamic supply.
Change-Id: If6c27fffe0d0c44f178e61a6eae6ef63775c8988
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Add delay in post ssr to eliminate playback pause on euro headset.On
post ssr hs detected as hp due to where pa become on before the completion
of wcd_correct_swch_plug workqueue which lead to detect plug_type
as hp.
Change-Id: Ie114fcd0458d9f5edebeee087c90600c3b0c3da2
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
Set correct tx frame config for soundwire port
using wcd9375.
Change-Id: Icbefda65713338908e4d94935296ff30ac4e5f9c
Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
Hold_off bit for enabling watchdog will enable mute until
there is a block reset and watchdog bits aren't toggled.
Disable hold_off bit so that wcd is recovered from mute
instantly once watchdog occurred.
Change-Id: Ia87593ead05dde4e31a0afefd6ffaca89bb95448
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
SND_SOC_DAPM_MIXER_E widget is powered up before SND_SOC_DAPM_ADC_E
which causes mute on wcd mic recording. Adjust wcd938x_tx_connect_port
and swr_slvdev_datapath_control sequence to fix it.
Change-Id: I3dbfb239dcfbd65102d0d98be40326be71cf8479
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Mute is observed in amic record sometimes in concurrency with
sva. This is because if record is over tx0 then digital clk
is not enabled. Enable clk after enabling micbias to resolve mute.
Change-Id: Iba3aa4fade0ac5889218eaee2c5d2c4bd4431d50
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Enable compander based on mixer ctl set for ear path.
Change-Id: Ie6287469f1baa9dba239d369bd5a29ed8e44522f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Headset is corrected as lineout during SSR/PDR. This is
because adc voltage is not measured correctly due to SSR state.
Enable flag deinit_in_progress during SSR down to check if
device is not reported and disable it after device up.
Change-Id: I6fc4fff4149c36ba16aa668a960505504a5d811f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Ear Path is not disabled properly disabled at power down.
Disable clk and other registers depending on whether ear
takes aux or hph path at pwd.
Change-Id: I987904ddd9bf21b9ed96e754e6eb2514b4d277ce
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>