Commit Graph

2890 Commits

Author SHA1 Message Date
Dipesh Gandhi
2b8e5b84b9 ASoC: tegra-alt: i2s: Move sw-reset to PRE_PMU
Moving sw-reset at PRE_PMU stage where we
reset i2s controller it start of playback/
capture to clean up fifo's in case last run
was not good.

Bug 1736992
Bug 200181219

Change-Id: I716eb736242440360dc1e13426a69adfac08c6ed
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1112855
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Sumit Singh
bf77cfbf26 ALSA: HDA: Replace CONFIG_PM_RUNTIME with CONFIG_PM
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
sound/.

JIRA TPM-704

Change-Id: I5807fa8d35b3fbbd1afdb69d2dbba760abb80e27
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f5e1951ebe tegra-alt: adsp: messaging fixes
Request acknowledge for params sent via mixer controls. This
ensures parameter messages are processed before suspend.
Use a default message handler to flag completion event when APM
is used in cases other than offload and PCM streams.

Send all messages (connect, io buffer etc.) immediately.

If message queue is full, then trigger APM via maibox interrupt,
wait and attempt to queue again.

Fix check for wait timeout.

Print error if message queues are not empty when suspending.

Bug 200149702

Change-Id: Iddb1d8d62c659949294cfe258f88bad22e28cc92
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1112097
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Srinivas Anne
24478baeaf asoc: tegra-alt: add kcontrol to set i2s bitwidth
Audience require 32 bits/channel for power optimized routes.

Added k-control to update 12S bit width. This change will also take care
of converting XBAR_BITS to CLIENT_BITS by padding zeros from LFSR to LSB

DAI format is hardcoded to 32 bits in Audience codec driver.

Bug 200118587

Change-Id: I3cf35977e8ba57d83084bd86ae6a2720a6acde7e
Signed-off-by: Srinivas Anne <sanne@nvidia.com>
Reviewed-on: http://git-master/r/830893
(cherry picked from commit a7b79a1b71e4e11cad1fb323e8ccbcd42894a2a0)
Reviewed-on: http://git-master/r/832487
Reviewed-on: http://git-master/r/1028395
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viswanath L
93b24a451e tegra-alt:adsp: Allow "Min ADSP Clock" ctl always
"Min ADSP Clock" for the APM is set at the widget ON event, which
sometimes occurs immediately on closing the APM connections (like for
SPKPROT); allowing "Min ADSP Clock" setting only if APM is initialized
causes this to be missed at times

Allowing to set "Min ADSP Clock" before APM is initialized will ensure
that it's always available at the subsequent widget event

Bug 200170455

Change-Id: I5500484f42a23abb290431a8e329e57e741a0e14
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1027039
(cherry picked from commit a3ceb08c60ecb398a192dc607c1587b797ca79b7)
Reviewed-on: http://git-master/r/1029374
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
6c30a39444 tegra-alt: adsp: add APM input mode control
APM input mode can be set to PUSH or PULL.
In PUSH mode, APM blocks if there is no input available. Usually
a continuous mode ADMA sends interrupt when input data is available.
In PULL mode, APM blocks only if there is no input available and
a input fetch request is pending. Usually a one shot mode ADMA
fetches input data when required and signals event to wake up APM.

Control "APMx Input Mode" is provided to set input mode.
Default mode remains PUSH.

Bug 200150727

Change-Id: I10efd78ab593beb2e8a4b999dfa088e48f1e965b
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1017553
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Ajay Nandakumar
a15d51b4ab sound: tegra-alt: Route interrupts from DT
Routing ADMA interrupts to ADSP or HOST from Device tree. This reduces
adding un-necessary code for routing interrupts using
tegra_agic_route_interrupt for statically routing.

Bug 200152320

Change-Id: I15df7a9c65f1ec0322122bb7301900217b8d36d2
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/1000827
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
9d576648ea tegra-alt: amx: allow disabling of AMX slots
AMX slot can be disabled by sending negative value via
Byte Map control.

Bug 200100724

