Commit Graph

116 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
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
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
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
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
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
Sameer Pujar
f734578a22 ASoC: tegra-alt: send bytes for period size msg
tegra210_adsp_send_period_size_msg is sending size in period size
which is wrong and it should be no of bytes in the period size.

Bug 200329032

Change-Id: Ib43569d24dcfeeeac36c878a51affaa347eacf0b
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1519960
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1532211
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
6b67bfa9a0 ASoC: tegra-alt: switch support for adsp
Change allows support to select one FE among allowed
FE's to be routed to ahub, with rest of the inputs
in drain mode.

Jira EMA-389

Change-Id: I31889a52d67390dcfbf0f2d391acd86bb76cd64e
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1331535
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Sameer Pujar
3f5db4388d ASoC: tegra-alt: adsp: callback func ptr for adma
There is a function exported from adsp os code, nvadsp_set_adma_dump_reg,
to set the function pointer for adma regdump callback.

This patch uses the above exported api and sets the callback to
tegra_adma_dump_ch_reg, which is implemented by adma driver.
This is done during tegra210_adsp_init.

Bug 200289390

Change-Id: If1c2826928d5e5d51a805ed0a2211c20a1ecf6f8
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1484830
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
9a3f4fe1d7 ASoC: tegra-alt: unify tegra-alt driver
Unify adsp and i2s driver to support kernel unification.

Bug 200257345

Change-Id: Ic472c4fec0e1febf9b26a9a0ad67138329a25884
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1477310
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>
2022-09-29 15:30:21 +05:30
Uday Gupta
f070dc4c40 ASoc: tegra-alt: ADMA channel property parsing
Add code to use the ADMA start channel number from DT
entry nvidia,adma_ch_start

Jira EMA-413

Change-Id: Iec098d133226f70e455dd8ff0b706636f678ab2f
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/1477152
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
104d2c7cea ASoC: tegra-virt-alt: Add 24 kHz support
Use SNDRV_PCM_RATE_KNOT instead of
SNDRV_PCM_RATE_8000_192000 to support 24 Khz
Sampling rate

Jira EMA-412

Change-Id: I05375f8203411d0366b7c0b5e2b4dca35d70342c
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/1475235
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Diwakar Paliwal
f2c8d09fea tegra-alt: adsp: Use devm_clk_get for t210
Use devm_clk_get for t210 during probe. This is
required for successful probe as t210 and t186
use common clock framework on K4.4.

Enable ADSP driver for t210 config.

Bug 200297206

Change-Id: I56a7f6196c07edb00548217fac1f69b03de3a882
Signed-off-by: Diwakar Paliwal <dpaliwal@nvidia.com>
Reviewed-on: http://git-master/r/1471996
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
af364ab0a2 tegra-alt: add drain feature
Change adds draining feature for adsp playback.
NULL-SINK's are used as dapm widgets for alsa
path completion.

Jira EMA-389

Change-Id: Ic4125fc4e1b6dab7f4886fe2ad2dfdefc6962209
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1327309
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
bff751a2eb ASoc: tegra-alt: fix coverity
Change corrects:
1) Unsigned compared against 0
2) possible null pointer dereferencing.
3) Dereference before null check

Bug 200192143

Change-Id: Ib005e3bb808fb12cb5f8ee6911bd3c522c879b00
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1467216
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
df7fa78105 ASoc: tegra-alt: increase adsp pcm dev
Change adds support to increase the number
of pcm devices exposed by adsp-alt driver.

Jira EMA-389

Change-Id: I34f23bd993c4d53619de7d74cad3c9dc2644afda
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1454052
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
7f5394e3f6 ASoC: tegra-alt: remove pcm ack dependency
Change remove dependency of ack by pcm ops to update
application pointer. MMAP mode can't be used with
ops ack. When trigger is called updated app pointer
info is passed to adma plugin. On adma period
completion callback, updated application pointer
is again passed to adma plugin.

Jira EMA-389

Change-Id: Iad1376cc218b2c7b49812db34e128ed43b10eddb
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1331554
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
76d48d8cd8 ASoC: 8 ch playback/capture support
Change adds support on adsp-alt:
- allows pcm_open for upto 8 channel.
- adds option to pass burst_size for HV
- allows BE to be configured with FE's params
  to be sent via ivc to audioserver.

