Removes machine driver specific dependency
for having configs for each platform. Instead
this should be done from device tree.
Change-Id: I6d8ac10dc2d2e25b4882a5e6b163a1d8f042d4fb
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: http://git-master/r/932743
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
Move register store/restore from pm API's to
runtime API's for platforms, with CONFIG_PM_SLEEP
not enabled, to work.
Bug 200166409
Change-Id: Ifcdd78206b3ac59edc8ba1279316cfa8c87e7204
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: http://git-master/r/932101
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Pai <npai@nvidia.com>
add check for context pointer before accessing it in suspend.
Also move setting of driver data at the end of probe function.
Change-Id: I5724ee810dd3ca409412aa21d61d35519b1432a3
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/921743
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Fix the error check in function tegra210_adsp_app_init(), as return value
is from ERR_PTR this needs to be checked with IS_ERR macro.
Bug 200154983
Change-Id: I951cccf6a65bdfd829da1bd79e2622a40ecf30cd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/926309
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
- added mixer contols to set curve type,
cif channels and number of bits.
- modified volume control to increase/decrease
volume by 1dB for every step (for linear curve)
- changed default curve type to linear
- fixed check on number of channels
Bug 1694107
Change-Id: Ibad07ff2f61fef73e84f5193991b092afaf8db8c
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/828227
Reviewed-on: http://git-master/r/834971
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Add controls for configuring CIF channels for AMX and ADMAIF.
Add controls for CIF stereo/mono conversion for SFC.
Remove non-zero check in put_byte_map() to update byte mask.
Due to this check, byte 0 map wasn't getting updated for valid
value of 0.
Bug 200100724
Change-Id: I37b96594464f699db93552f5c1e148c51e963c5e
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/760115
(cherry picked from commit 8c2d36d0303aac45553cc64c148d8c62a8bcf880)
Reviewed-on: http://git-master/r/772770
(cherry picked from commit d17f88c03e55d8f0a250cd013b7d18a27c0d789c)
Reviewed-on: http://git-master/r/781739
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
- 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
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
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
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
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