Change-Id: I67d8e0896b739f94187e4401ceb09382a4a7ed8d
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1008822
(cherry picked from commit 0d12eeba0d0b9e411bab4eb899b19d33254f484c)
Reviewed-on: http://git-master/r/1010807
(cherry picked from commit 36cc2f41ab7a54d729a7f237c877569f5ab841d1)
Reviewed-on: http://git-master/r/1022463
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
b57470cec4 tegra-alt: admaif: flag ENABLE reg as volatile
ADMAIF channels used by ADSP are enabled/disable from ADSP.
So mark ENABLE register as volatile to avoid CPU writing
incorrect values into it.

Bug 200173637

Change-Id: Ic441d890e90dd087ae6bdd2a0b9ef8ceec0bb333
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1013345
Reviewed-by: Automatic_Commit_Validation_User
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
Mohan Kumar
d50bf8eeb6 ASoC: tegra-alt: Add parent source for spdif clock
Add parent source for spdif clocks in the driver.

Bug 200162115

Change-Id: I3e4f3c73fbc4f5ac8dc25d26879cf8115d506f13
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/932064
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
2f07906bd0 ASoC: tegra-alt: Support adma iso client
Support adma as a part iso client to calculate the adma bandwidth based
on the usecase on both cpu and adsp side. This will help the iso manager
to alter the emc frequency.

Bug 1675078

Change-Id: I301aa710929665ea56f8183de8d22851913afa9c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/924061
Reviewed-by: Ayoosh Bansal <ayooshb@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
287853b54f tegra-alt: adsp: Add eavb dma source codec
Add eavb dma plugin interface params
Call eavb dma plugin init when path is complete
Add ADSP-EAVB widget and dai-links

Bug 1704053

Change-Id: Iaf817f3fcabc349bbcad7d71d3f0c00fabe12c2a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Signed-off-by: Arun Mankuzhi <amankuzhi@nvidia.com>
Reviewed-on: http://git-master/r/840906
Reviewed-by: Nitin Pai <npai@nvidia.com>
Tested-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
8867b0f9b2 ASoC: tegra-alt: clean up clock codes
Clean up the clock codes
 - remove clock rate hardcoding
 - move clock rate to DT

Bug 200164600

Change-Id: Iac841e9ef6ac621d1149efa8993bc07fad8f74b6
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/933714
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Sarada Dash <sdash@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
ea7da663e0 ASoC: tegra-alt: add adsp admaif dai
Change adds dais for adsp-admaif dai
links.

Bug 200130700

Change-Id: I9d7ca54b760e77295d6a898ead01bb1033b0dce9
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/934517
Reviewed-by: Nitin Pai <npai@nvidia.com>
Tested-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
cf994c29d6 ASoC: tegra-alt: Cleanup maui defconfig
Removes machine driver specific dependency
for having configs for each platform. Instead
this should be done from device tree.

Change-Id: I6d8ac10dc2d2e25b4882a5e6b163a1d8f042d4fb
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/932743
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
46bfef7068 tegra-alt: adsp: add ADMA plugin param controls
Add controls for sending parameters to ADMA plugin

Bug 200100724
Bug 200150727

Change-Id: I2d8c0dcebf679886d966fc45e96035f963740e10
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/925794
(cherry picked from commit d3b6b4071619d8745ff62b2249a3653e83bf26d4)
Reviewed-on: http://git-master/r/928686
(cherry picked from commit 5c3833b564d826dabaacf527d49a5a21e7fafc23)
Reviewed-on: http://git-master/r/928998
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
76d94dcead ASoC: tegra-alt: Move register store/restore
Move register store/restore from pm API's to
runtime API's for platforms, with CONFIG_PM_SLEEP
not enabled, to work.

Bug 200166409

Change-Id: Ifcdd78206b3ac59edc8ba1279316cfa8c87e7204
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/932101
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
17661675d6 ASoC: tegra-alt: Add SPDIF loopback mixer control
- Add amixer control to enable internal SPDIF
  loopback.
- Add dummy set_bclk_ratio to prevent sound
  card registration error

Bug 1642888

