Commit Graph

4536 Commits

Author SHA1 Message Date
Arun Shamanna Lakshmi
318dc455c5 ASoC: tegra-alt: Add kcontrols for SFC output rate
1. Add kcontrols to vary SFC output rate
2. Rename d_audio to ahub clock during xbar probe

Bug 1442940

Change-Id: If86bd476822c6cfe07af8fbc7d7ead8b21e2a7d2
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/417232
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
790ac51a9d ASoC: tegra_alt: Use DMA channel name from DT
This change is to use DMA channel name from DT when pcm driver
requests the dma channel to dma engine.

Bug 1488342

Change-Id: I4b2518ce14caa366b834848571577273c4144ac6
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/401167
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
d9c7333753 ASoC: tegra-alt: Add get/put handlers for T210 xbar
Bug 1442940

Change-Id: I633c144a4f22b1c9d41f656a47331358b46d43d7
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/412204
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
1ce137c34c ASoC: tegra-alt: machine driver cleanup contd ..
1. Add utility to initialize xbar related dai links
2. Each machine driver intializes the I2S/codec dai links & appends
   it to the xbar dai_links exposed by the common utility file.

Bug 1508072

Change-Id: I2e92ead05dbc29293758383f6e937b38da0fc7f3
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/407820
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Arun Shamanna Lakshmi
0f8143d152 ASoC: tegra-alt: Add DAM and AFC driver
1. DAM driver is for SRC support in T124
2. AFC driver is for flow control in T124

Bug 1508072

Change-Id: Ic8ee22976155e0c01864a6d432cb4eefc7005a67
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/402747
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
bed2911d62 ASoC: tegra-alt: Add T210 grenada machine driver
This machine driver is for grenada platform with unit fpga.

Bug 1442940

Change-Id: Ifda6d493b115986f02b5497107a0f0894f73697d
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/397316
(cherry picked from commit 0fbf59a029a0e275766002a10abe4ecdc31c8064)
Reviewed-on: http://git-master/r/402619
Tested-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
f9bb9e84e5 ASoC: tegra-alt: T210 AHUB drivers
This driver is for T210 AHUB components.

Bug 1442940

Change-Id: If6b33bc89cfc273f8024b7e4f6d644c170c2fe4f
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Reviewed-on: http://git-master/r/397314
(cherry picked from commit 3972fbeccbec85f74a0ed959212382db5471e65d)
Reviewed-on: http://git-master/r/355184
Tested-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Rahul Mittal <rmittal@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
7a66be7f52 ASoC: tegra-alt: vcm30t124: Add dai link for spdif
This change is for adding spdif dai in vcm30t124
machine driver.

Bug 1423733

Change-Id: I1a0bfed96092d0b18b6b6b8ece2b742de3054630
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/344452
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bob Johnston <bjohnston@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
1b120344b3 ASoC: tegra-alt: Add machine driver for E1860-B00
This machine driver is for E1860-B00 board which has
AK4618 and AD1937 codecs.

Bug 1413475

Change-Id: I275261df331612c1c9232309388b08ae1ca703c9
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/337410
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
3b8791b781 ASoC: tegra-alt: add spdif driver
This change is for adding spdif driver in tegra-alt ASoC.

Bug 1423733

Change-Id: Ic52b58ab9bd0e8cb82e7834a5d1d2f3f87550bf8
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/339601
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Gajanan Bhat <gbhat@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
062304a1d1 ASoC: tegra-alt: vcm30-t124 machine driver
This machine driver is for the vcm30_t124 platform supporting
dual codecs(wm8731 and ad1937).

Bug 1373091

Change-Id: Icdde8b5e9067dc3365009d6e6262a964986dae37
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/290004
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Manoj Gangwal <mgangwal@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Songhee Baek
64a271ff0b ASoC: tegra-alt: Alternative DAPM-based driver
This driver is for the ahub with using DAPM.
It supports kcontrols to route within the ahub
clients by user space so we can route the memory
to amx, adx and other ahub clients to I2S for
playback/capture.

Bug 1354235
Bug 1373091

