Commit Graph

1129 Commits

Author SHA1 Message Date
Hariharan Sivaraman
540f5ece2c tegra-adsp-alt: increase num of plugins
Increase number of supported plugins by ADSP
from 10 to 20

Bug 2048629

Change-Id: I44410252635fafb4b4d484ce75e642286e954ab2
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1664190
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
a6c5cba8dd tegra-alt: apm stack size from dt
Change add support to pass apm thread
stack size from device tree using property
"apmX-stack-size = <N>"

Bug 200389033

Change-Id: Id09703bfc5a3edfa55ec9c389d62660fdf8b6b62
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1662846
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
3b6209c985 ASoC: tegra-alt: Fix support for I2S DSP-B mode
The Tegra sound machine driver only set the TDM slots for DSP-A mode.
The TDM slots also need to be set for DSP-B mode so update the
machine driver to set the slots for DSP-B mode as well.

The 'tx_mask' and 'rx_mask' for for TDM modes is the same and will
always be the same. So simplify the code by having a single mask
variable.

Finally, remove unnecessary initialisation of 'err'.

Bug 2025176

Change-Id: I98630772432c2083bf4b4cf37bdfaf2f4c4514e5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1656600
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
2cae54a567 ASoC: tegra-alt: Add support for overriding the bclk ratio
To test internal loopback on any I2S interface using various different
sampling frequencies, it is necessary to be able to override the bit
clock ratio. However, rather than adding a kcontrol for each audio
link supported by the machine driver, add a global kcontrol that when
set will control the bit clock ratio for all I2S links.

Bug 2025176

Change-Id: I46ec949d36f0fe34967b9ed718d2189b539a1a37
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1602528
(cherry picked from commit 08afde21c1041db7d926b094cc9822402b73524f)
Reviewed-on: https://git-master.nvidia.com/r/1655983
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
6191131ae7 ASoC: tegra-alt: Fix return type for getting the bclk ratio
The functions tegra_machine_get_bclk_ratio() and
tegra_machine_get_bclk_ratio_t18x() have a return type of unsigned int
but can return a negative error code on failure. This may cause users
of this function to get a very large bit clock ratio. Although it is
improbable that the bit clock ratio will ever be large enough to
overflow a signed integer, it is best to avoid changing the type of
the bit clock ratio variable. Therefore, return the bit clock ratio
via a pointer passed to the functions tegra_machine_get_bclk_ratio()
and tegra_machine_get_bclk_ratio_t18x().

Bug 2025176

Change-Id: Ia6e9a1ef68f53ebb594746f812de65a18269925f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1655982
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
baa66924d1 ASoC: tegra-alt: Return error if tegra_machine_set_params() fails
If setting the bit-clock ratio or number of TDM slots fails, then
return the error and fail.

Bug 2025176

Change-Id: I3301c5182db0f6f8aab0cf16798211b938df1750
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1655981
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
f99b7b3ed9 ASoC: tegra-alt: update mic only jack state
h2w switch state is updated for mic only jack detection. This is needed
for intel HDA header support, where only mic jack insertion is possible
and corresponding change is needed in WiredAccessoryManager.java for
android to switch routing to jack capture.

Following are the h2w switch state values,
0 - nothing connected
1 - both mic and hp jacks connected
2 - hp jack connected
3 - mic jack connected

Changed enum names for clarity.
Note: WiredAccessoryManager.java on Android uses these switch values for
identifying the jack type and hence these values should not be altered
independently.

Bug 200360770

Change-Id: I326b2704bdf68698ebad67ebab77ab07de743214
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1642236
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
8f1ef0a6d9 ASoC: tegra-alt: Add kcontrol for I2S fsync width
For testing different I2S framing mode (such as i2s, dsp-a, etc) in
an automated environment, it is essential that the frame-sync width
can be set via userspace. Add a kcontrol for setting the frame-sync
width from userspace.

Bug 2046053
Bug 1993721
Bug 200356303