Change-Id: I15832a5f64976f9a40d890d54b47713d1d63b141
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/929948
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
8d4601447c ASoC: tegra-alt: fix coverity defect
fix coverity defect "unsigned compared against 0"

Bug 200116059
CID 20237

Change-Id: I8bf81f0ef77a8bc87d5ba38b01e2a3d0e6b7b948
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/929461
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
d00fea6da9 ASoC: tegra-alt: add check for pointer before access
add check for context pointer before accessing it in suspend.
Also move setting of driver data at the end of probe function.

Change-Id: I5724ee810dd3ca409412aa21d61d35519b1432a3
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/921743
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
56e4b6edb2 ASoC: tegra-alt: fix the error check
Fix the error check in function tegra210_adsp_app_init(), as return value
is from ERR_PTR this needs to be checked with IS_ERR macro.

Bug 200154983

Change-Id: I951cccf6a65bdfd829da1bd79e2622a40ecf30cd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/926309
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
870919fc70 tegra-alt: mvc: curve type and volume gain fixes
- added mixer contols to set curve type,
  cif channels and number of bits.
- modified volume control to increase/decrease
  volume by 1dB for every step (for linear curve)
- changed default curve type to linear
- fixed check on number of channels

Bug 1694107
Change-Id: Ibad07ff2f61fef73e84f5193991b092afaf8db8c
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/828227
Reviewed-on: http://git-master/r/834971
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
d0bb22eb86 ASoC: tegra-alt: Add apb2ape clock in xbar driver
Add apb2ape clock support for xbar driver for ape-pd functionality

Bug 200124772

Change-Id: Ib21a760574d2c1aff1d8a653f016db697e97a31d
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/826159
(cherry picked from commit 76ae6f150cefe0afd79769c652c5a7158188450f)
Reviewed-on: http://git-master/r/838036
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
d99c28330a tegra-alt: sfc: enable 48KHz to 24 KHz conversion
Added SFC RAM coefficients for 48KHz to 24 KHz conversion

Bug 1684121

Change-Id: Ifc1f0689c0d21fcf197b384f032b50324c647c4b
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/834981
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
9b3e0282c1 ASoC: tegra-alt: Machine driver for Maui
Change-Id: I25a053140b44a2bce7d23bf3d93f554b1c8b7b68
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/816553
Reviewed-on: http://git-master/r/821157
Reviewed-by: Wahed Syed <wsyed@nvidia.com>
Tested-by: Wahed Syed <wsyed@nvidia.com>
Reviewed-by: Bob Johnston <bjohnston@nvidia.com>
Signed-off-by: Anil Gahlot <agahlot@nvidia.com>
Reviewed-on: http://git-master/r/824936
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f77c18ee6f tegra-alt: fixes for kernel-3.18
Use snd_soc_kcontrol_codec() instead of snd_kcontrol_chip().
Put additional T186 ADMAIF channels under macro.

Bug 200100724

Change-Id: I20d280f067414bec16a4f07e38a05b64306cb217
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/826932
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
0fbbcc3bfe tegra-alt: add controls for CIF channel config
Add controls for configuring CIF channels for AMX and ADMAIF.

Add controls for CIF stereo/mono conversion for SFC.

Remove non-zero check in put_byte_map() to update byte mask.
Due to this check, byte 0 map wasn't getting updated for valid
value of 0.

Bug 200100724

Change-Id: I37b96594464f699db93552f5c1e148c51e963c5e
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/760115
(cherry picked from commit 8c2d36d0303aac45553cc64c148d8c62a8bcf880)
Reviewed-on: http://git-master/r/772770
(cherry picked from commit d17f88c03e55d8f0a250cd013b7d18a27c0d789c)
Reviewed-on: http://git-master/r/781739
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
3dca31ad46 ASoC: tegra-alt: Fix i2s soft reset api
- rx soft reset should be set for playback case
  and tx soft reset for capture case
- make soft reset registers writable by regmap

Change-Id: I840332e9ae30506c16c22ad423dc5e264188a858
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/818828
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
Tested-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Viswanath L
7c3fc296c4 ASoC: tegra-alt: make xbar_set_clock() available
Move tegra210_xbar_set_clock() out of CONFIG_ARCH_TEGRA_21x_SOC
macro check