Change-Id: Ia43b007de7c1161ce551087428a090ff2bf1e09e
Based-on-work-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Signed-off-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-on: http://git-master/r/289919
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
f8c3f7a29e ASoC: tegra-alt: Fix system suspend handling
There are a couple issues with system suspend handling in the Tegra
ASoC codec drivers which are:

1. Most drivers the system suspend callback does nothing and this
   means that if the codec device is active when suspend occurs then
   the codec will not be suspended correctly. This has been seen to
   cause system crashes in the I2S driver when the system is suspended
   and resuming while audio playback is active.

2. The codec suspend handlers may be called twice when entering
   suspend. Suspend handlers should only be called once, but currently
   they are called twice; once by the PM core and once when the APE
   power-domain is turned off (if it is on when suspend occurs).

Fix the above two problems by:
a). Adding proper system suspend and resume handlers for all codec
    drivers, to suspend and resume the device if not runtime PM
    suspended on entering suspend.
b). Remove the code to call the PM callbacks from the APE power-domain
    code.

Finally, make the system suspend callbacks for these codec drivers
late suspend callbacks to ensure that the sound core has suspended
any on-going activity, before we attempt to suspend these codec
devices.

Bug 200275736

Change-Id: I7f43b8650d972356b0a529404792fe22125dde16
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1488962
(cherry picked from commit 5a7f3ab3d1e6d9d136859b9263b91e3f6998366b)
Reviewed-on: https://git-master/r/1511033
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2022-09-29 15:30:21 +05:30
Jon Hunter
a29581fc2e ASoC: tegra-alt: Fix parent runtime PM handling
Linux runtime PM automatically handles the runtime resuming and
suspending of a parent device and therefore, it is not necessary
for a child device to explicitly runtime resume or suspend the
parent.

The various Tegra ASoC codec drivers explicitly runtime resume
and suspend the parent device from within their runtime PM callback
handler. This should not be necessary.

Furthermore, currently the various Tegra ASoC codec drivers are
not suspended correctly if active when system suspend occurs. During
system suspend it is common to directly call the runtime PM callbacks
to suspend and resume the device if active from the system suspend
callbacks. However, the APIs, pm_runtime_get/put(), cannot be called
during system suspend and so the runtime PM callbacks for these codec
drivers cannot be called from the context of the system suspend
callbacks.

Remove the calls to runtime resume and suspend the parent device from
the runtime PM callbacks for the various Tegra ASoC drivers. This will
allow us to fix suspending and resuming of the Tegra ASoC drivers
across system suspend.

Bug 200275736

Change-Id: I9130d8e1c9f91a439651d279ffdf389474018f92
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1488961
(cherry picked from commit 6ae92527f6948ff484af761c1aa1073f79e13a8a)
Reviewed-on: https://git-master/r/1511032
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
85eae8d6ff 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 beloe fix
- ALSA PCM Open API first executes runtime resume of each driver.
  So need to prevent any reg access in runtime resume of drivers.
- ALSA PCM Open executes ADMAIF startup after runtime resume of
  each driver. If ADMAIF startup returns failure based on shutdown,
  PCM Open operation will fail, this will break PCM Open path and
  will ensure no further ALSA APIs/Callbacks are called.

Bug 200289815

Change-Id: I46060d74b3271a870a0bcfc727972c97e2a73931
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1475216
Reviewed-on: http://git-master/r/1499116
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1502050
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
33c2382438 ASoC: tegra-alt: xbar unification changes
Unify the Makefile and Kconfig for xbar driver to support all chips.

Bug 200257345

Change-Id: If3eea1ca146ce5c4b0ee7b8b6cdd6ef642a5b698
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1326993
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
02bf5978b4 ASoC: tegra-alt: unify the fpga driver
Unify the fpga driver

Bug 200257345

Change-Id: I5a5ee7bd660ece145272e9d552125abedff7b859
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1326848
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
06888682e6 ALSA: tegra-alt: fix kernel 4.9 build errors
This patch contains changes needed for kernel 4.9 compilation.
Kernel 4.9 has two changes, struct snd_soc_codec_driver is modified
and changed PCM runtime array to a list from struct snd_soc_card.

Bug 1856400

