Commit Graph

208 Commits

Author SHA1 Message Date
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
Nitin Kumbhar
953c677578 platform: ape: add adsp sub-domain
Add adsp sub-domain for nvadsp and adsp_audio drivers. This
ensures that adsp can be handled differently compared to ape.

Bug 200090996

Change-Id: Ic7222606db977c46120370ea98f665fd2ba58ecf
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/735615
(cherry picked from commit 8b5ce0eb1f754373f848892a5c23c82269e18a19)
Reviewed-on: http://git-master/r/741162
(cherry picked from commit 195dd00c017abaaa3eecc744f927ac4f9bbac1f9)
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/766593
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
163bf191d3 ASoC: tegra-alt: use snd_soc_kcontrol_codec to access codec
use snd_soc_kcontrol_codec to get access to codec instance instead of
snd_kcontrol_chip.

Change-Id: Iadad5689aed636f2f6ceed76c46e795c3054a30c
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/768400
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
e992a54385 ASoC: tegra-alt: dmic clock support
Add the clock support for direct dmic connection to device.

Bug 1582514

Change-Id: I4b2decda2821b9a1a477f5efe431936f05be8be8
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/763951
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
df11e734e5 tegra-alt: adsp: free compress buffer on stream close
Free of compress stream buffer.
Fix freeing of PCM capture buffer.

Bug 200056741

Change-Id: Ia64ba3206563f0d22f30bca1bab9349a7a5ca0dd
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/748714
(cherry picked from commit 9cc04c256d3e8b56f4264d5f246d773a3192a1ca)
Reviewed-on: http://git-master/r/751863
2022-09-29 15:30:21 +05:30
Viraj Karandikar
f412a0819f tegra-alt: use actual rate values to configure SFC
Use actual values for sample rate instead of strings/enums
when configuring SFC.

Bug 200082413
Bug 200086391
Bug 200100093

Change-Id: I736a31a9569e0353e059417f10f54e9e4efa1185
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/746656
(cherry picked from commit eb4ba049cfc2ea2fb052a9e18484d1d9b4eb329b)
Reviewed-on: http://git-master/r/751861
2022-09-29 15:30:21 +05:30
Viraj Karandikar
810f0dbe87 tegra-alt: add mixer control for SFC init
- Add mixer control for SFC init. This should be called ONLY when
there is no data flow happening through SFC.
- Use actual rates instead of indices/strings when setting rates

Bug 200082413
Bug 200086391
Bug 200100093

Change-Id: I7969f91e8371466b0e9c2dc0d4433803fb0a558c
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/746033
(cherry picked from commit c3c88d0612affa12b537233d66e480ec743001a9)
Reviewed-on: http://git-master/r/751860
2022-09-29 15:30:21 +05:30
Dara Ramesh
5765fc7e92 asoc: tegra-alt: hra usecases support
a) add sfc coeff. RAM tables for 48 to 192, 48 to 96
   sample rate.
b) add mixer control to change SFC input bit foramt.
c) add mixer control to change codec format and
   non pcm link format for HRA usecases to support.

bug 200086376

Change-Id: Id82fc6190ed5978102a3afc290e877f9a772734d
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/738977
(cherry picked from commit a970151270e1200779141464e19d8fe1ba0028d0)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/751859
2022-09-29 15:30:21 +05:30
Deepa Madiregama
60f50764c1 asoc: tegra-alt: Fix offload and capture usecase using SFC
Add soft reset support for changing the SFC params
dynamically after every stream.

Make changes in machine driver to pick the clk as
per the codec-x-rate set. Configure I2S as per the
codec-x-rate set.

SFC input rate was taken from hw_params which results
in input rate same as stream sample rate. Also the
SFC output rate is set to stream sample rate via mixer
control. This results in same input and output rates
and SFC is put into bypass mode when used in capture
stream path and no rate conversion happens. Fix this
by adding "SFCx input rate" control to allow setting
input rate different than stream rate.

Bug 200097141
Bug 200056741

Change-Id: I294c484050cfa636c8173c5837feb4461ada2ddb
Signed-off-by: Deepa Madiregama <dmadiregama@nvidia.com>
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/730685
(cherry picked from commit a2ee28c6ba423751b8bbc0743a645241391823b7)
Reviewed-on: http://git-master/r/751858
2022-09-29 15:30:21 +05:30
Manoj Gangwal
2e458c2a06 ASoC: tegra-alt: Enable coeff RAM based SFC
This change will
1) Add coeff. RAM tables for few SFC combs
2) Enable coeff. RAM based SFC for mostly used
   sample rates combinations (P0).

Bug 200090046

Change-Id: Ia3b44577103daf3f68b98e76ed63c7e264550145
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/730146
(cherry picked from commit 3cb0a34632178b518852f24adcdb51495cd85674)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/751857
2022-09-29 15:30:21 +05:30
Ravindra Lokhande
b4d16e4951 ASoC:tegra-alt: Add alsa ctls to set SFC o/p rates
This change will add the alsa controls to set
SFC i/o rates. SFC from 44.1 to 48 Khz is validated
using this change.

