pcm_hw_params() and compr_set_params() functions set "is_playback" flag to
true for SNDRV_PCM_STREAM_PLAYBACK and SND_COMPRESS_PLAYBACK respectively.
The flag is then passed to tegra_machine_dai_init() function. However this
flag is not used by DAI init function and appears to be redundant.
Hence this patch removes is_playback argument from DAI init function and
cleans up pcm_hw_params() and compr_set_params() functions.
Bug 200516191
Bug 200503387
Change-Id: I759181a53fa2e599ca338b4004451183813a5fc5
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2172229
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
commit b4bc1cf56020("ASoC: tegra-alt: Avoid reg access after shutdown")
avoided device register access after shutdown() has been called. This
otherwise resulted in occasional SError and resulted in crash. The reason
for this was runtime PM does not work after shutdown and it was seen on
vK4.4
Looks like the issue has been fixed from vK4.5 onwards, where PM domain
detach is avoided during shutdown. Following is the upstream commmit.
"platform: Do not detach from PM domains on shutdown"
Bug 200503387
Change-Id: I5f3d18f05e434d5a1ed5b597362a39ec9a9f010b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161809
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Highlights from current clock handling in machine driver(L4T/Android)
* Tegra210 and Tegra186/194 have different approaches to update clock
rates for pll_a, pll_a_out0, mclk and ahub.
-> Tegra210 uses static method, where base pll_a rate is hardcoded
in the driver.
-> Tegra186/194 use DT driven approach, where sound node passes rates
for above clocks. Two sets of rates are passed, one to support odd
sample rates and one for even.
* Some of the functions from tegra_asoc_utils_alt.c are unused
* clock names are not really generic.
This patch has following updates.
* Unify clock update approach. Use static array for base pll rates.
This also helps to get rid of following sound node DT properties.
"nvidia,num-rates"
"nvidia,clk-rates"
* Remove below unused functions.
tegra_alt_asoc_utils_lock_clk_rate()
tegra_alt_asoc_utils_register_ctls()
tegra_alt_asoc_utils_tristate_dap()
* clk_set_parent() functions are not needed. Instead the relationship
can be set from DT through "assigned-clocks" binding.
* update clock handle names to be more meaningful. However, clock names
that are parsed in devm_clk_get() are not changed because these names
are used in Automotive DT files under "sound_ref" node. Scope of
current patch is limited to L4T/Android drivers and DT files.
Bug 200503387
Bug 200516191
Change-Id: Ideaf150e6e200ffbba4dcbdec4c49f1127ea25db
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2164482
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
tegra_machine_sfc_init() is used to initialize input and output rates
for SFC module. In fact, this is done for only SFC1 instance. Machine
driver does this setup by calling snd_soc_dai_set_sysclk() for input
and output. SFC driver has a callback function implemented to take
care of this.
Above is not really required. By default srate_in and srate_out have
value 0 and hence SFC would operate in bypass mode. Already mixer
controls are exposed from the driver to set SFC input and output sample
rates and the same should be used for the required rate conversions.
Thus this patch removes following functions,
* tegra_machine_sfc_init() from machine driver
* tegra210_sfc_set_dai_sysclk() from SFC driver
Bug 200503387
Change-Id: Iada1b4748413debd0eb7d7f9a951069bda15af22
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165143
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
kzalloc() can be failed under low memory condition. In such a case, the
following memcpy() can cause a panic. Thus, the return value of
kzalloc() should be checked. If tegra_machine_get_dai_link_t18x() is
called, the return value should also be checked.
Bug 2647682
Change-Id: Ia200436a3b1877933932b9a086862f5507c8da54
Signed-off-by: Kwangwoo Lee <kwangwool@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2159959
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Machine driver has moved to newer versions of dai-link helpers. Unused
older functions now can be removed to simplify the code. Hence following
are removed.
* dai_link_setup()
* removed following callback functions from soc_data.
(*get_dai_link)()
(*get_codec_conf)()
(*append_dai_link)()
(*append_codec_conf)()
* Machine driver probe() is cleaned up
Bug 200516191
Bug 200503387
Change-Id: Ia4e636f97e94cec51cd3b67ce27f1bec16caab09
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2151461
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
With this patch tegra_machine_driver_mobile.c uses newly exposed helper
for dai link setup, add_dai_links(). The soc_data is populated with dai
link and codec conf members to take care of t21x and t18x platforms.
Older function, dai_link_setup(), is marked as __maybe_unused. This will
be removed in subsequent patches in the series.
Bug 200516191
Bug 200503387
Change-Id: If7ae36acc932cc8c146d59c03fd3ab6732c7ff35
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2151460
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Idea is to expose dai links or codec confs via members of machine driver
structure. The 'struct tegra_asoc' is used to group dai link related
members, which would be included in the 'struct tegra_machine'. This helps
to simplify the code like mentioned below.
* no need of having t21x or t18x specific helper functions
* no need of having global variables. Currently we use few global members
for t21x.
* currently we have separate helpers to first pass DT dai-links and then
append with the dai-links defined in machine-alt utility code. In the
current patch new helper{tegra_asoc_populate_dai_links()} combines both
of the operations. The same is true for codec conf helpers as well and
tegra_asoc_populate_codec_confs() alone is sufficient.
* machine driver codec_init() and set_dai_ops() for easy reading.
In summary,
tegra_asoc_populate_dai_links() combines following.
* tegra_machine_new_codec_links()
* tegra_machine_append_dai_link()
* tegra_machine_append_dai_link_t18x()
tegra_asoc_populate_codec_confs() combines following.
* tegra_machine_new_codec_conf()
* tegra_machine_append_codec_conf()
* tegra_machine_append_codec_conf_t18x()
machine->asoc->dai_links/codec_confs replaces below helpers.
* tegra_machine_get_dai_link()
* tegra_machine_get_dai_link_t18x()
* tegra_machine_get_codec_dai_link_idx_t18x()
* tegra_machine_get_codec_conf()
* tegra_machine_get_codec_conf_t18x()
Machine driver(tegra_machine_driver_mobile.c) exposes add_dai_links()
helper to setup dai links. This will be used in the subsequent patches in
the series. Few structures are moved to machine-alt header files for reuse
if needed by other machine drivers. Also release_asoc_phandles() is exposed
to balance refcounts, during error paths, by calling of_node_put() for DAI
links and codec conf.
Bug 200503387
Bug 200516191
Change-Id: I39c888068b8a1e8e0b1ca277270e9dd84044b150
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2151459
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The MIXER1-7 dai uses RX6 as codec dai which is wrong as it has
to use RX7, due to this RX7 path was never been used for t18x
and t19x platforms. Fix this issue by using RX7 as the codec
dai.
Bug 200534612
Change-Id: Ia0ad7ddf518ae4b113e2a0b095c3ee3893697064
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2155817
(cherry picked from commit f1890d288f2167055e3f32ef9ca61539c73a6c20)
Reviewed-on: https://git-master.nvidia.com/r/2158792
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Dynamic pinmux support through DT entries are no longer
supported for audio. This will make the pinctrl handling
in the audio drivers redundant and can be removed to be
inline with the policy followed for dynamic pinmux.
Bug 200533287
Change-Id: I37f958ab50afa88377ae4d6c50941241326dbbd3
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2151022
(cherry picked from commit 1b68ce5a60ae93de6f65d965570f091a7c10ac31)
Reviewed-on: https://git-master.nvidia.com/r/2153101
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Cleanup probe() functions for AHUB module drivers and following is the
summary of changes. This helps later in upstream too.
* avoid unnecessary goto labels by updating return paths
* removed following unused header files wherever applicable.
linux/pinctrl/consumer.h
linux/version.h
linux/debugfs.h
linux/slab.h
* redundant pm_runtime_get/put removed in tegra186_xbar_registration()
* Redundant error print during memory allocation failure is removed
* runtime PM is enabled as late as possible and before the codec
registration is done.
* explicit calls to runtime_resume/suspend is avoided in probe(). For
upstream, PM is enforced and the same can be done in downstream too.
Hence no need to handle !PM case in driver probe()
Ref: http://patchwork.ozlabs.org/patch/1048746/
* IS_ERR() check is sufficient for error handling in case of
devm_clk_get().
Bug 200520821
Bug 200503387
Change-Id: Ie4192036e72db161fa7d8ff4c6c0b28c17635793
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2153956
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Currently drivers for resource ioremap does following explicit operations.
* error check for platform_get_resource()
* call devm_request_mem_region()
* call devm_ioremap()
Instead of above explicit calls, devm_ioremap_resource() function can be
used, which covers all of the above. As per this scheme all drivers are
updated for memory region request and ioremapping.
Bug 200503387
Change-Id: I7b8df29742e8236d315369ef76aa57d47f47aac7
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2152456
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
DMIC controller can be configured to receive data in both left and right
channels or in just the left channel or the right channel. Currently we
have dmic->ch_select to configure the same. There are few issues w.r.t
the way this is used.
* dmic->ch_select overrides both client and audio channels of TX CIF.
* channels in params_channels(params) is not used and hence requested
number of channels in hw_param() callback is not considered.
* stereo to mono conversion at TX CIF is not supported
This patch addresses all above issues with following
* expose a mixer control, "Channel Select", for channel override for
CIF channels.
* dmic->ch_select is only used to override client channels.
* by default ch_select is set to stereo and "None" option is removed
* expose mixer control, "stereo to mono", for stere->mono conversion
This can be used to select one of the following methods for conversion
CH0 --> pick the first channel
CH1 --> pick the second channel
AVG --> (CH0 + CH1) / 2
* "None" is not required for mono->stereo and hence removed and only
below are sufficient.
ZERO --> zero out the second channel
COPY --> copy the first channel to the second channel
* Replaced "TX" prefix for mixer controls with "Capture". This aligns
with the policy we used for ADMAIF and I2S.
* "Channel Select" control is replaced with "Controller Channel Select",
as the control is related to DMIC controller and will be more
meaningful.
Bug 200520821
Bug 200503387
Change-Id: I8a103f67dc75ca651ee3df3d8594971327364c84
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2151729
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Device-tree for all Tegra platforms has been updated to only populate
the link-name 'rt565x-playback' if the RT5658 codec is present. Note
that this is handled by the plug-in manager. Therefore, we no longer
need the additional test in the Tegra machine driver and we can
completely remove the variable 'is_hs_supported'.
Bug 200503387
Change-Id: I6070032f1d2f8d12245b1a2de5abcf60e97ec884
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2147460
(cherry picked from commit e987036cccf5a0a735bf3bc8e2c7147c89318cfa)
Reviewed-on: https://git-master.nvidia.com/r/2153227
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Currently machine driver provides a mixer control to override BCLK ratio.
This override is global and the ratio is updated for all dai links. Thus it
limits the simultaneous usage of I2S instances for multiple BCLK ratios.
To overcome above limitation this patch does following,
* Move BCLK override to I2S driver by exposing a mixer control. This
provides flexibility in modifying the ratio for test or debug purposes.
* Since BCLK ratio is used only by I2S, a DT entry for it is more suitable
in I2S device node. Hence add parsing logic for property "bclk-ratio".
Subsequently DT patches would be pushed.
* Finally remove BCLK related code from machine driver. The helper APIs
tegra_machine_get_bclk_ratio() and tegra_machine_get_bclk_ratio_t18x()
cannot be removed completely, since other machine drivers use this.
Hence the references are not removed.
Bug 200503387
Bug 200516191
Change-Id: I96ba9b4b1ebe7913bb637ed7abd534b724ecec15
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2147207
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
snd_soc_dai_ops has a callback function pointer to set bclk ratio.
For DMIC, DSPK and SPDIF drivers though the callback is implemented
but looks redundant. Such callbacks are removed from the driver
and a NULL check for set_bclk_ratio function ptr is added in machine
driver.
Bug 200503387
Bug 200520821
Change-Id: Ia3b96d0e0f4789f8bc54960b3a7ebaf482da1434
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2144430
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Current patch includes following,
* update clk_pll_a_out0 with generic clk_parent name
* commit 0d63fa3078d7 ("ASoc: tegra-alt: support dmic parent rate control")
introduced setting of parent clk rate. This was specifically added for
Mystique platform and used only on Tegra194. Removed this as Mystique is
dropped and further helps to align for upstreaming.
Bug 200520821
Bug 200503387
Change-Id: I6389199e5a3398e996f215f176934a79370b879a
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2144218
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
- Make the primary dais to be in sync with other ahub drivers
by renaming it to DAP/CIF, this would remove the dependency on
the link name dspk-playback-l/r for dspk and can use any generic
name.
- The second dais which was used for dual mono codec path can
avoid using the dai_ops callback, as there is no need of calling
hw_params, set_bclk etc.. multiple times per pcm_open. Only the
primary dai with name DAP will be used for callbacks.
- Support S32_LE format support for the dais.
- Change SND_SOC_DAPM_AIF_IN to SND_SOC_DAPM_AIF_OUT as the dspk is
audio output interface.
- Add proper DAPM route entry to machine driver and remove any check
with dspk-playback-l to make it more generic usage.
- Cleanup aud_mclk parent configuration
Bug 200525217
Change-Id: I3a718f72ea0b442a7cf1716540e79d69a05a220a
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133518
(cherry picked from commit a3233ef7bc78953a264c2729ace9ea0a0da59814)
Reviewed-on: https://git-master.nvidia.com/r/2145942
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This patch includes following,
* remove unused macros and header files
* update macros to respect 80 characters per line
* OSR related macros moved to enum
* other minor changes related to alignment
Bug 200520821
Bug 200503387
Change-Id: I3d8006e3369709338806314e706d47dbe3896ea4
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2144217
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
snd_soc_codec_driver probe() callback for most of the drivers appear to be
redundant, as only some member initialization is done. The same can be done
in platform_driver probe(). Hence codec_probe is removed from drivers
except OPE driver, where peq and mbdrc initialization is done.
Bug 200503387
Bug 200520821
Change-Id: Icd03df1d65d61388bf563468eb86bc134701479f
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2144216
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Renamed i2s clock parent's property name in DT and changed this driver
to reflect the same. Sync related clock usage is broken as of now. So DTs
have removed sync related entries. Modified driver code to not result in
error due to absence of sync clocks
Bug 200515690
Change-Id: Ifa32dc35b7fbda23574a576597c9cc9e79b00ada
Signed-off-by: Asha T <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2137230
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
As part of support to Mystique platform DMIC enable/disable and a callback
helpers were provided (bug 200404157 and bug 200391366). Following commits
were pushed related to this.
commit b48f5902966a ("ASoC: tegra_alt: add DMIC enable/disable functions")
commit aac60cf54481 ("tegra-alt: dmic: add start callback support")
This patch removes references to above for following reasons,
* Mystqiue support is dropped
* Cleanup is required as part of DMIC upstream work
Bug 200520821
Bug 200503387
Change-Id: I626f65b06fce0d1cec916eb8d4a495d864256f62
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2143613
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Some of the macros defined in tegra210_xbar_alt.h are not used anywhere,
hence removed such macros. Also fixed lines to respect 80 character limit
per line.
Bug 200503387
Change-Id: Ieeb32ef62180fc6ae41e978ac54fb89d44a2486a
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2143068
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The PCM open flags may be changed on the fly with ALSA calls like
snd_pcm_nonblock which only change the flags associated with file
descriptor and not the substream. Hence checking the flags before
wake_up may not be correct and leads to problem where processes may
remain blocked on path disconnect. Removing the check solves the problem.
Bug 2603764
Change-Id: I4abaa5448e4bfbdd304b80d02314ca48b26fa955
Signed-off-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2126458
(cherry picked from commit 323eeb48634b9f6da890ce3a25fe616b9695d17d)
Reviewed-on: https://git-master.nvidia.com/r/2142901
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hariharan Sivaraman <hariharans@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>
OPE driver has soc_data structure to populate function pointers for PEQ
and MBDRC modules. Instead of using soc_data, the functionality can be
replicated with direct calls to the required helper functions. This in
turn helps to cleanup and remove soc_data code from the driver.
Bug 200503387
Change-Id: Ib37c33edb79a523f2d42f4cb4991c948c6303ddf
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2140591
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Some of the AHUB module drivers have soc_data information only
to define a function pointer for calling tegra210_xbar_set_cif().
This function is implemented in xbar utils driver and exported.
This patch removes function pointer reference to above and instead
make calls directly. This helps to cleanup soc_data for all modules
and further for few modules soc_data is completely removed.
Bug 200503387
Change-Id: If919e5f7a7a92351940bf46f7302fd40c76c7ea3
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2140228
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Separate compatible is not needed for Tegra186/Tegra194 i2s devices since
i2s_soc_data is now removed and they can rely on "nvidia,tegra210-i2s"
compatible property which is used by Tegra210 as well. The same needs to
be reflected in device tree too.
tegra210_xbar_auxdata is updated with regards to above, along with this
device names for i2s is updated in tegra186_xbar_codec_conf structure.
Bug 200503387
Change-Id: I2f6171d3df04b91cbfbaab6d8c0784ddcd529589
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2132447
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
When configuring the I2S DAI format, setting the loopback mode and
setting the frame-sync width the I2S driver unnecessarily resumes the
I2S controller to update the registers. This is not necessary because
the driver uses regmap and so if the device is disabled, the regmap
will not update the actual registers until the I2S controller is
resumed.
Furthermore, it was observed that when the I2S controller DAI format
is set, by resuming the I2S controller momentarily, this causes some
of the I2S pins (SCLK and FS) to toggle. Although this is probably
harmless, it is better to only resume the I2S controller when it is
actually being used.
Bug 2414131
Change-Id: I9989deed67db83e6b23d278ba3a130a8661d722a
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2128015
(cherry picked from commit d8378bd21c39290072ad5d1e862d5386b2529a9f)
Reviewed-on: https://git-master.nvidia.com/r/2133385
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
soc_data structure for i2s appears to be redundant for following reasons.
* is_soc_t210 is unused. For older kernels this was added to implement
MBIST WAR, bug 200035860. WAR is not required for kernel > k4.4 and
hence cleaned up as part of bug 2485656.
* set_audio_cif and set_slot_ctrl point to the same functions for
Tegra210 and Tegra186. Thus there is no need to have soc_data members
for it.
Hence references to soc_data is removed from the i2s driver.
Bug 200503387
Change-Id: I597bd594da70f2d27d9c330b871d26cf3651f7af
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2132446
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Currently during fe playback path disconnect,
processes using snd_pcm_write times out after 10 seconds
while those using MMAP simply remain blocked. Fixing
issue by
- Set runtime state to SNDRV_PCM_STATE_DISCONNECTED
- Wakeup process blocked in poll() for mmap mode
- Wakeup process blocked on snd_pcm_write for normal mode.
Bug 2459153
Change-Id: Ieef6802e2ca19321c7ba061bfa7d2cbaaca4cc2c
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975073
(cherry picked from commit 1c976b1de54ffe4b7d603a5ad7c8b6765a2ac8d5)
Reviewed-on: https://git-master.nvidia.com/r/2126290
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Tested-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
During pcm_open for ADSP pcm devices, the buffer allocated
is not constrained to be multiple of 4. This results in
the apm_process being called continuously for this APM since
data is available. However ADMA is not started because of
the size mismatch. Setting constraint of period and buffer size
(in frames) to be multiple of 4 fixes these issues
Bug 2599016
Change-Id: Idaabba29142d9577a4dc72d97aa6bb3cd4f791de
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2122112
(cherry picked from commit 82d702154bf2c1a903f32e50a9bc4afdf271d74f)
Reviewed-on: https://git-master.nvidia.com/r/2124176
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
If the pinctrl node is not present in device-tree for the DMIC, DSPK
or I2S, then the pinctrl states will not be initialised during device
probe. This can cause the kernel to crash by attempting to dereference
a NULL pointer when setting the pinctrl state. Fix this by verifying
that the pinctrl state is not an error pointer or NULL before attempting
to use it.
Bug 1665446
Change-Id: I917141325f12bbf87371eb59a320fe08e65f0934
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2120320
(cherry picked from commit f3aa620e26af45a6bafe5acb65f2b06df0b877e8)
Reviewed-on: https://git-master.nvidia.com/r/2122730
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Late system sleep callbacks just invoke runtime PM calls if the device
is not in the desired state. There is no need to have separate APIs for
this, instead it can directly rely on pm_runtime_force_suspend/resume()
APIs to achieve similar behavior.
Another reason for this patch is, currently ACONNECT driver is using
pm_runtime_force_*() to indirectly invoke runtime PM callbacks. Runtime
suspend of ACONNECT fails complaining that there is an active child.
Though all XBAR devices are runtime suspended, the runtime PM state of
the corresponding device does not reflect it. Hence there is an error
in __pm_runtime_set_status() for ACONNECT. This is seen when the audio
playback is active and system tries to enter suspend. On system resume,
audio fails to resume playback and kernel panic is seen. Hence current
patch moves to pm_runtime_force_*() calls for system sleep for all XBAR
devices.
Bug 200509219
Bug 200503387
Change-Id: I5d531b0aa1a347686f7cca21fc40fe926b34f3a5
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093331
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The admaif cif conversion from mono to stereo and vise-versa config
will take effect only when client/xbar channels are 1/2 or 2/1. If
this condition doesn't satisfy, the configured bit-field for mono_conv
and stereo_conv in cif ctrl register will not take effect.
Considering this the current code needs to be fixed.
- For Playback path:
The Client and Audio channels won't be different as the data flows
from external memory to ahub. So override channel control have no say
on this path, for client_channel=1 and if "mono to stereo conv" control
was set then override audio_channel=2 for stereo conversion.
- For Capture path:
The Client channel will be based on params_channels() and the xbar
channels can be different from client channel as it comes from other
ahub modules which can output different channel number compared to
client, So the "ADMAIFx Channel" wil be used for capture path to feed
proper xbar channel available. During stereo to mono conversion i.e
when audio_channel=2 and client_channel=1, the configuration in the
bitfield mono_conv will take effect.
Bug 200500656
Change-Id: Ie61aed848eb35715414a7d8f0e00eae9066b32d3
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2080175
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The regmap read, write and volatile callback functions are not
handling the register address checks correctly. Due to this the
regmap dump from sysfs node was not reflecting the correct state
of the register values. Fix the issue and makesure all regmap
register values are reflecting proper values.
Bug 200500656
Change-Id: Ifb5827d1b86384f835c010138275121a87a397ba
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2080753
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The ADSP OS needs to be stopped during the flow of shutdown callback
of the system. Keeping the ADSP OS booted and in suspend mode during
the shutdown callback resulting in mc_err.
Bug 200499707
Change-Id: I80d0c7096b71e953143f70667cec936e6b787db8
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2076325
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The function rt565x_manage_codec_sysclk() only exists in the downstream
kernel and is only currently used for the audio supermodule. It is not
necessary to port this function to the upstream kernel because we can
simply implement the same functionality within the machine driver by
calling the snd_soc_dai_set_pll() and snd_soc_dai_set_sysclk() APIs.
Therefore, update the Tegra machine to avoid using the function
rt565x_manage_codec_sysclk() so we can remove from downstream.
Bug 1665446
Change-Id: Id7e941368740f28cb74e6a04556e7b00abae119d
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2073779
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Trivial clean-up to the tegra_alt_asoc_utils_init() function to improve
readability and simplify by ...
1. Removing 'goto' statements because we only return the error code on
error and there is no clean-up that needs to be done in the error
path.
2. Move the code to request the clk_cdev1_rst reset from under the
"data->soc > TEGRA_ASOC_UTILS_SOC_TEGRA210" check because we only
use this reset for Tegra186 and there is an additional check for this
device.
Bug 1665446
Change-Id: I23aa8978721f677204a929c8fdebea1f9081793f
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016370
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>