Change-Id: I5d22e7adfd3101cf8a90d02c998ff03fab7ecaa1
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1306168
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
f9d280789b ASoC: tegra-alt: expose dspk fifo threshold ctls
Adding more configurability to the dspk driver where,
user can program the thresholds as per the requirement.
If the control is not set, default configuration of
zero threshold is used.

Bug 200283222

Change-Id: I9cbf94c5553e11aeb0b4cc85ceba29fc74ceabc2
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1319913
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Shardar Shariff Md
c08f5f701a t18x: drivers: use soc/tegra/chip-id.h for soc header
The soc tegra headers are unified and moved all the content of
linux/tegra-soc.h to the soc/tegra/chip-id.h to have the
single soc header for Tegra.

Change-Id: I67a95258775e50add4ab9872e4525910b14ff99c
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
Reviewed-on: http://git-master/r/1291661
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Timo Alho
122abbbbab ASoC: tegra-alt: fix compile when CONFIG_PM=n
Bug 1827482

Change-Id: Ibe748f4d67f78f87445e35f3b404b240a9e61026
Signed-off-by: Timo Alho <talho@nvidia.com>
Reviewed-on: http://git-master/r/1237107
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
e66ce07df1 ASoC: asrc: clear asrc interrupt twice
As per HW Bug 200208400 we need to clear asrc
interrupt twice to update interrupt status
register.

Bug 200219757

Change-Id: I741f27cca155e45f0112f505eed415852f13e219
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1233840
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
dmitry pervushin
18fdaccd7a t18x: renaming KConfigs & Makefiles to add suffix
Bug 1783210

Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Change-Id: I20c29b4dd5947d296a6ab1e83d47e569e386855b
Reviewed-on: http://git-master/r/1176347
Reviewed-on: http://git-master/r/1177303
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Tested-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/1183017
2022-09-29 15:30:21 +05:30
dmitry pervushin
335e09749f t18x: add option to point to collapsed kernel
Bug 1783210

Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Change-Id: Iec6456b5ac7bba7e6eca98d84d9ed896092ba717
Reviewed-on: http://git-master/r/1174854
Reviewed-on: http://git-master/r/1177297
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Tested-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/1183012
2022-09-29 15:30:21 +05:30
Mohan Kumar
78f9429384 ASoC: tegra-alt: Support dynamic pinmux for dspk
Support dynamic pinmux settings for dspk, this change will help
to runtime configure the pinmux register to use pinmuxed path.

Change-Id: Ie87499a822854d8f077530f49d5516883c987839
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1181859
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
2c5128e5f8 ASoC: tegra-alt: support all APE interfaces
Driver support for all the APE interfaces. Also cleanup the machine
driver code.

Bug 1782976

Change-Id: Ifdaa3b19de661afd5231d9bface6fc9547f0eb3c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1177588
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
a9d4504d52 ASoC: tegra-alt: xbar and afc module fixes
Change fixes cyclic dependency of xbar and afc
module.

Bug 200176091

Change-Id: I43c362388f4383352c301bfe361ba220367fd60f
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1161522
(cherry picked from commit 005fb33d37aaa0785c7f78f42cbf2fca9c30cf9d)
Reviewed-on: http://git-master/r/1167578
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
45037f4a0a ASoC: tegra-alt: arad spew fixes
In lane enable functionality currently
we don't check the existing state of lane.
Change make sure to do nothing if current
state is same as previous state.

Bug 200179285

Change-Id: Ic7492fbc5aabd093d49dba546d0fb17282a30bcf
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
(cherry-picked from commit ebf11df77e0322e473fc4fa6ae0020135f7c6ea9)
Reviewed-on: http://git-master/r/1160156
Reviewed-on: http://git-master/r/1158151

(cherry picked from commit bd562cf6b19bf605f749617335da151baa9f0a71)

Change-Id: I3f61d79ffd88e479fe320e06cd19f7c6183bf112
Reviewed-on: http://git-master/r/1167575
GVS: Gerrit_Virtual_Submit
Tested-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
5131ed7b89 ASoC: tegra-alt: changes for kernel-4.4
Changes are done as needed for kernel 4.4 transition.