Find below the list of added alsa controls :-
1)"SFC# output rate"
2)"codec-x rate"

'#' = 1,2,3,4 for the respective SFC used.

Bug 200090046

Change-Id: Ibbbbcec9b52d5a36b188131fe2cd620e9f3b041f
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/729519
(cherry picked from commit f439a370832f5a8515a8be09c977082c89566111)
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/718908
2022-09-29 15:30:21 +05:30
Viraj Karandikar
c7fd07080a tegra-alt: adsp: remove broken app deinit code
Existing app deinit code is setting info and other pointers
to NULL, but not calling nvadsp_app_deinit() to close instance
on ADSP. Due to this multiple instances app get created on ADSP
and causing memory leaks.

Current usecases use static paths so app_deinit functionality
is not needed and adds overhead of freeing and allocating apps
everytime. So making tegra210_adsp_app_deinit() a empty function
for now. Proper app deinit functionality will be added in future
if needed.

Bug 200106688

Change-Id: I2b57efa6fa57253ee249c3dc3c43b5843109e2ae
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/744945
(cherry picked from commit ad17bed71e23a978202de7f7a695a4c4cede5dc7)
Reviewed-on: http://git-master/r/747320
2022-09-29 15:30:21 +05:30
Viraj Karandikar
4898d2f0c1 tegra-alt: add controls for setting AMX byte map
Add controls for dynamically configuring AMX byte map.
Fix bug with byte mask update.

Bug 200100724

Change-Id: Ia3bfc263b025d391548959f4006d18bf18726968
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/744339
(cherry picked from commit 7271587d028dd9e8d3b8762776cba42220becdbc)
Reviewed-on: http://git-master/r/747321
2022-09-29 15:30:21 +05:30
Viraj Karandikar
1a83c79388 tegra-alt: adsp: get/put from compress open/free
During device switch, runtime count becomes zero and
runtime_suspend gets called which suspends ADSP OS.
ADSP OS is resume immediately when resuming playback
on new device. ADSP OS suspend/resume can happen while
ADMA is running, which disturbs SW/HW sync causing
noisy output.

Prevent ADSP OS suspend as long as compress stream
is open by acquiring a runtime get() from stream open
and releasing it in stream free.

Bug 200100093

Change-Id: Id0da81c16efa3682131e98f6132aa02c8e7cfcab
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/742105
(cherry picked from commit 6f11140bb41166a9797b2d7fe3bfb1610b55b513)
Reviewed-on: http://git-master/r/747319
2022-09-29 15:30:21 +05:30
Sumit Singh
a04f788834 ASoC: tegra-alt: Read pwrgate partition-id from DT for T210
Make modifications, so that powergate partition-id for APE
is always read from device tree.

Bug 200105664

Change-Id: I10d3632a4bdaf2b37690f19be82c5431c0c71c7c
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/730743
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/763551
GVS: Gerrit_Virtual_Submit
2022-09-29 15:30:21 +05:30
Gaurav Tendolkar
3afd0a2243 ASoC: tegra-alt: Create p2382ref machine driver
- Added machine driver for board p2382ref
- Removed board specific checks from machine driver

Bug 200113249

Change-Id: I03eced9f30b5a642b71cb8d6a0e4d332cb005f64
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/763461
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Junghyun Kim
ee8192fe65 ASoC: tegra-alt: Update codec drivers
1. Remove replicate bit and add fifo_size_downshift bit
   in cif
2. Update mask value for dma_fifo_size, dma_fifo_start_addr
   and dma_fifo_threshold in admaif driver
3. Update the copyright
4. Add run time check function to detect FPGA

Bug 1582514
Bug 1582510

Change-Id: I40a8172ebc3713ead4cb5764f291f04d548c7a75
Signed-off-by: Junghyun Kim <juskim@nvidia.com>
Reviewed-on: http://git-master/r/751602
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Mohan Kumar
529ec76bea asoc: tegra-alt: add spdif prod support
Add the driver changes for  spdif prod settings
through device tree.

bug 200090129

Change-Id: Icfd83f86b3825cbe12bfcc5876182398875938e8
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/741592
(cherry picked from commit f783020c00b263a61a99b03b0139dc0d8cdac1fc)
Reviewed-on: http://git-master/r/758364
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Daniel Fu <danifu@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
4aff5a0e14 tegra-alt: adsp: fix crash in apm_get/apm_put
Change merged from Kernel 3.10 is not
compatible with Kernel 3.18.

Make changes as per kernel 3.18 to fix the
crash.

Bug 1653770

Change-Id: I8b9e416f9dd4a905a465f6bd06732a2ec782995a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/755197
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
0b3f6dae2b tegra-alt: adsp: ignore app load failure during init
Error in app loading skips loading of other apps and
disables further use of ADSP. This prevents use of
other successfully loaded apps which could have worked
fine.