Change-Id: Ib3ab3fb4d95bfc8335cd1d52eeb71cc4e5a538a5
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1317770
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>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
5ec5417e3c tegra-virt-alt: correct build dependency
Change adds correct build dependency
for virt-alt drivers.
Bug 1828453

Change-Id: Ifa47a3eae0335bcaf6a3473b0e13e1902c31faaf
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1298609
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Ishan Mittal
aa31cc268e sound: soc: tegra-alt: Use ARCH_TEGRA_210_SOC
Make use of ARCH_TEGRA_210_SOC instead of ARCH_TEGRA_21x_SOC
so that we can get rid of redundant ARCH_TEGRA_21x_SOC.

ARCH_TEGRA_210_SOC aligns to up-stream as well.

Bug 1766370

Change-Id: I10a9d9bb63b1fbac358d85a228710a208d595281
Signed-off-by: Ishan Mittal <imittal@nvidia.com>
Reviewed-on: http://git-master/r/1306757
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
5fe501ba84 tegra-alt: adsp: add parameter size checks
Fix possible buffer overflow in case of invalid user
parameter by adding size checks

Bug 1869543

Change-Id: I82ac00e24a3ca40915eb6c556454c9649cb644bd
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1297227
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
Shardar Shariff Md
b49c00dac2 soc: tegra: 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: I8119717635823a642a08ba3e5eeed4e599f8d0df
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
Reviewed-on: http://git-master/r/1288269
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
sdash
90b78c8f42 tegra-virt-alt: Match ADMAIF Client and xbar bits
Match Client and xbar bits for ADMAIF Interface

Jira EMA-380

Change-Id: I20fae77b8418f000415acf578aa858b8b12fb54e
Signed-off-by: sdash <sdash@nvidia.com>
Reviewed-on: http://git-master/r/1282761
Reviewed-by: Hariharan Sivaraman <hariharans@nvidia.com>
Tested-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f16184f16f tegra-alt: adsp: fix coverity defects
Add validity checks on data from userspace
Fix variable hiding

Coverity ID 31982 31979

Bug 200192147

Change-Id: I7fd6a8f1016aa5fe819c230e8154e3f82971c2d9
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1275950
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
Viswanath L
fa52637ec3 tegra-alt:adsp: NULL check for app variable
ADSP app variables are not initialized in all cases (like at APM
output pin) causing NULL pointer access to app->override_freq_work

NULL check fixes this; override_freq_work will get called at widget
ON event

Bug 200245012

Change-Id: Ie6161c0247d8b15db88bdef706ab6c3b472fa977
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1244336
(cherry picked from commit 6f6c38a0413b20111ff95d3e0d26c631f0a7a639)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1252706
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
445605513d tegra-alt: adsp: avoid sleep in send msg
Do not use blocking flag for mailbox send function.
Use mdelay instead of msleep

Bug 200222934

Change-Id: I9c121f50debb46b191ad735f7445bbe5c026e30a
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1217913
(cherry picked from commit 7cd8a2d558c7d59b020c39f6177b263242c1641a)
Reviewed-on: http://git-master/r/1252705
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
77c3fa9449 tegra-alt: adsp: schedule work for freq override
Schedule worker function for frequency override to avoid
adsp_override_freq() and clk_set_rate() getting called
from atomic context.

Bug 200222934

Change-Id: Ia65ce4a617bfd4494d04bdfac8b28e6d8260943c
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1211239
(cherry picked from commit 008fa5cd7722e3cdcb4ec96b13a73fda7e6bc2ad)
Reviewed-on: http://git-master/r/1252704
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Viswanath L
efd1112f5c tegra: adsp: Max ADSP clock at APM active
Spike ADSP freq. to max when app transitions to active so that ADSP
does not starve

Bug 200196267

Change-Id: I11863b2449cfecc47aefd9bc41059b634b3b2acd
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1154410
(cherry picked from commit 9e6163d9c1f2f07c9b4510d609aa974a75da96c7)
Reviewed-on: http://git-master/r/1236637
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
a304847e65 tegra-alt: adsp: Pass ADMA CH page to ADSP
ADSP NVADMA driver needs to program different ADMA channel
page based on which guest ADSP is assigned to in case of
virtualization