Change-Id: Ifc47496df5497823c2a36b2ead9eb54104dea9a0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1602529
(cherry picked from commit ddad4df767864d1ac650b6a4bc5a4a198e45158a)
Reviewed-on: https://git-master.nvidia.com/r/1660814
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
9189bb6b72 ASoC: Machine: ignore suspend for dai-links
This patch is being added for Android to avoid high suspend latency
resulting from commit bedf87fbcd537a5cc7b5d972c34a92cce9414f93. For
android, system cannot go to suspend when audio playback is running.
Thus issue mentioned in above commit is not applicable to Android.
CONFIG_ANDROID is used to selectively ignore suspend.

Bug 2061442

Change-Id: Id536920cb857e6d7a614d2a742012e17eac5f14f
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1659720
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
f3b86672a3 ASoC: tegra-alt: Unify based on codec link
Unify the Machine driver based on codec link name, which can
be used for multiple platform with minimal changes.

Also add machine driver support for Mystique platform.

Bug 200383641

Change-Id: I4e61c017b312cd3f6568f9fed888bec48a68c1f1
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1653330
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Tested-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
efb17516ee ASoC: tegra-alt: Improve support for I2S RJM
For I2S right-justified mode, the Tegra210 I2S driver assumes that
the bclk rate is 64*fs and the data is always 16-bit and therefore
sets the data offset to 16. However, the Tegra TRM states ...

 "In RJ mode, data starts (r/2 – n) SCLKs after the LRCK edge
  (offset = r/2 – n, where r = number of SCLKs per LRCK,
  n = number of bits/sample)."

Therefore, the Tegra I2S driver should set the data position
depending on the bit-clock ratio setting and the data format
(16-bit or 32-bit) that is used.

Bug 2027259

Change-Id: Ic87b33aa19f956f4ac35c1444e4cd4148fe0ba4d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1649565
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
a9ff9a46fd ASoC: tegra-alt: remove mystique specific config
Remove mystiue specific platform config and also the codec
config which has to be defined "Y" using menuconfig.

Bug 200373632

Change-Id: I81ae20cf339376d662c50528c912ebe4ccc85b5f
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1654000
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Hariharan Sivaraman
05577afab1 tegra-alt: incr ADSP params limit
For plugins which send integer type data, increasing
limit to 0xFFFFFFFF allows for negative values to
be sent to ADSP where plugin code can typecast uint to
int and obtain desired negative value

Bug 1990609
Bug 200381729

Change-Id: I2afecc934e10d4f82badab739e26f7adae1d4cca
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1641078
(cherry picked from commit 315bae2da963f24785acb24705ae9273bdb0f436)
Reviewed-on: https://git-master.nvidia.com/r/1645013
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
2f3fa3e1d2 ASoc: tegra_alt: add config support for mystique
Add the required config support for mystique platform.

Bug 200373632

Change-Id: Id42b30ab00e131964578cb426b4f185296e2ebe6
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1651884
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
6f7ab4de14 ASoC: tegra-alt: Fix audio capture/playback across suspend
If audio capture/playback is active when the device enters system
suspend then the sound core does not correctly suspend capture/playback
and so when the system is resumed, audio capture/playback does not
continue. The problem is that the various DAI links have the property
'ignore_suspend' set and this causes the sound core to skip suspending
any active PCM streams and hence, the DMA controller is not
stopped/paused as it should be on entering suspend or started/resumed
as it should be on exiting suspend. Fix this by removing the
'ignore_suspend' properties for the various DAI links.

Bug 200363507

Change-Id: I80cd74e3bc86532c8920bd25326a31aec7396560
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636471
Reviewed-on: https://git-master.nvidia.com/r/1636473
(cherry picked from commits 22a85acf56e34c369abed6f274a566594def78df
 and 4de9dbcf256cad12387fb5307a855632543d3f66)
Reviewed-on: https://git-master.nvidia.com/r/1648638
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Asha Talambedu
ce578ecac2 tegra-alt: Enable ahubram prog. in hw_params
ahub ram programmed during coedc init is getting
reset. Therefore, need to reinitialise in hw_params

Bug 200375657

