Commit Graph

8 Commits

Author SHA1 Message Date
Sameer Pujar
9d520f3d07 ASoC: tegra: Don't deprecate master volume control
There was a plan to deprecate master volume control since it was thought
that per channel control will be sufficient and master volume application
can be emulated in user space by programming same volume to all channels.
But this means we would not really use a HW feature which has a provision
to automatically apply CH0 volume settings to all remaining channels.

HW has a per channel control bit, based on which it decides to apply a
channel specific setting or a common setting across all channels. Driver
has both master volume and per channel volume mixer controls. Based on
the control user updates, enable or disable the per channel control.

Use below scheme for volume updates:

 * If master volume mixer control is updated, disable per channel control
   and only CH0 volume register is programmed. SW can store same volume
   across all channels.

 * If a channel specific control is updated, enable per channel control
   and program specific channel volume register.

Above applies to mute/unmute functions as well and thus corresponding
control blocks are similarly updated.

The volume settings are stored in SW and the same is used for the user
space queries via mixer controls. But mute settings are not stored in
SW and are always directly read from HW since it belongs to a volatile
register. The mute control read function is modified to return proper
settings when queried from user space.

Bug 200766084

Change-Id: Iad8b5c09c424731e841863bfd5ce32d07ff9e684
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2599601
Reviewed-by: Sheetal . <sheetal@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@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>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
sheetal
47e3d32fc0 ASoC: tegra: Add MVC Bypass support
- Add "MVC Bypass" kcontrol to enable MVC Bypass
  mode.
- The change is required to verify MVC bypass mode
  during bring up.

Bug 200683609

Change-Id: Ic0f2c947fa2e9bd6e9b429b86ff35e053775ec80
Signed-off-by: sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2546568
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:50:28 +05:30
Asha Talambedu
a740b0f4eb ASoC: tegra: Per channel vol/mute support
Per channel volume/mute control is possible with MVC
and the support is enabled through mixer ctrls for volume
settings of each channel and per channel mute mask
while retaining previous Mute and Vol controls.
Eventually Mute and Vol would be deprecated

Bug 200532059

Change-Id: I7c731276cfc6df7d268e398215d18a978213e521
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2400678
(cherry picked from commit 74eaf197c10db33631b574c1c3ac8cce82af925a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2535583
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
48bff81383 ASoC: tegra: Cleanup macros in MVC driver
Remove unused macros in MVC driver and use shorter names for remaining
macros wherever possible. This makes code look relatively compact and
cleaner. Also provide separate callbacks for readable/writable_reg()
and use register ranges for case statments.

Bug 200698314

Change-Id: Ia61a824fce5531b74b67b6ebf8e5216c7a982c17
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
b32bd99824 ASoC: tegra: Trivial cleanup (Tegra210 and later)
This performs following trivial cleanup:
  - Remove explicit THIS_MODULE assignment in platform_driver struct.
  - Remove DRV_NAME macro and assign the name directly in platform_driver
    struct.
  - Add SPDX-License-Identifier to header files
  - Sort header file inclusions

Bug 200698314

Change-Id: Ic1e2166b6a8257cd3b462cc8b2a9719e25c7bbb8
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
fe40005d9b ASoC: tegra: cosmetic changes for Tegra210
Following changes are pushed as part of this commit:
 - Update copyright signature as per new format.
 - Remove references to "_ALT_" in header macros.
 - Fix copyright year for I2S, DMIC, DSPK, ADMAIF and XBAR drivers.
 - Fix file name in source header for Machine Utility driver.

Bug 2845498

Change-Id: I18b040a9d48a86a33f3ac6b6932d55e81d6414ac
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.9/+/2354014
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:35:11 +05:30
Sameer Pujar
ec0813dbd1 ASoC: tegra: move remaining AHUB devices to component
Following AHUB modules are considered as part of this series. This updates
all drivers to use component structure. Initially AHUB, I2S, DMIC, DSPK
and ADMAIF drivers were updated.

FPGA code is removed from the related drivers. This can be cherry-picked
if it is really required.

Bug 2845498

Change-Id: Ia3f60257c225d281d86ad83325fb517969259cb4
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:30:21 +05:30
Sameer Pujar
39e4507117 ASoC: tegra: merge 'tegra' and 'tegra-alt' directories
Tegra210 and later audio drivers have been using 'tegra-alt' directory
from the beginning. As per the upstream roadmap, we plan to use the
same 'tegra' directory and place all the drivers under it. This patch
thus moves all the drivers to 'tegra' and renames the files accordingly.
The '_alt' suffix is removed from header and source files.

For some files still the '_alt' suffix is retained because 'tegra'
already has the corresponding files. Manual merge of following files is
needed and will be done in separate commits.
 * tegra_asoc_utils_alt.c and tegra_asoc_utils.c
 * tegra_asoc_utils_alt.h and tegra_asoc_utils.h
 * tegra_pcm_alt.c and tegra_pcm.c
 * tegra_pcm_alt.h and tegra_pcm.h
 * Corresponding Makefile and Kconfig files.
 * Source files related to ADSP audio, FPGA, bandwidth manager are not
   considered at the moment and will be tracked separately.

Bug 2845498

Change-Id: I51dae3971c72b58d921dc19f0553a83422fd3f9e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:30:21 +05:30