Jira EMA-358

Change-Id: I601965d255ef3ced6c5d8873a21890910689ab9a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/1251785
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:30:21 +05:30
sdash
08899c1d36 adsp_alt audio: Add checks for Plugin connections
Added checks whether plugins within and across APM are
connected or not,before sending any control message to adsp
for that plugin.

Bug 1797920

Change-Id: I880d129bac1ec4a885bb60ef6e5eb3d0bb1c8afb
Signed-off-by: sdash <sdash@nvidia.com>
Reviewed-on: http://git-master/r/1203078
(cherry picked from commit 05b04db52c0d35b78291dad8ce107481a78a3aef)
Reviewed-on: http://git-master/r/1216725
(cherry picked from commit 115d61defe5967c6eb66ae0ddcaf92ab705d8d6a)
Reviewed-on: http://git-master/r/1249615
GVS: Gerrit_Virtual_Submit
Tested-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
995c9c85a2 tegra-virt-alt: Add adsp virtualization support
Implemented tegra-alt adsp driver to be used as
common adsp driver for both native and hypervisor
mode.
Added ADSP DAI links in tegra virt alt machine
driver
ADMA Channel 16 onwards to be used for ADSP in
case of hypervisor mode
Added support for sending IVC messages from
tegra-virt-alt adsp driver for admaif cif settings,
and start/stop of playback/capture
Disabled the registration of AMC error interrupt
in case of hypervisor mode

Jira EMA-27
Jira EMA-29
Bug 200172732
Bug 200221932

Change-Id: I9973bd9fcc358786f4d3e9c7eae49def63747e16
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Signed-off-by: Sidharth <svarier@nvidia.com>
Reviewed-on: http://git-master/r/1159268
(cherry picked from commit 49072c9ec35e5b65f41abc8900c402794982a0c8)
Reviewed-on: http://git-master/r/1243043
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
404df98a3c tegra-alt: adsp: Add S32_LE playback/capture support
Currently adsp pcm device allows only S16_LE. For rest of format
it throws not supported error. Change will allow playback and
capture for S8/S24/S32 formats also.
However machine driver should make sure same format info is
configured for ADSP-ADMAIFx and ADMAIFx dai-links.

Bug 1756112

Change-Id: Iac76d022adc57ea88e6208a66086fdb29bff8c66
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1156127
(cherry picked from commit 39bc390bce81ea8538b3bca0116e3e7c4fa2745e)
Reviewed-on: http://git-master/r/1238420
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
4a5d4c683c ASoC: tegra-alt: Separate out adma as rx and tx
As adma plugin allocates static ARAM memory, having single plugin for both
rx and tx will be waste of ARAM memory, as MEM to AHUB don't need to allocate
memory during plugin loading.

Bug 200220099

Change-Id: I5d713ebd5718e751d341d8d64889a36327277b1c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1184236
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shashank Verma <shashankv@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Singh
368b5bcd4c Fix kernel warnings
These warnings do not cause any issue.
Making them as dev_info.

Bug 1774835

Change-Id: I04357d9465d0113d262f9d1034233ce59b82ee2a
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1201945
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
62fba33a1a ASoC: tegra-alt: fix the component probe
The component probe callback needs to be called for K4.4
inorder to assign the component read and write callback
functions implemented in the adsp driver.

Bug 200224813

Change-Id: I63874543411f5ffa10db99a94fb63e0dbb91a925
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1196926
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Tested-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Vandana Salve
abd65aedf7 tegra-alt: adsp: fix coverity issue
Fix coverity defects, Resource leak
Coverity id 33603

Bug 1781383

Change-Id: If03f2854ae58d3a2218d6df392d12a11d1c510dc
Signed-off-by: Vandana Salve <vsalve@nvidia.com>
Reviewed-on: http://git-master/r/1173653
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
0ec788ec71 tegra-alt: adsp: disable remove() callback
The adsp audio driver is not hot-pluggable at the moment.
It might cause issues if the driver has to be loaded or
unloaded. The remove() callback is disabled until we have
proper support for hot-plug.

Bug 1779074