- select SND_SOC_COMPRESS for offload
- register jack at card level
- use snd_soc_dapm_to_codec() to access codec from widget
- use CONFIG_SND_SOC_TEGRA210_ADSP_ALT for adsp code

Bug 200193757

Change-Id: I0adbc9936d9d99f49d05af5def628af4d3c86790
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1154433
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
a197f2b4d7 ASoC: tegra-alt: replace direct access to codec dapm
The dapm field of the struct snd_soc_codec is removed, to access
dapm field use snd_soc_codec_get_dapm()

Change-Id: I2bf7f89058bd65baf2d89ffa926af9fe1e418927
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1157272
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Sidharth
eb411ec113 ASoC: tegra-alt: add asrc params configurability
Added ability to disable h/w compensation
Disabling h/w compensation would work well
with mem-to-io
Added ability to set WORD_CNT for input and
output thresholds

Bug 200194803

Change-Id: Iea8942105e61ce307ad394d75de59836796f3fbb
Signed-off-by: Sidharth <svarier@nvidia.com>
Reviewed-on: http://git-master/r/1135127
(cherry picked from commit 1b25a112a33b249696a87b8527afc1d132a9cbba)
Reviewed-on: http://git-master/r/1142696
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
db23cd7e8a ASoC: tegra-alt: asrc frac part fix
Changing frac max to unsigned int as
mask for asrc frac is 0xffffffff.

Bug 200185841
Change-Id: Ic47896b47fa5e4a5e4eb7320a69d6b94747715a5
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1113391
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
Dipesh Gandhi
023f83496c ASoC: tegra-alt: build sound card module
Changes releated to building machine driver
as module.

Bug 200176091

Change-Id: I5180861343e21b1e2275292d6bf11c8d5d9166e7
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1020182
Reviewed-by: Hyong Bin Kim <hyongbink@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
0f10c0cf2c tegra-alt: asrc: sw-reset asrc before disabling
To make sure last transaction on stream
was clean we soft reset the lane before
closing it.

Bug 1736992
Bug 200181219

Change-Id: I0df111d8d535a574e021a459b7d0c2c37a2c6345
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1112188
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nor Cho <ncho@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Sidharth
93187aba56 ASoC: tegra-alt: handle arad ratio update INTR
- Unmasked ratio update interrupt
- Handle ratio update interrupt in ISR

Bug 200180677

Change-Id: I3c360c1dba8ee0ab8aac5e67eb08c84d0a332bca
Signed-off-by: Sidharth <svarier@nvidia.com>
Reviewed-on: http://git-master/r/1029435
Reviewed-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Amit Sharma
bf142c83e5 sound: soc: tegra-alt: fix sparse warnings
Fixed the following sparse warnings:
- warning: symbol 'tegra186_asrc_ahc_cb' was not declared.
           Should it be static?
- warning: symbol 'tegra186_arad_ahc_cb' was not declared.
           Should it be static?
- warning: Using plain integer as NULL pointer

Bug 200088648

Change-Id: I26ca06f95517269840248b703969fb79e2c43c91
Signed-off-by: Amit Sharma <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/1011362
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
f2b5343db2 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: I0c7cda13ebf7318bb9d27549fc856d20ebd41cdc
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/932646
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
d451956f83 tegra-alt: asrc: request ratio packet from arad
If ARAD lane gets locked before ASRC is enabled
the ASRC misses the ratio packet from ARAD and does
not lock. Requesting ratio packet again from ARAD
enables ASRC to lock in such cases.

Bug 200158741

Change-Id: I63841b46eec832f3f16be9fc78fa51d723d9e825
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
(cherry-picked from commit 88eac6a1ffa5452c170756c1266eae388795689d)
Reviewed-on: http://git-master/r/842381
Tested-by: Dipesh Gandhi <dipeshg@nvidia.com>
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
Sumit Singh
829c39db5c ASoC: tegra-alt: Enable Werror for tegra files
Enable Werror for all the files under sound/soc/tegra-alt files,
so that all the warnings are treated as errors.

Bug 1454125

Change-Id: I71b761edeb5de94004b5f9868ca3c2f6fd2636f8
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/925848
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
9bf25d9f38 ASoC: tegra-alt: add check 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.