Bug 200143956

Change-Id: I9eb1357506ebf6fca856f2fc99c7c948a9cbb6bc
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/817505
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
036869e456 adma: tegra: prepare clk source before using
Preparing clk source is required to have non-zero consumers
on the clk. The API clk_prepare() has to be called before
clk_enable(). Added similar changes during disable also

Change-Id: I27beac0d120cfa1b63cbb669de0482c9c13aacb3
(cherry picked from commit 9fa80d2afda2f2942d6c5b0407c59ad9e3337493)
Reviewed-on: http://git-master/r/795020
Signed-off-by: Asha T <atalambedu@nvidia.com>
Reviewed-on: http://git-master/r/807790
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
6db8dd359c ASoC: tegra-alt: use devm_clk_put and not clk_put
Use the devm_clk_put function instead of clk_put i
to avoid kernel panic when clk_get fails

Bug 1687658

Change-Id: I2ab31667dfdec4298d87a9a1d2d427954880b41d
(cherry picked from commit 2874a4278430d482b0309b954c36e7300807f9ae)
Reviewed-on: http://git-master/r/802540
Signed-off-by: Asha T <atalambedu@nvidia.com>
Reviewed-on: http://git-master/r/807794
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
4adc0e323f ASoC: tegra-alt: Remove unused clock handle
Remove unused clock handle from asoc utils functions.

Bug 200127320

Change-Id: Ie519192d9f7c78b190dc625d83fbe31d14c22df2
(cherry picked from commit 85ff905053619b188c90b9161369284107792beb)
Reviewed-on: http://git-master/r/795939
Signed-off-by: Asha T <atalambedu@nvidia.com>
Reviewed-on: http://git-master/r/807793
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
5b85037cb8 ASoC: tegra-alt: use snd_soc_kcontrol_codec
Use snd_soc_kcontrol_codec instead of snd_kcontrol_chip in K3.18

Change-Id: I7e552b5ae4fc1488281499f6f3a642bcab5c6317
(cherry picked from commit 45c87f98c85fa6a70c841f6aaabca1b9a2ae2db8)
Reviewed-on: http://git-master/r/807096
Signed-off-by: Asha T <atalambedu@nvidia.com>
Reviewed-on: http://git-master/r/807795
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
7460257e66 ASoC: tegra-alt: Add changes to support CCF
Add the common clock framework support changes to audio drivers.
the change replaces the clk_get_sys() with devm_clk_get()

Bug 200127320

Change-Id: Ie97b127b302c6e7806b60dc4c11986acb1694525
(cherry picked from commit 8730fbc8a2cfee13229fed9ded529c62c7fc9eee)
Reviewed-on: http://git-master/r/792739
Signed-off-by: Asha T <atalambedu@nvidia.com>
Reviewed-on: http://git-master/r/807788
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
700c482239 tegra-alt: adsp: wait for adsp ack on reset
Add mechanism to wait for ADSP acknowledgement.

ACK is requested when resetting to ensure that ADSP is
suspended only after APM stop processing is complete.
This prevents case of ADMA not getting stopped/reset
before suspend.

Bug 200130757

Change-Id: Ia86a31c996d40192210837e61aa95d8f920ee7f5
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/772220
(cherry picked from commit 72a04194685b299a959ecf64b92ba7f160e197f0)
Reviewed-on: http://git-master/r/795560
(cherry picked from commit 6a4a2211bfd1561d96ace832e1b45bee23d9ef3d)
Reviewed-on: http://git-master/r/799367
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viswanath L
2dbe4d7a13 ASoC: tegra-alt: Enable DCR and DMIC Boost Gain
- DCR filter enabled
 - Mixer control "Boost Gain" provided (with 100x factor); gain
   is applied in LP filter configured for passthrough

Bug 200108603