Change-Id: Ie59eb09ccc325d50a90b8f9e0c38ba7e14de472f
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
(cherry picked from commit 043e22ae245946f5391c5ddf4a475be45698cbe8)
Reviewed-on: https://git-master.nvidia.com/r/1640135
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
6d41c35779 ASoC: Machine: check jack status during resume
codec suspend/resume does not happen when using intel HD header. To allow MIC
jack detection to work always, some supply widgets are kept On during probe.
This does not allow codec to perform suspend/resume cycle when system goes to
low power mode. So any jack plug/unplug during SC7 will not be detected, as
IRQs are disabled during this period.

Though codec resume path checks for the jack state, but the resume call does
not happen because of above mentioned reason. Hence in current patch, machine
driver can check the jack state during it resume callback.

Bug 200383009

Change-Id: I78dc982df1da633d8eec1cd48a1c9a00ab06bbff
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1649452
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Dara Ramesh
291dad8c87 asoc: tegra: fix sound card failure
- exclude ARAD DAI link from ADSP config
  variable dependency, this will fix sound
  card failure when compiling without
  ADSP.

Change-Id: I3b13a185f538d3e735d5513742d527aaf77eefd0
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1648653
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
082f972183 ASoC: tegra-alt: move dap state logs to debug
DT defines dap active and in-active states. The dap states were
added to dynamically program the pinmux registeres. If these
properites are missed in DT driver module can report warnings.
Reduced the log level to debug as these properties are not always
mandatory.

Bug 200376047

Change-Id: I48d7ab07e25af4ce8f12c8788582f9633d2d0671
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1643337
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
059e505ef0 ASoC: tegra-alt: Fix SW reset for Tegra210 ADMAIF9/10
When using ADMAIF9/10 channels for audio playback/capture on Tegra210,
the soft-reset of the ADMAIF is failing when playback finishes ...

Playing WAVE 'rec.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
[  260.094969] tegra210-ape-admaif tegra210-admaif: Failed at ADMAIF0_TX sw reset

There are a couple issues here ...
1. The ADMAIF that fails is reported as 'ADMAIF0' although in the above
   test ADMAIF9 is being used. This is purely an error in the driver
   which is using 'dev-id' as the ADMAIF ID instead of 'dai->id'. Hence
   the above error message is misleading.
2. The soft reset fails because the regmap configuration for the ADMAIF
   registers on T210 is incorrect. In the function,
   tegra210_admaif_volatile_reg(), only the ADMAIF registers between
   offset 0x000 and 0x500 are considered volatile. The problem is that
   the ADMAIF channel registers for T210 actually span 0x000-0x280 (for
   RX) and 0x300-0x580 (for TX). This means that for TX, the ADMAIF9/10
   channel registers are not considered volatile and hence, polling the
   soft reset register is failing.

Fix the above two issues by correcting the ADMAIF ID reported for any
soft reset failures, and correct the address range for ADMAIF volatile
registers.

Bug 2037162

