Update all Kconfig files and Makefiles to rely on the kernel overlay
feature. In particular, don't include any Kconfig files or Makefiles
from other overlays. -I directives in CFLAGS are not yet cleaned up.
Bug 1978395
Change-Id: I425d37d55f8ea61fb3a082a1504f994ff30cec03
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1561187
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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>
Because of the way in which Makefile is defined for the drivers,
each driver file is getting compliled as separate *.ko module.
This results in loading of all the *.ko modules for maintaining
the functionality.
Current patch re-organises makefile and thus terga-alt structure,
- utils/ : will provide all the helper functions,
- machine_drivers/ : lists all the machine specific drivers we have,
- tegra-alt/*.c : ahub module drivers, each would have a separate
driver module,
- include/ : all the local header files needed for driver modules
Bug 200346429
Change-Id: Ic659879a0d6e8ef48b0d79b81059fba4c069591e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1559745
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Version check is not required since 'struct component_driver' is
available on both kernel-4.4 and kernel-4.9. These checks are
earlier removed from t21x based module drivers. The same is done
now for t18x specific drivers.
Bug 200346429
Change-Id: Ie59600ed8fe4b6878ece58a055da522ce308300d
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1573625
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
The 'normal' polarity of the fsync is dependent on the audio format.
For example, for I2S the 'normal' polarity for the fsync is
falling-edge/low, where as for r/l-justified or dsp modes A/B it is
rising-edge/high. This is detailed in the Tegra210 TRM in the table
titled "Programming I2S to Operate in Various Modes" and also in
the Linux kernel header file for include/sound/soc-dai.h.
The Tegra210 i2s driver always assumes that the fsync is low for
'normal' polarity and high for 'inverted' polarity and does not
account for the audio format. Correct the Tegra210 I2S driver to
set the polarity according the the audio format.
Bug 1788838
Bug 1993738
Change-Id: I5c7395f225ff8c25e2bb277c35e3ecb7a86f36cb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1567742
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
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>
xbar driver code is maintained separately for t210 and t186.
There are separate driver modules loaded for t210 and t186
platforms. The difference between two drivers is mostly some
soc specific data and structures. This patch merges both the
drivers. Going forward there will be one xbar module, but at
the moment duplicate copy of xbar driver with t186 name is
kept to maintain audio sanity.
Bug 200346429
Change-Id: Ic10ac7f2aca9a0da5caa0683bb7bdb51f14117a8
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1567256
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
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>
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>
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>
This patch fixes compile errors for kernel 4.9. 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: I32d0d6d5d2cb79a3af27b81786d4e288d1be4d2d
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
(cherry picked from commit 9528e52063467df94bc37fe2ad10d74a1c573848)
Reviewed-on: https://git-master.nvidia.com/r/1533079
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
tegra-alt drivers are intended to be moved to common nvidia
repo. This patch combines the Makefile and Kconfig and also
puts conditional complilation for kernel-4.9, since for audio
the merge can be possible only when kernel-4.4 and kernel-4.9
are unified.
for kernel-4.4, all tegra-alt code is built from nvidia/
for kernel-4.9, t18x specific code is built from nvidia/ and
other drivers are built from kernel-4.9/
Bug 200325738
Change-Id: Id9d1cc9b129f61dc4b52d2e3c5466ec94415517c
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1529135
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1488953
(cherry picked from commit 610f30df70a790733ed25a1be250e08cce19f368)
Change-Id: Ia0893c8373721ed16787a6c8243dca49f9672d34
Reviewed-on: https://git-master/r/1509428
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1487805
(cherry picked from commit 60de6c68787ac100773a9f300d665266db25907c)
Change-Id: I67d429e779e84ad4c1978303ad08c4b89b95fb69
Reviewed-on: https://git-master/r/1509427
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Following updates:
- "input bit format" ctl to set RX CIF bit-width
- 100x scaling to "Vol" ctl for more granularity
- Fixes in mixer ctl "get" functions so that current value is read
- Fix in "Curve Type" ctl so that default volume gets set
Bug 1936284
Change-Id: Ib54b17266c7c3a3e9e42cab13195389c5fa1fbe7
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: http://git-master/r/1497628
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
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
- 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: Ia03e035569375f37ae4b0faa1a4593ce121d2354
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1475208
(cherry picked from commit 3361e95850563f3009a428bb1c01941ed069a7b0)
Reviewed-on: http://git-master/r/1492664
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
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
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>
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>
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>
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>
SND_SOC_TEGRA210_ADSP_ALT depends on TEGRA_NVADSP so add condition
while selecting it.
As per Documentation/kbuild/kconfig-language.txt
select should be used with care. select will force a symbol to a
value without visiting the dependencies. By abusing select you are
able to select a symbol FOO even if FOO depends on BAR that is not
set.
Change-Id: Icb3824b93c4557ab730a06692b20c4e02784382e
Signed-off-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-on: http://git-master/r/1326953
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
All chip ADMAIF header files are combined into one.
Modified the souce code to support all chipsets via
separate platform data structures. Chip specific parameters
are populated in the structure to beused at runtime.
Bug 200257345
Change-Id: Ib605e32e73ecc46e0a20ec4061149431035705e1
Signed-off-by: Sharad Gupta <sharadg@nvidia.com>
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: http://git-master/r/1262332
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
T210 and T186 ADMAIF header files are combined into one.
Modified the souce code to support T186 and T210 chipsets via
separate platform data structures. Chip specific parameters
are populated in the structure to beused at runtime.
Bug 200257345
Change-Id: If05ad85e96aec177310491616d082b50b7454331
Signed-off-by: Sharad Gupta <sharadg@nvidia.com>
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1266357
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>