Change-Id: If1e3cfa8cc0b5a3a186ebd6ecdeba9a5a3cc2ef3
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
(cherry picked from commit fa3e8e9a95544f47dfb92d71321068ed30dd97ec)
Reviewed-on: http://git-master/r/802864
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viswanath L
b16a07152b ASoC: tegra-alt: Update DMIC DCR coeff to POR
TEGRA210_DMIC_DCR_BIQUAD_0_COEF_4 is corrected to 0x0
(as per latest POR)

Bug 200134942
Bug 200078772

Change-Id: I628c2d3e18615df476b67761553762a23f1fe47e
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
(cherry picked from commit eb36521b1c8d91a7760f684d43e65101762d8655)
Reviewed-on: http://git-master/r/802835
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Asha T
55e3f3b68c ASoC: tegra-alt: Add config for card registration
Registration of audio card was causing L4T sanity test
failures when audio codec was absent. Added a new kernel
config to selectively enable this feature.

Bug 200130213

Reviewed-on: http://git-master/r/783159
(cherry picked from commit 8adb770420239e57a2061c54dafae08ddaee7928)
Change-Id: I0998c122742e4012eda02a3d389fae96ee85202b
Signed-off-by: Asha T <atalambedu@nvidia.com>
Reviewed-on: http://git-master/r/793039
Reviewed-by: Shaunak Gupte <shaunakg@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Dara Ramesh
7b3d286458 asoc: tegra-alt: fix admaif channel status check
-fix incorrect channel status check for playback
and record path

Change-Id: I51ad4541e3e2b6eb68265ab1d712fb0c2082600a
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/786430
(cherry picked from commit c85528601c3f60ec94fab8b081088e4bd5365a15)
Reviewed-on: http://git-master/r/790885
(cherry picked from commit 7dbdc9a51205419ef817c0b15805d2a6f6761d8e)
Reviewed-on: http://git-master/r/791669
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
22733ae2b1 tegra-alt: adsp: use nvadsp_mbox_send() for mailbox send
Use nvadsp_mbox_send() to send mailbox message. This allows
blocking functionality with time out when sending messages.

Add runtime PM get/put when sending APM messages from widget
events as it was seen that this function is called even when
runtime resume had failed in one of the error cases.

Bug 200123443

Change-Id: I29e0860eadc73af2f32af58c1ca614806741709b
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/779898
(cherry picked from commit 7cb1c2b7b51010ab97e4125825f4658b32479487)
Reviewed-on: http://git-master/r/785351
(cherry picked from commit a150b9f3fc50ed1f6c0df71cad02a8a24b1a866f)
Reviewed-on: http://git-master/r/791628
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
1d0e9b5b6b tegra-alt: adsp: add runtime get failure checks
Add pm_runtime_get* failure checks. This also captures any
failures in starting ADSPOS.

Remove redundant pm_runtime_* calls from DAPM widget events.
These are not needed as driver's runtime resume and suspend
functions are called before starting and after stoppping the
playback.

Bug 200123443

Change-Id: I2c1f8fcff892634d4129e6cb08d6e21a7d63fdcd
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/746123
(cherry picked from commit 093dc626c51467f3f85d10c3deb97df861ff85dc)
Reviewed-on: http://git-master/r/784832
(cherry picked from commit c5a457bce02fd9bcc5c9e7e89fe4baee7189a075)
Reviewed-on: http://git-master/r/791043
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
88b0451828 ASoC: tegra-alt: i2s: use snd_soc_kcontrol_codec
In k3.18 snd_soc_kcontrol_codec should be used to access
codec instead of snd_kcontrol_chip

Bug 200123169

Change-Id: I5bfdb7ebbbe601df9d580727be00786617abab3f
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/784591
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
1b05a7ad2c tegra-alt: adsp: reset handler on close
Set message handler to NULL on stream close.
Acquire lock when calling msg handler to avoid
race condition.

Bug 200121246

Change-Id: Ia1182a787f00c2ee9b092a9822a6d5c8404e3b12
Reviewed-on: http://git-master/r/768309
(cherry picked from commit 116260c46c2c0aa077bf2ca57ea2227a56ebd718)
Reviewed-on: http://git-master/r/770473
(cherry picked from commit 2100a3c5f70877dd566c201ffd6c4d033ed819e1)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/781737
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
47cc203e9c tegra-alt: adsp: add control to set min ADSP clock
Certain cases like speaker protection which involve
real-time input require sudden increase in ADSP load.
ADSP DFS fails to cater such sudden increase in load
without compromising power.