Bug 200160608

Change-Id: I7ebee91b5f825575f1d8d84f3246b2e9f86da3ed
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/923079
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
Dipesh Gandhi
675497468f ASoC: tegra-alt: Mark lock register volatile
Marking ASRC_STREAM_LOCK_STATUS as volatile.
When asrc configured in HW mode, we want read
on ASRC_STREAM_LOCK_STATUS from hardware.

In SW mode we use ASRC_STREAM_LOCK_STATUS as
R/W register.

Bug Bug 200163397

Change-Id: I2960e9b7417c5c3017c87b4494b252e9668c4444
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/926833
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
eceb04d76a ASoC: tegra-alt: add check pointer before access
add check for context pointer before accessing
it in suspend for asrc and arad.

Bug 200160608

Change-Id: If549bf77e8d2a2ab66507127930bfa7c474ea782
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/923558
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
2022-09-29 15:30:21 +05:30
Sidharth
21823baa4b ASoC: tegra-alt: Fix asrc sw ratio update steps
Fixed the procedure for sw ratio update
Removed the steps of setting of asrc in UNLOCK state
and waiting it to go in UNLOCK state.
In UNLOCK state asrc stops sending samples which was
leading to audio glitches.

Bug 200154554

Change-Id: Idf7fe685709afcf4f72c3aab95dd5ee812871b92
Signed-off-by: Sidharth <svarier@nvidia.com>
(cherry picked from commit adbe2553c993327edd44408544628e8a7864ad51)
Reviewed-on: http://git-master/r/838743
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Shashank Sinha <shsinha@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
1cd212a9b9 ASoC: tegra-alt: machine driver for bali
Bug 200133225
Bug 1701860
Bug 1698137

Change-Id: I1e484f771d43f0d35a8a2406c803ae92d797e46f
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/834987
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Sumit Singh
4be8236080 ASoC: tegra-alt: Fix build warnings
Fix below build warnings:-
- 'tegra186_arad_get_lane_ratio_change_status' defined but not used
- 'struct tegra210_xbar_cif_conf' declared inside parameter list, its
   scope is only this definition or declaration, which is probably not what
   you want

Bug 1454125

Change-Id: I14375bad93b3b1f8cf79e5e8efcbe96166b5de37
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/838920
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
3c9d319ae3 ASoC: tegra-alt: arad dapm fixes
Adding fixes related to arad runtime
& dapm policy via xbar.

Bug 200133225
Bug 200150306

Change-Id: Ic5f0ef66ecadd18c64ea1d684f28eed2eacc2b39
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/836450
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
Sameer Pujar
88883c5d26 ASoC: tegra-alt: t18x: stereo support with dspk
Exposing multiple CIFs and DAPs in dspk driver to
support stereo playback. Required support is added
in machine driver too.

Bug 200143864

Change-Id: Ie02bb6bf778c5a8ecc9f924820586891174a7dfd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/838574
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
43432df799 tegra-alt: arad: mixer controls to set prescalars
Added mixer controls to set numerator and denominator
prescalar registes. This allows the corresponding
clocks to be scaled down before ratio calculation

Bug 1684121

Change-Id: I0f8769ed0f61722785ecaa2afec689bdb357e02f
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/835222
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
b74ed9932e tegra-alt: asrc: runtime pm fix
1) fixing asrc runtime pm.
2) moving scratch address and global
 enable mask to runtime_resume.

Bug 200150306
Bug 200124772
Change-Id: If0dfc3c93ee431b43e36a7b934498177caad6ddd
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/829018
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
Ajay Nandakumar
b2767ab554 tegra-alt: arad: make AGIC as interrupt parent
Making AGIC as interrupt parent to ARAD and hence by making this change,
the driver directly receives the virq, since the task of getting the virq
is handled by the gic drivers.

Also, for GIC PPI interrupts, the irq number that should be mentioned
should be irq - 32.

Bug 200146854

Change-Id: Ic3feb0f4ea46226f53a72c5789c69b5d6d7cdf01
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/818988
(cherry picked from commit d35e14d26e55723be46d929d046610c05445165c)
Reviewed-on: http://git-master/r/830798
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30