Change-Id: I530d50bc1cad3917c712a4322f27256166422bd5
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1168492
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
f05cbe122b tegra-alt: adsp: supress bind/unbind attributes
Driver binding/unbinding is causing crash on the driver. The bind/unbind
options are supressed from the driver until there is plan to support this,
since it requires to take care of lot of other dependencies.

Bug 1779074

Change-Id: I61b41d425dac21b1bae1a21d36d0ca22dd4c7c20
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1166724
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
fcd36dccf3 tegra-alt: adsp: increase space for widget name
Memory for widget names is allocated statically by default widget
name "PLUGINx". If a plugin has longer widget name, then it will
corrupt the widget name memory and tegra210_adsp_routes. This
creates issue in DAPM and playback fails.

Use long name as default plugin name: PLUGINx-PLACE-HOLDER to have
bigger memory. Also add a length check on plugin's widget name.

Bug 200207626

Change-Id: I2442b07492a795ed120766eaee3a0083f80f6cf3
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1164763
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
2022-09-29 15:30:21 +05:30
Dipesh Gandhi
c279bec375 tegra-alt: adsp: clk to adsp_audio
Currently adsp_audio rely on xbar device to keep clock enable.
For some of corner cases it is observed that xbar devices gets to
suspend state leading to disabling of ahub clock, however nvadma
still trying to program adma. This leads to adsp crash.

This change adds support for adsp_audio to enable and disable
clocks as per its runtime_resume and runtime_suspend calls.

Bug 1756112

Change-Id: I5697853d901eed1059bd1ce29099a74cf62d46a3
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/1149568
(cherry picked from commit 17d84bd026751e1bc380d69bd89c4a034d9398fc)
Reviewed-on: http://git-master/r/1155917
(cherry picked from commit 0ef2ab54b1da6a9573c863ac8e60e7192ae3b2d6)
Reviewed-on: http://git-master/r/1163157
GVS: Gerrit_Virtual_Submit
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
962185df88 ASoC: tegra-alt: changes for kernel-4.4 transition
This commit has changes needed for audio on kernel 4.4
- select SND_DYNAMIC_MINORS for tegra-alt
- use snd_soc_new_compress callback function in snd_soc_dai_driver
  instead of setting compress_dai = 1
- use snd_soc_dapm_to_codec() to access codec from widget

Bug 200193757

Change-Id: I1744ca93786086691cb6eabdde33125a995de9e7
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1158639
Reviewed-by: Automatic_Commit_Validation_User
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
Gaurav Tendolkar
ff10659ee8 tegra-alt: adsp: change local function to static
Fixed following sparse warning by making local
function static:
$TOP/kernel-3.18/sound/soc/tegra-alt/tegra210_adsp_alt.c:2846:5:
warning: symbol 'tegra210_adsp_tlv_callback' was not declared.
Should it be static?

Bug 200088648

Change-Id: Ia4d78e297da3aa3bd9fe9effd64ddec30c2b67fc
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/1131635
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f230f18f24 Revert "Revert "tegra-alt: adsp: add support for 4kb read/write""
This reverts commit f75f4be594f2182d6c422d94fd11f88211b58ed0.

Original change was reverted because dependency was not
integrated from main to dev-kernel and original change
was causing GVS failures. Now putting it back.

Bug 1723185

Change-Id: Ifffcfb019237b448ba6ccd9bcae0423d36eb788e
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1127945
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
6477cf9ec9 Revert "tegra-alt: adsp: add support for 4kb read/write"
This reverts commit 7a72df25d0004716e03d8b062906d132baa265dd.

Change-Id: I941acae01ae163863c15d756c003cb0979c06d54
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1127324
Reviewed-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
Tested-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
72cf476367 tegra-alt: adsp: fix adsp mux texts
This corrects the ordering in tegra210_adsp_mux_texts for
ADSP-EAVB widget. Also remove unnecessary comments which were
incorrect.

Bug 200189793

Change-Id: Ie32aef90ca0b1fd688ca5888a3947f7b2ab37f6a
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/1125908
Reviewed-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
Tested-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
df8a0d1503 tegra-alt: adsp: add support for 4kb read/write
- added support for reading upto 4k bytes from APM
- increased write suppport to 4k bytes

Bug 1723185

Change-Id: I154bb6f699ce4eb441a0e5e0374770d40e7b631f
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/1019963
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
2022-09-29 15:30:21 +05:30