Change-Id: If22eba754ab4bf2bf5acc3c9da51388b7208c749
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1620448
(cherry picked from commit 1cd55ec115b7235343f09ec524a2c4cb2253ef33)
Reviewed-on: https://git-master.nvidia.com/r/1642335
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
289a7e20b5 ASoC: tegra-alt: Fix crash when 'rt565x-playback' link is not defined
If the 'rt565x-playback' link is not defined in device-tree for the
Tegra210 rt565x machine driver then the following crash is seen ...

 Unable to handle kernel NULL pointer dereference at virtual address 00000068
 pgd = ffffffc00163e000
 [00000068] *pgd=000000017b1d8003, *pud=000000017b1d8003, *pmd=000000017b1d9003, *pte=00e8000050041707
 Internal error: Oops: 96000005 [#1] PREEMPT SMP
 Modules linked in:
 CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.4.38-tegra #222
 Hardware name: jetson_tx1 (DT)
 task: ffffffc0fb2f0000 ti: ffffffc0fb2a4000 task.ti: ffffffc0fb2a4000
 PC is at rt5659_set_jack_detect+0x8/0x2c
 LR is at tegra_t210ref_driver_probe+0x248/0x284
 pc : [<ffffffc0009b3864>] lr : [<ffffffc0009c5a60>] pstate: 60000045
 sp : ffffffc0fb2a7bf0
 x29: ffffffc0fb2a7bf0 x28: 0000000000000000 
 x27: 0000000000000000 x26: 0000000000000000 
 x25: 0000000000000000 x24: 0000000000000000 
 x23: 0000000000000000 x22: 0000000000000000 
 x21: ffffffc0fa282010 x20: ffffffc07d136c18 
 x19: ffffffc07d136c20 x18: 0000000000000000 
 x17: 0000000000000000 x16: 0000000000000000 
 x15: 0000000000000008 x14: 66656420746f6e20 
 x13: 6b6e696c20636564 x12: 6f63203a646e756f 
 x11: 7320783536357472 x10: 2d656c69626f6d2d 
 x9 : 666572303132742d x8 : ffffffc00030e7c8 
 x7 : 0000000000000000 x6 : 000000000000006c 
 x5 : 0000000000000000 x4 : ffffffc0fb2a78e0 
 x3 : 0000000000000000 x2 : 0000000000000c16 
 x1 : ffffffc001622228 x0 : 0000000000000000 
 
 Process swapper/0 (pid: 1, stack limit = 0xffffffc0fb2a4020)
 Call trace:
 [<ffffffc0009b3864>] rt5659_set_jack_detect+0x8/0x2c
 [<ffffffc0009c5a60>] tegra_t210ref_driver_probe+0x248/0x284
 [<ffffffc0006323c4>] platform_drv_probe+0x4c/0xb4
 [<ffffffc00062fd44>] really_probe+0x138/0x2f0
 [<ffffffc00062fff0>] driver_probe_device+0x8c/0xcc
 [<ffffffc000630090>] __driver_attach+0x60/0x8c
 [<ffffffc00062de50>] bus_for_each_dev+0x54/0x94
 [<ffffffc00062f938>] driver_attach+0x20/0x28
 [<ffffffc00062f280>] bus_add_driver+0x144/0x230
 [<ffffffc000630fd4>] driver_register+0x90/0xd8
 [<ffffffc000632324>] __platform_driver_register+0x54/0x5c
 [<ffffffc001296918>] tegra_t210ref_driver_init+0x18/0x20
 [<ffffffc0000810d8>] do_one_initcall+0x4c/0xf0
 [<ffffffc001245b64>] do_initcall_level+0xa0/0xc0
 [<ffffffc001245b9c>] do_initcalls+0x18/0x30
 [<ffffffc001245bd8>] do_basic_setup+0x24/0x30
 [<ffffffc001245d10>] kernel_init_freeable+0x118/0x1ac
 [<ffffffc000bc1ba8>] kernel_init+0xc/0xe8
 [<ffffffc000084790>] ret_from_fork+0x10/0x40
 ---[ end trace 783136a9ec7cad16 ]---

This crash is caused because when the 'rt565x-playback' link is not
defined we will still call rt5659_set_jack_detect() but pass a NULL
pointer for the codec handle. Fix this by ensuring we only call
rt5659_set_jack_detect() when the 'rt565x-playback' link is present.

Bug 2045523

Change-Id: Ib8945fee1abe1745c1b087605bf876341b3ad367
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1636472
(cherry picked from commit 9bcd460c93a25ecb4b108fc862a7ff93bcc57128)
Reviewed-on: https://git-master.nvidia.com/r/1642331
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
3f16a01e6b ASoC: tegra-alt: Fix error path for rt565x machine driver
The error path of the Tegra210 rt565x machine driver does not
unregister the headset switch on failure.

Failure to unregister the headset switch on failure prevents causes
subsequent calls to register a switch to fail because one is already
registered. Hence, if the probe of the rt565x machine driver is
deferred, for example because the codec is not register yet, this
will cause subsequent probe attempts to fail because a switch is
already registered.

Fix the above issues by unregistering the switch in the error path
of the Tegra210 rt565x machine driver probe. Finally ensure the
switch is unregistered in the removal of the rt565x machine driver.

Bug 2044665

Change-Id: Iaeb6f7ae30b6fdff46b0a8679003674804399a99
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1634166
(cherry picked from commit 1a9cea0e8e97c5b042088d5988184c81db85ea6a)
Reviewed-on: https://git-master.nvidia.com/r/1642330
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mika Andersson
112cb48c94 nvidia: sound: platform layer for boden
Bug 2045597

(cherry picked from commit 2934c01e8566670b8d49fe0dc8b26e42efdee097)
Change-Id: I20e3ce07e29479bc515b43d59f1e3f5c33d41b0b
Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1581893
Reviewed-by: Dmitry Pervushin <dpervushin@nvidia.com>
Reviewed-by: Baalaaji KR <bkr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1635749
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mika Andersson <mikaa@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
6caaf51df1 ASoC: tegra-alt: change log level
DAP's which shared pins with other peripherals need
to have entry in dt for dynamic pinmux configuration.
All DAP's are not required to be configured dynamically.
Thus pinctrl for all dap's are not needed to be defined
in device-tree. For these cases state not defined should
not be treated as warning. Thus updating log level to dbg.

Bug 200377288

Change-Id: I8c222577d4bcdcfb7fde49a6c264c157baae28d1
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1633690
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
168d0bf316 ASoC: tegra-alt: set cya bit for amx auto disable
Set cya bit for amx auto disable feature to work.

Bug 200375235

Change-Id: I174453f97e9fd173bf1cb8d5e65d29766618ec6c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1625291
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
2e561466a6 tegra-alt: amx: fix sound card reg failure
For t19x nvidia,tegra194-amx compatibility is used and the device name
is not properly populated and this results in sound card registration
failures. This change uses DRV_NAME and id, to populate the name. Same
approach can be extended later to other drivers as well.

Bug 200373426

Change-Id: I5c98c61be1044a6253b2b8e06b3f902ddbb4fe3a
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1619875
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Tested-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
4c26e42c42 ASoC: tegra-alt: control for dspk osr value
Add support for mixer controls for dspk osr value.

Bug 200369647

Change-Id: I551898357d2545c7e1b41e57593820c6126fb16e
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1609919
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
5a7c6d070c ASoC: tegra-alt: add arad dai link
This adds arad as part of xbar dai link, which acts as dummy link.
This is required for dapm path completion and cif configuration.
Since there will be conflicts, similar arad link code is removed
from auto machine drivers.

Bug 200364103

Change-Id: I55245c3d6f9efac0d3ea8ef9d485080e106adbac
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1609942
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
7f64062c25 ASoC: tegra-alt: control for dmic osr value
Add support for mixer controls for dmic osr value.

Bug 200369647

Change-Id: I06e180dae328fd7d7e7e0a27cad2b31e5747cd2f
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1608824
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
34493872d9 ASoC: tegra-alt: Add DAPM Headphone and Mic widgets for I2S3
Tegra I2S3 interface on Jetson TX1 is not working because it is
missing the appropriate DAPM widgets to enable it. Add the
appropriate DAPM widgets for I2S3 (which is using prefix 'l' as
defined by device-tree).

Bug 2021397

Change-Id: I91e8bd13a247eaad4ce2bb1a9cd25d82b000a6c5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1596130
(cherry picked from commit 53647e30e43b72c0246d1ee542831092207258b8)
Reviewed-on: https://git-master.nvidia.com/r/1601697
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
d54626ee0e ASoC: tegra-alt: Add support for I2S5
I2S5 is not enable for Jetson-TX1 although the interface is available
on 30-pin header J26. Enable suppot for this interface so that it can
be tested.

Bug 2020869

Change-Id: I87fe177d2139fe94098cb02fadb490e2080dbb6c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1597135
(cherry picked from commit 8d5dc2df30835ecd3efec606c5f3e2d8ecec3d1a)
Reviewed-on: https://git-master.nvidia.com/r/1601696
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
b9596edbb5 ASoC: tegra-alt: fix aud mclk reset
aud mclk reset is available only for t186, so move all the code
related to aud mclk reset under t186 chip check.

Bug 200365570

Change-Id: I2a7ff5eff583b138dca507336408779f5228a2d8
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1600769
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Hariharan Sivaraman
fbeffb7043 tegra-alt: ADSP IO to IO support for virt configs
Add handling for IO to IO use cases in ADSP for
virtualized configurations

Jira EMA-497
Bug 1990609

Change-Id: Ied779014ca2c484d6741329d94500c0e51e10b80
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1589042
(cherry picked from commit ea529d5d074c8ccb577341b5a1d834db2253ded2)
Reviewed-on: https://git-master.nvidia.com/r/1562134
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Stephen Warren
e8d6a15183 nvidia: use $(srctree.$(overlay))
Update all Makefiles to make use of the new srctree.$(overlay) variables
to remove hard-coding the path to any overlays. One direct reference
remains in a hard-coded include statement in drivers/misc/tegra-cec/.

Bug 1978395

Change-Id: I5cdce04e019567a9bbfffaf0e92a61bd16806e99
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593800
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
e9c51282bb ASoC: tegra-alt: Discontinue APE SPDIF support
As there are no real usecase for SPDIF currently and lack of
clock support for SPDIF, discontinuing the spdif support.

Bug 200355251

Change-Id: I9734915715ec21aabbf999c08cea588cf2fcb08f
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1584289
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Puneet Saxena
fae9c0a600 sound: tegra: utils: replace dma_alloc_writecombine with coherent
dma_alloc_writecombine forces non-cached memory irrespective
HW module IO coherency.
Use dma_alloc_coherent API, which selects the right memory
type depending on HW module.

Bug 2003170

Change-Id: I686713291c1469e67f7430550ad20c01028bf636
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1589979
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
aa5200c4d8 ASoC: tegra-alt: remove LKM hack
Both t210 and t186 lkm_loader.sh script uses common xbar driver now.
Hence the temporary fix can be removed now.

Bug 200346429

Change-Id: I466ad9ed11b1418262a291aa6a414fa06b9014a2
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585452
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Stephen Warren
dbd5c4a30c nvidia: use kernel overlay features
Update all Kconfig files and Makefiles to rely on the kernel overlay
feature. In particular, don't include any Kconfig files or Makefiles
from other overlays. -I directives in CFLAGS are not yet cleaned up.

Bug 1978395

Change-Id: I425d37d55f8ea61fb3a082a1504f994ff30cec03
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1561187
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
d8cccfd903 ASoC: tegra-alt: remove devm_clk_put() APIs
Clock resource is associated with a device and when the device
is unbound, the resource is freed. Drivers get the clock handle
by using devm_clk_get(). No need for an explicit devm_clk_put()
to release the clock, this is handled automatically when the
device lifetime ends.

Bug 200346429

Change-Id: I0885723e3a9a3fb41e54524ddacc3415f571576c
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574311
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
93e212df79 ASoC: tegra-alt: add amx auto disable support
Change adds support for auto enable/disable feature
in amx for t19x onward soc family.

Jira EMA-876

Change-Id: I8b9a63e6d186984632da6114c29e5fb8a0537b61
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1573651
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
681288f1be ASoC: tegra-alt: restructure drivers
Because of the way in which Makefile is defined for the drivers,
each driver file is getting compliled as separate *.ko module.
This results in loading of all the *.ko modules for maintaining
the functionality.

Current patch re-organises makefile and thus terga-alt structure,
 - utils/ : will provide all the helper functions,
 - machine_drivers/ : lists all the machine specific drivers we have,
 - tegra-alt/*.c : ahub module drivers, each would have a separate
   driver module,
 - include/ : all the local header files needed for driver modules

Bug 200346429

Change-Id: Ic659879a0d6e8ef48b0d79b81059fba4c069591e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1559745
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
0493b53a47 ASoC: tegra-alt: remove kernel version check
Version check is not required since 'struct component_driver' is
available on both kernel-4.4 and kernel-4.9. These checks are
earlier removed from t21x based module drivers. The same is done
now for t18x specific drivers.

Bug 200346429

Change-Id: Ie59600ed8fe4b6878ece58a055da522ce308300d
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1573625
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
90ef4d49b0 sound: soc: tegra: Fix Tegra210 I2S Fsync Polarity
The 'normal' polarity of the fsync is dependent on the audio format.
For example, for I2S the 'normal' polarity for the fsync is
falling-edge/low, where as for r/l-justified or dsp modes A/B it is
rising-edge/high. This is detailed in the Tegra210 TRM in the table
titled "Programming I2S to Operate in Various Modes" and also in
the Linux kernel header file for include/sound/soc-dai.h.

The Tegra210 i2s driver always assumes that the fsync is low for
'normal' polarity and high for 'inverted' polarity and does not
account for the audio format. Correct the Tegra210 I2S driver to
set the polarity according the the audio format.

Bug 1788838
Bug 1993738

Change-Id: I5c7395f225ff8c25e2bb277c35e3ecb7a86f36cb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1567742
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Sameer Pujar
52b1047acc ASoC: tegra-alt: avoid address hardcoding
xbar codec is registered as per the physical address and the same
is used while defining the dai links. This results in unnecessary
duplication of the code and this is not scalable for upcoming
platforms too. This patch removes such hardcodings for xbar and
adsp audio driver by using dev_set_name() api.

Bug 200346429

Change-Id: I16147b94cc1686ceb8b084ead91d2d35b1f0fbbd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1568711
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
c56084f924 ASoC: tegra-alt: merge xbar driver code
xbar driver code is maintained separately for t210 and t186.
There are separate driver modules loaded for t210 and t186
platforms. The difference between two drivers is mostly some
soc specific data and structures. This patch merges both the
drivers. Going forward there will be one xbar module, but at
the moment duplicate copy of xbar driver with t186 name is
kept to maintain audio sanity.

Bug 200346429

Change-Id: Ic10ac7f2aca9a0da5caa0683bb7bdb51f14117a8
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1567256
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
fd1f50ee48 ASoC: tegra-alt: Avoid reg access after shutdown
Below are the hypothetical scenarios
- Drivers are in suspend state while reboot and PCM Open call from
  userspace is received after driver shutdown [APE is power gated
  already]
- PM domain handling doesn't ensure proper functionality after driver
  shutdown is called

The change handles with the below fix
- Will prevent any reg access in runtime resume of drivers and avoid
  opening pcm devices.

Bug 200333417

Change-Id: Ieba2a063342cd1e7becb79a0135cb2b8ec373a61
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1539396
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
a22ea5aac7 ASoC: allow switch to set source before playback
For switch currently we rely on setting switch source
after playback has started in null-sink mode. However
this will leads to missing few frames of intial data.
Thus change adds support to allow setting source to
switch before playback is started.

Jira EMA-528

Change-Id: I2301da6d8b256bb188a8c442058bd87cac5a48ca
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1517265
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
(cherry picked from commit 313c392daeeb84a12a01b1befc47ab1826c2126e)
Reviewed-on: https://git-master.nvidia.com/r/1533084
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
d772f9ce82 ASoC: tegra-alt: override adsp fe-name
Change provide options to update fe-names.
This can be controlled via dt property
fe-info.

Jira EMA-421

Change-Id: Ie8c18e20f07d8a910e93f52720289a3ea70ee347
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514371
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
(cherry picked from commit ef7904abf93b0451761c304d19f2e6281672e2ab)
Reviewed-on: https://git-master.nvidia.com/r/1533083
GVS: Gerrit_Virtual_Submit
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
b271d423d8 ASoC:tegra-alt: fix const char* crash
Observing runtime crash in adsp-alt probe
as we are trying to update const char* strings
to update plugin names. Change assign new
memory for all such plugin name updation
and update the respective pointer.

Jira EMA-421

Change-Id: Idc9861b6d00c6b3bb7241edc93dfdcda48b12589
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master/r/1513420
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
(cherry picked from commit 216675854724320b66215395b1867fe825551f3a)
Reviewed-on: https://git-master.nvidia.com/r/1533082
GVS: Gerrit_Virtual_Submit
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
078c0fef6f ASoC: tegra-alt: move codec driver members to component
Some members from struct snd_soc_codec_driver is moved to
struct snd_soc_component_driver

Bug 1856400

Change-Id: Icc0f83f7ed4ee8137c1b6e949cf9a6e8172d6ed2
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1452899
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
(cherry picked from commit 4e3aa2fe1524b3bf1b433869d67b28762b01bbd1)
Reviewed-on: https://git-master.nvidia.com/r/1533080
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30