Avoid skipping of remaining apps when loading fails for
one app. Failed app will anyway throw error whenever
user attempts to use it. This also allows adding entries
for optional apps.

Check if app was loaded when calling app_init().

Bug 200100724

Change-Id: I70a818df6fdeb54f94700e6c5f10a1dd1b269b72
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/736736
(cherry picked from commit 5387c9989420525b6ce7eaafd2ddb913f496740d)
Reviewed-on: http://git-master/r/740608
Reviewed-on: http://git-master/r/750726
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
a4fc4a6c3b tegra-alt: adsp: fix condition in admaif params
Capture using last ADMA plugin was failing due to incorrect
condition in for loop. Fix it by changing condition.

Increase max number of ADSP ADMA plugins to 10 to support
additional use cases.

Bug 200056741

Change-Id: Ifbc45ee2ad8093f67d357543fa2ffe3597cf77e8
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/735456
(cherry picked from commit d233ba3302b9cda9f8d5e7ef57d005a646c7047c)
Reviewed-on: http://git-master/r/740607
Reviewed-on: http://git-master/r/750725
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
57d003c3ef Revert "tegra-alt: adsp: add runtime suspend delay"
This reverts commit e88ffa5fc211e68b888027ede341e264717a57d6.

If system is suspended before autosuspend time expires,
runtime_suspend does not get called and ADSP does not get
suspended. This breaks audio playback after resume due to
incorrect state of ADSP after system resume.

Originally autosuspend delay was added to avoid frequent
OS suspend and resume. No functionality issues were/are
seen even without autosuspend delay. So removing
autosuspend delay to avoid this issue.

Remove unnecessary debug print.

Bug 200090996

Change-Id: I9bfb5056e74690cf29a56273a825705cbecc0ac1
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/731620
(cherry picked from commit 53d141ffa25c4e89625bfef8d299da452d8859a4)
Reviewed-on: http://git-master/r/740606
Reviewed-on: http://git-master/r/750724
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
8ccccf865d tegra-alt: adsp: add control to set APM priority
Add control to set APM priority.
Do not hold plugin connect messages.

Bug 200093193

Change-Id: I359566585a3e07d715bf044d6aaad954cf398a5b
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/723648
(cherry picked from commit 777b03337100d366c4467cbf2d2b0b3ef1f90797)
Reviewed-on: http://git-master/r/740602
Reviewed-on: http://git-master/r/750723
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
9b6c02f70f tegra-alt: adsp: add runtime suspend delay
Add autosuspend delay to avoid freuquent suspend/resume
of ADSP OS. Remove redundant PM_SLEEP ops.

Bug 200087374

Change-Id: I0164f8b890b7edf0fb882706a8ada2fab121e280
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/720996
(cherry picked from commit e88ffa5fc211e68b888027ede341e264717a57d6)
Reviewed-on: http://git-master/r/740601
Reviewed-on: http://git-master/r/750722
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
44e11500e3 asoc: tegra-alt: adsp: add pm runtime callbacks
Add pm runtime callbacks for ADSP OS start/suspend.
Stop ADSP OS if app load fails.

Call to runtime_suspend after stream stop doesn't happen
when audio adsp driver is under APE PD because ADSP os
driver holds APE PD count during nvadsp_os_start() which
prevents APE PD from calling suspend. So do not add audio
driver to APE PD.

Add validity check for prtd in message handler.

Bug 200087374

Change-Id: Ie813e834f4f71fee5bbd4699cbc887e6fe8397f8
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/720215
(cherry picked from commit f49832b8b51b657dc4e3367268788641a9ed4892)
Reviewed-on: http://git-master/r/715488
Reviewed-on: http://git-master/r/750721
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Viraj Karandikar
8bc369d475 tegra-alt: mixer: add control for instant volume
Add control for setting volume instantly without ramp.

Bug 1626776

Change-Id: Ief8c31ce5c537381496e85b585020291d1e1b470
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/739519
(cherry picked from commit f4b25e4114839ddded939cf838ca00902f05c23a)
Reviewed-on: http://git-master/r/740611
Reviewed-on: http://git-master/r/750719
Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
20605880fa ASoC: tegra: Add one more ADSP PCM device
Conditional build. Added only for embedded
platform

Bug 1608299

Change-Id: I602add4be5d4b0c0515044f9aca60c8a1342550a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/742368
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30
Uday Gupta
d07e72bb9f ASoC: tegra: Enable AD1937 I2C based codec
1. Enable AD1937 I2C based codec by selecting
   SND_SOC_AD193X_I2C for T210 embedded build
2. Miscellaneous fixes in driver as per K3.18
   guidelines

Change-Id: I7a1442304909a9778e96d4545b2b3eee8565c14a
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/740246
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arun Shamanna Lakshmi <aruns@nvidia.com>
2022-09-29 15:30:21 +05:30