Per APM control is added to set min ADSP clock when
APM is running. Min clock is restored when APM stops.

Bug 200126105
Bug 200126363

Change-Id: Icff8cee0b464f9621db0f8ba506d2e3ba307c683
(cherry picked from commit cb5c4c718ea2e8a26126cf70da2c44e26673d531)
Reviewed-on: http://git-master/r/779169
(cherry picked from commit 07e0d3265656ec0a263d9b55e2c9c51d72dc8d17)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/781741
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Dara Ramesh
b38e420610 asoc: tegra-alt: i2s: add kcontrol to config cif
add kcontrol to config audio bits on i2s cif bits

bug 1670069

Change-Id: Iba6c4c2054d28e49d3aeaa38b295ad5b9c48f256
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/775578
(cherry picked from commit 336386d89d2f72f62d779969a9ebb2af68cf2aae)
Reviewed-on: http://git-master/r/782237
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Deepa Madiregama
ec1a48aac2 tegra-alt: mixer: change volume ramp co-efficients
Change volume ramp co-efficients in mixer to complete
ramp up/fade out within 1024 samples

Bug 200118738

Change-Id: I9685db097ec53e450c8e337562ef1682c4c6f758
Signed-off-by: Deepa Madiregama <dmadiregama@nvidia.com>
Reviewed-on: http://git-master/r/767041
(cherry picked from commit 95ca7ed5cb9c035a38b3e39bb69ce8e3a4ffb144)
Reviewed-on: http://git-master/r/772221
(cherry picked from commit cd6c91a5ce18315913b747769537e1d7eeca0963)
Reviewed-on: http://git-master/r/777330
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
6a5423c48c ASoC: tegra-alt: machine driver for rt565x
Adding the machine driver to support rt565x family of
audio codecs from realtek.

 1) The button detection feature is pending which will
    be enabled going ahead.
 2) The sound card will be registered irrespective of
    whether the audio codec is present or not. This is
    required since all jetson-cv boards wont have audio
    codec connected.

Bug 200118114

Change-Id: I7b9fb236b1e908ad9da73909c7739b9e45a3cee6
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/773940
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
0d6323eec4 rt5659: Add RT5659 driver
The driver is received from Realtek.
Following changes have been made,
  1) Disable button detection IRQ. Required for now to
     allow headset/headphone detection to work consistently
  2) Introduced a delay of 20ms in rt5659_headset_detect()
     (suggested by realtek)

Note: Will update the new version of the driver for latest
kernel once received and tested

Bug 200118114

Change-Id: If5b3e1d25a3815f2cb67edacecddab4f939c262b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/773939
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
756058e785 ASoC: tegra-alt: use #ifdef for suspend/resume function
suspend/resume function is used when CONFIG_PM_RUNTIME is defined, if
this is not defined then compiler errors about unused-function.
put suspend/resume function under #ifdef CONFIG_PM_RUNTIME.

Change-Id: Ibad9d7a0528ed5be536e987075cbc26a71487d56
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/766222
Reviewed-on: http://git-master/r/769291
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Tested-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Nitin Kumbhar
e493cee37f platform: ape: add tegra_pd_ops for power domains
Add tegra_pd_ops for ape and adsp power domains so
that driver's *runtime_suspend() and *runtime_resume()
routines are called as part of stop_dev() and
start_dev() and not at the last when power domain is
being powered off.

Remove power down delay for APE power domain.

Bug 200090996

Change-Id: Ie7d69964d647b0392728b9f5b147818f4a525928
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/735632
(cherry picked from commit 37ca24d340ddf0b70b406d04bf98ee686ad280a7)
Reviewed-on: http://git-master/r/752259
(cherry picked from commit 0ca955773e6cbd942c2de6f8ed28673ef34b5bbf)
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/766594
2022-09-29 15:30:21 +05:30