Commit Graph

678 Commits

Author SHA1 Message Date
Sameer Pujar
6684fbbedf ASoC: tegra: Fix build errors due to core helpers
snd_soc_of_parse_daifmt() is removed from later kernel versions and this
causes complilation error. Use asoc_simple_parse_daifmt() helper to
parse DAI format.

asoc_simple_canonicalize_platform() has a different signature now and
thus update the helper usage accordingly.

Bug 3583581

Change-Id: I9a99fc71849ddf460040f980aea7d4b9f8f80011
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2774427
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-01 10:51:12 -07:00
Mohan Kumar
54bd04b640 ASoC: tegra: Fix AHUB probe issue
Make sure to call pm_runtime_enable() before the
of_platform_populate() which will ensure ahub runtime
resume would be called to enable ahub clock before accessing
any ahub modules registers in modules probe. Calling
of_platform_populate() in parent driver probe results in all
of its child device probe to be completed before it exits the
parent probe call.

The issue caught during MVC child device probe tries to access a
register in probe call which depends on the ahub clock that gets
enabled during AHUB RPM resume. But ahub RPM resume not called as
pm_runtime_enable() in ahub parent driver happens after the
of_platform_populate(). This was observed when drivers were built
as part of kernel image.

Bug 3752938

Change-Id: Ifeb4085961d89877f79ff521adb6dfdf4e51907c
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2762027
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-09-29 15:57:12 +05:30
Sheetal
685ae3b3e1 ASoC: tegra: Fix hardcoded ARAM address
- ARAM start address is not same for all the chips and
  ARAM start address was hardcoded in asrc driver.
  To handle it for all the chips, moved ARAM start address
  info into compatible data of device.

Bug 3434231
Bug 3506754

Signed-off-by: Sheetal <sheetal@nvidia.com>
Change-Id: I860d2d299d11890c01187b19fac16f0d7b31e88c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2704344
(cherry picked from commit 2b93c82cbdafd80859488cb51f41ae8d5341bb79)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2626008
Tested-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:57:12 +05:30
Sheetal
125740cada ASoC: tegra: Add support for 1.2GHz pll base rate
- For upcoming chips the PLLA base rates are different.
  Added entry to support 1.2GHz base rate.
- Base rate reference:
  Bug 3157662, Comment #77.

Bug 200741253
Bug 3506754

Signed-off-by: Sheetal <sheetal@nvidia.com>
Change-Id: Ib8554b3b6b2f1d0e35e328898f343b1f92870bda
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2704346
(cherry picked from commit 77ec9d06a5dc63d6687be0dfa60136af5e2f98ed)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2591781
Tested-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:57:12 +05:30
Sheetal
9841017f33 ASoC: tegra: Add internal PLL support for RT5640
RT5640 codec has internal PLL which can be used to
derive SYSCLK and internal PLL can take I2S BCLK as a
reference clock

Bug 3520437

Signed-off-by: Sheetal <sheetal@nvidia.com>
Change-Id: I3b88d3bf75146532bda669d961c6ff6bb52603f5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2662478
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: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:57:12 +05:30
Rajesh Gumasta
0142517e63 Merge mainline tag v5.10.87 into dev-main-5.10
Merge remote-tracking branch 'origin/dev/linux-5.10.87'
into dev-main-5.10.87

Merge v5.10.66 to v5.10.87

Summary of changes since TOT revision v5.10.65

Changes in v5.10.87 (total commits 33)
arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM
arm: extend pfn_valid to take into account freed memory map alignment
fuse: make sure reclaim doesn't write the inode

Changes in v5.10.86 (total commits 1)
netfilter: selftest: conntrack_vrf.sh: fix file permission

Changes in v5.10.85 (total commits 132)
Documentation/Kbuild: Remove references to gcc-plugin.sh
MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal
doc: gcc-plugins: update gcc-plugins.rst
kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gcc
xhci: avoid race between disable slot command and host runtime suspend
dt-bindings: net: Reintroduce PHY no lane swap binding

Changes in v5.10.84 (total commits 125)
parisc: Mark cr16 CPU clocksource unstable on all SMP machines
serial: tegra: Change lower tolerance baud rate limit for tegra20 and tegra30
ASoC: tegra: Fix kcontrol put callback in AHUB
ASoC: tegra: Fix kcontrol put callback in DSPK
ASoC: tegra: Fix kcontrol put callback in DMIC
ASoC: tegra: Fix kcontrol put callback in I2S
ASoC: tegra: Fix kcontrol put callback in ADMAIF
ASoC: tegra: Fix wrong value type in DSPK
ASoC: tegra: Fix wrong value type in DMIC
ASoC: tegra: Fix wrong value type in I2S
ASoC: tegra: Fix wrong value type in ADMAIF

Changes in v5.10.83 (total commits 121)
net: ipv6: add fib6_nh_release_dsts stub
ipv6: fix typos in __ip6_finish_output()
mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB

Changes in v5.10.82 (total commits 153)
scsi: ufs: core: Fix task management completion timeout race
scsi: ufs: core: Fix task management completion
net: reduce indentation level in sk_clone_lock()
net-zerocopy: Refactor skb frag fast-forward op.
sched/core: Mitigate race cpus_share_cache()/update_top_cache_domain()

Changes in v5.10.81 (total commits 21)
thermal: Fix NULL pointer dereferences in of_thermal_ functions
PCI: Add MSI masking quirk for Nvidia ION AHCI
PCI/MSI: Deal with devices lying about their MSI mask capability
PCI/MSI: Destroy sysfs before freeing entries
loop: Use blk_validate_block_size() to validate block size

Changes in v5.10.80 (total commits 570)
soc/tegra: pmc: Fix imbalanced clock disabling in error code path
dmaengine: dmaengine_desc_callback_valid(): Check for `callback_result`
soc/tegra: Fix an error handling path in tegra_powergate_power_up()
rcu: Fix existing exp request check in sync_sched_exp_online_cleanup()
serial: core: Fix initializing and restoring termios speed

Changes in v5.10.79 (total commits 19)
printk/console: Allow to disable console output by using console="" or console=null

Changes in v5.10.78 (total commits 14)
scsi: core: Put LLD module refcnt after SCSI device is released

Changes in v5.10.77 (total commits 77)
net: Prevent infinite while loop in skb_tx_hash()
mmc: sdhci: Map more voltage level to SDHCI_POWER_330

Changes in v5.10.76 (total commits 94)
scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma()
dma-debug: fix sg checks in debug_dma_map_sg()

Changes in v5.10.75 (total commits 101)
acpi/arm64: fix next_platform_timer() section mismatch error
platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes
platform/mellanox: mlxreg-io: Fix argument base in kstrtou32() call
net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp
net/mlx5e: Fix memory leak in mlx5_core_destroy_cq() error path

Changes in v5.10.74 (total commits 22)
sched: Always inline is_percpu_thread()
perf/core: fix userpage->time_enabled of inactive events

Changes in v5.10.73 (total commits 81)
RISC-V: Include clone3() on rv32
i2c: acpi: fix resource leak in reconfiguration device addition
net: prefer socket bound to interface when not in VRF
net/mlx5: E-Switch, Fix double allocation of acl flow counter
net/mlx5e: IPSEC RX, enable checksum complete

Changes in v5.10.72 (total commits 29)
tools/vm/page-types: remove dependency on opt_file for idle page tracking

Changes in v5.10.71 (total commits 92)
mm: don't allow oversized kvmalloc() calls
crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd()
debugfs: debugfs_create_file_size(): use IS_ERR to check for error
cpufreq: schedutil: Destroy mutex before kobject_put() frees the memory
cpufreq: schedutil: Use kobject release() method to free sugov_tunables
tty: Fix out-of-bound vmalloc access in imageblit

Changes in v5.10.70 (total commits 102)
spi: Fix tegra20 build with CONFIG_PM=n
thermal/core: Potential buffer overflow in thermal_build_list_of_policies()

Changes in v5.10.69 (total commits 64)
sched/idle: Make the idle timer expire in hard interrupt context
thermal/core: Fix thermal_cooling_device_register() prototype
PM: sleep: core: Avoid setting power.must_resume to false

Changes in v5.10.68 (total commits 125)
PCI: Sync __pci_register_driver() stub for CONFIG_PCI=n
tracing/boot: Fix a hist trigger dependency for boot time tracing
PCI: tegra: Fix OF node reference leak
PCI: tegra194: Fix MSI-X programming
PCI: tegra194: Fix handling BME_CHGED event
fuse: fix use after free in fuse_read_interrupt()

Changes in v5.10.67 (total commits 305)
cpufreq: powernv: Fix init_chip_info initialization in numa=off
net/mlx5: DR, Enable QP retransmission
net/mlx5: DR, fix a potential use-after-free bug
mmc: core: Return correct emmc response in case of ioctl error
ARM: tegra: tamonten: Fix UART pad setting
ARM: tegra: acer-a500: Remove bogus USB VBUS regulators
media: tegra-cec: Handle errors of clk_prepare_enable()
arm64: tegra: Fix Tegra194 PCIe EP compatible string
pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry()
crypto: public_key: fix overflow during implicit conversion

Changes in v5.10.66 (total commits 4)
Revert "time: Handle negative seconds correctly in timespec64_to_ns()"
Revert "posix-cpu-timers: Force next expiration recalc after itimer reset"
Revert "block: nbd: add sanity check for first_minor"
Revert "Bluetooth: Move shutdown callback before flushing tx and rx queue"

Bug 200712834

Change-Id: Iaf76032e92a2e31d457bc39c5b110605f5e20f39
Signed-off-by: Rajesh Gumasta <rgumasta@nvidia.com>
2022-09-29 15:57:12 +05:30
Sameer Pujar
ba0e19874d ASoC: tegra: Fix kcontrol put callback in AHUB
commit a4e37950c9e9b126f9cbee79b8ab94a94646dcf1 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the AHUB driver accordingly.

Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-12-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:56:06 +05:30
Sameer Pujar
4715358c19 ASoC: tegra: Fix kcontrol put callback in DSPK
commit d6202a57e79d102271d38c34481fedc9d4c79694 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the DSPK driver accordingly.

Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-11-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:56:06 +05:30
Sameer Pujar
0e4e80ba39 ASoC: tegra: Fix kcontrol put callback in DMIC
commit a347dfa10262fa0a10e2b1970ea0194e3d4a3251 upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the DMIC driver accordingly.

Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-10-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:56:06 +05:30
Sameer Pujar
d473d42138 ASoC: tegra: Fix kcontrol put callback in I2S
commit f21a9df3f7cb0005947679d7b9237c90574e229a upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the I2S driver accordingly.

Fixes: c0bfa98349d1 ("ASoC: tegra: Add Tegra210 based I2S driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-9-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:56:06 +05:30
Sameer Pujar
67d8d5800e ASoC: tegra: Fix kcontrol put callback in ADMAIF
commit e2b87a18a60c02d0dcd1de801d669587e516cc4d upstream.

The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the ADMAIF driver accordingly.

Fixes: f74028e159bb ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-8-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:56:06 +05:30
Sameer Pujar
9bd13cefe4 ASoC: tegra: Fix wrong value type in DSPK
commit 3aa0d5c8bb3f5ef622ec2764823f551a1f630711 upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-5-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:55:17 +05:30
Sameer Pujar
44bb7bd10e ASoC: tegra: Fix wrong value type in DMIC
commit 559d234569a998a4004de1bd1f12da5487fb826e upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:53:18 +05:30
Sameer Pujar
d7d7cc0ad3 ASoC: tegra: Fix wrong value type in I2S
commit 8a2c2fa0c5331445c801e9241f2bb4e0e2a895a8 upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: c0bfa98349d1 ("ASoC: tegra: Add Tegra210 based I2S driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:52:23 +05:30
Sameer Pujar
75d1e83e5e ASoC: tegra: Fix wrong value type in ADMAIF
commit 884c6cb3b7030f75c46e55b9e625d2372708c306 upstream.

The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: f74028e159bb ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-29 15:50:28 +05:30
Sameer Pujar
7d0726f36b ASoC: tegra: Add support for RT5640 codec
Due to a shortage of RT5658 codec parts, search was going on for an
alternative codec. As a replacement, RT5640 codec is finalized now.
The upcoming Concord boards (EB3 to begin with) will have this codec.
This commit adds required support in the machine driver.

Machine driver update is needed for following reasons:
 * The RT5640 codec driver expects sysclk configuration from machine
   driver. This requirement is similar to what we have today for
   RT5658 codec. This handling is done under "rt5640-playback" DAI
   link name.

 * RT5640 DAI link init is added for jack setup. Since it is mostly
   similar to RT5658 handling, the existing init helper function is
   re-used. The component driver jack setup callback is used to make
   this simple.

Bug 200766032

Change-Id: I41ee0022c22fd50e9baf80aa765b2b3ede4e85c7
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2625064
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@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
Asha Talambedu
b4b4cc0717 ASoC: tegra: Handle adsp OS start crash
In case of nvadsp_os_start crash, the host adsp audio driver
is still getting registered and this is leading to kernel
panic during shutdown. Added code to propgate start status to
probe so host adsp audio driver register fails on adsp os crash

Bug 3391964

Change-Id: I361c1a1a0409e81ddfce2413debe63ba5d65d07d
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2627904
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
Sheetal
99eec7ce60 ASoC: tegra: Fix mbdrc driver issues
- MBDRC status register should be defined as volatile.

- MBDRC master volume control was not working for
  expected volume range. Updated the control so that it can
  work for -256dB to 255dB gain. Control can take values
  from 0 to 512 that is mapped to -256 to 256dB. The dB
  info is added as metadata of control.

  kcontrol defination will look like below:
    amixer -c 1 cget name='OPE1 mbdrc master volume'
    numid=1187,iface=MIXER,name='OPE1 mbdrc master volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=512,step=0
    : values=256
    | dBminmax-min=-256.00dB,max=255.00dB

Bug 200753407

Signed-off-by: Sheetal <sheetal@nvidia.com>
Change-Id: I707a89074342083b71f906f15ead243ee317a43b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2601115
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@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
Asha Talambedu
719434d072 AsoC: tegra-alt: Update i2s rate setting logic
Earlier hardcoded pll base rates were leading to fractional divider
values for i2s multichannel config while deriving i2s bclk.
Hence updated clock rates and logic  for >2 channel configs for t186ref
and higher boards such that the dynamic range between max plla and min plla
is < 35 MHz. Also, if desired bclk is above limit, the case will be
declared as not supported. Note that new facility will be used only in l4t
machine driver.

Bug 200702569

Change-Id: I83aba425f6dde30a1f29f85b16a1bbbebba14198
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2491744
(cherry picked from commit e0fe51d5e7ced073eb618e19836f88a023f70bdc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2613507
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
Asha Talambedu
39cc4081e3 ASoC: tegra: Add shutdown callback
- Added mutex protection for init_done flag reads in
  mixer control callbacks relevant to "ADSP init". Otherwise
  during shutdown sequence that includes alsa store service,
  this leads to inconsistent behaviour
- Shutdown callback is added to deinit ADSP OS during
  abrupt shutdown.
- In case ADSP OS is crashed during boot/boot has not
  started yet, shutdown does not issue OS deinit as
  init is not complete yet

Bug 3391964

Change-Id: I207e2141af9386f5914e07a8dd231d0fcd803a6e
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2607727
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
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
Sameer Pujar
042747e4d8 ASoC: tegra: DAI link params support from DT
In current production software we support DAI link params from DT.
This is useful when operating Tegra in hostless mode, where params
(sample rate, channels and sample format) passed from DT are applied
to the DAI links. In this way DT can provide control to operate DAI
links in a required config.

For dev-main it was on hold since there was plan to use upstream
machine driver where upstream bindings can provide similar control.
Since this feature is required for a near customer release, it is
now ported to the dev-main driver.

Bug 200713904
Bug 200775355

Change-Id: I333cc60addc26ffc433f08b410fa076dc102282e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2594849
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@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
f9f0e26a20 ASoC: tegra: Memory leak due to BE HW constraint
- The issue was happening because dapm core was not deallocating
  the hw contraints rules memory.
  Memory leak backtrace from cat /sys/kernel/debug/kmemleak:
    [<0000000046fdaf4f>] slab_post_alloc_hook+0x6c/0x3e0
    [<00000000989dfc0e>] __kmalloc_track_caller+0x1b8/0x400
    [<00000000505e39ec>] krealloc+0xe8/0x160
    [<000000009cc82a21>] snd_pcm_hw_rule_add+0x164/0x1a0
    [<00000000aa77851e>] snd_pcm_hw_constraint_list+0x28/0x30
    [<000000009b2cd5c6>] tegra210_ahub_write_ram+0xa8/0xb60
    [<00000000a61d7069>] snd_soc_dai_startup+0x40/0xa0
    [<00000000a7452879>] snd_soc_dai_link_event+0x334/0x600
    [<000000008c5771de>] dapm_seq_check_event+0x120/0x330
    [<00000000be740a3d>] dapm_seq_run_coalesced+0xb0/0x250
    [<0000000003732007>] dapm_seq_run+0xf0/0x510
    [<00000000cbb85eb0>] dapm_power_widgets+0x58c/0xac0
    [<00000000b96c5548>] snd_soc_dapm_stream_event+0x128/0x170
    [<0000000027bb14bc>] soc_pcm_prepare+0x70/0x110
    [<00000000d44b9075>] snd_pcm_do_prepare+0x34/0x50
    [<000000005664d4d5>] snd_pcm_action_single+0x4c/0xa0

- For BE dais HW constraints won't take any impact and only for FE
  dais it is required. So added it in component driver open callback.

Bug 200773796

Signed-off-by: Sheetal <sheetal@nvidia.com>
Change-Id: Ic4c1bf881b914bda03bda8e97816cf1c6dee4052
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2596443
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@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
sheetal
78f655e85e ASoC: tegra: Add support for 24KHz and 64KHz rate
- Fix the issues with 24KHz and 64KHz sample rate.
- In machine driver, 24KHz and 64KHz were not supported, add
  the rates into the list.
- 24KHz is not supported by ALSA, to support it mentioned dai rates
  as SNDRV_PCM_RATE_KNOT. Using KNOT chip can support unconventional rates,
  defined in hw constraints list.
- The change is added for FE links only,  for BE links its not required as
  it will be taken care by FE links.

Bug 200757915

Change-Id: I348368420316ba78b303cd27a413048b6cab2dd7
Signed-off-by: sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2571687
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:50:28 +05:30
Mohan Kumar
85258fddea ASoC: tegra: Add support for S24_LE format
Add support for S24_LE format for all internal and IO AHUB
modules.
- Make the data to be S32_LE internal to AHUB modules.
- Conversion from 24 to 32 or vise-versa will happen at ADMAIF, or
at the IO modules CIF to maintain consistency across modules.

Bug 200755886

Change-Id: I175e4177ec76baf7ead9b89276a70a4b454756fa
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2578280
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
Mohan Kumar
d3352a5e41 ASoC: tegra: xbar widgets for T234
Due to removal of SPDIF and SPKPROT HW IP, the xbar
switch register offset for few modules changed compared
to previous chip.

Bug 200762074

Change-Id: I7733a7d6db8d70b164d07e1b9668da3d342633d7
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2575517
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
Mohan Kumar
30b5703537 ASoC: tegra: Add t234 chip check in asoc util
Add t234 chip compatible check in tegra asoc util file

Bug 200755886

Change-Id: Iecf59cf78c8359b86668fcbaf4bdb5bd50b49271
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2572441
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
Sameer Pujar
ae473fa8b4 ASoC: tegra: OPE DAPM path uses wrong regmap
OPE enable is not happening even though the DAPM path is complete.
This seems to happen because ASoC core does not use correct regmap
interface for the DAPM route listed by driver. The driver makes use
of multiple regmap interfaces (one each for OPE, PEQ and MBDRC).
The core populates component regmap using dev_get_regmap(), which
actually returns the last registered interface in the OPE driver
probe() call.

Since the same callback function is not available in later versions
of kernel for component driver, use component probe() call to setup
the regmap.

Bug 200750067
Jira EMA-393

Change-Id: Ib509a9f95f4c152c2210f88975a1f7572d79ba08
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: http://git-master/r/1318570
(cherry picked from commit 545ee019fc4a7c5b0b92a488cd3d16dbbcefbba9 in
partial and updated logic for it to work on newer kernel)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2558375
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sheetal . <sheetal@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Sheetal . <sheetal@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
Sameer Pujar
42782c7dcd ASoC: tegra: Provision for fixed PLL config
Tegra Audio HW subsystem has many I/O module instances and currently a
single PLL source is used for all these modules. Any I2S configuration
is supported now by dynamically updating PLL base rate. But as of today
this has few limitations.

  - AUD_MCLK factor is not considered while updating PLL base rate.

  - Two module instances can request conflicting PLL base rate and
    the last request overrides existing session. This would also mean
    simultaneous 8x and 11x configurations are not possible.

  - Tegra210 has problems with specific PLL requests.

Multiple PLLs would be required if concurrent audio sessions need to be
supported and dynamic rate update is needed to support any configuration.
But this has few limitions too.

  - Since number of available PLLs for modules are limited, specific PLL
    cannot be dedicated to a module. The PLL would be shared and may
    cause problems when there are simultaneous conflicting requirements.

  - Logic for runtime distribution of PLLs to modules and rate updates
    has to be managed in module drivers only as machine driver does not
    have intelligence to know for which audio path exactly the hw_param()
    call comes. This can make the code complicated and buggy where each
    module driver tries to control specific PLL.

Instead the problem can be simplified by fixing PLL rates in DT. User
can employ one or more PLLs to realize their design. Of course this won't
support all configurations simultaneously since this is not what users
require generally. They have specific requirements which can be addressed
via DT configurations. For example,

  - Some users may use single PLL and decide on compatible set of audio
    configurations for their use cases.

  - Some users may want to use two PLLs, one each for 8x and 11x. Then
    via DT specific modules can use specific PLL sources to realize
    simultaneous 8x and 11x configurations. In fact two PLLs can be
    used when there are conflicting requirements which cannot be met
    by a single PLL source.

To realize above add new DT property "fixed-pll" and bypass PLL rate
updates from the driver. Users can populate this in their platform
sound DT node, whenever static configurations are preferred.

Bug 200726704

Change-Id: I0416f201fd26c49bb6c09594d86394c46a0bbad2
(cherry-picked from commit 0c84a3fe1e2e40d20ddb449a948da6fdebd85efe)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548361
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Change-Id: I51d5b502f728baee2d6d075951dc186503cbf76f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2556536
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
d36392a61a ASoC: tegra: Parse DAI format using core API
The simple-card helper asoc_simple_parse_daifmt() expects "bitclock-master"
and "frame-master" DT properties in DAI link node with phandle references
or supports legacy style in codec subnode. Current platforms describe these
properties in DAI link subnode which are not in expected style and thus
these are not taking any effect.

It can be addressed by updating platform DT files. But since audio-graph
is planned in future, it is simpler to keep current bindings as they are
and just fix driver to work with current style. This can be achieved by
using ASoC core helper, instead of simple-card helper, for parsing the DAI
format.

Bug 200749671

Change-Id: I86564321bb41344ef9d5c1c26aeaf363e67cc666
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2556106
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-09-29 15:50:28 +05:30
Mohan Kumar
cd65fe9fd2 ASoC: tegra: fix mbdrc out of bound warning
UBSAN tool reporting shift out of bound warning during the
boot for mbdrc driver. Used 64 bit variable to avoid issue,
but still it reporting issue which got reslved after typecasting.

Bug 200750363

Change-Id: I4f3cfc8aded4b9d4ac18af76888389adbfafe411
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2556009
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-09-29 15:50:28 +05:30
sheetal
1f4d0af515 ASoC: tegra: Fix ASRC SLCG and CIF registers
- SLCG should be enabled by default. Update the default value
  to 1.
- RXCIF and TXCIF registers client bit field is RO, should
  not be modified by driver to some other value other than
  5 (i.e. 24bits)

Bug 200683609

Change-Id: I42a96ff20b4952e5faca61a9bf3e3b1fa61a92d2
Signed-off-by: sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2548114
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@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
Mohan Kumar
cc172ee03a ASoC: tegra: fix mbdrc driver
UBSAN tool reporting shift out of bound warning during the
boot for mbdrc driver. Use 64 bit variable to avoid issue.

Bug 200683609

Change-Id: I53808224584fc52614fd957eef371911f7dd144e
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2554092
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@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
Sameer Pujar
d940c0e813 ASoC: tegra: Generic compatible names for driver
The tegra_machine_driver.c now is a generic machine driver which is used
with multiple Jetson platforms and audio cards. Hence get rid of strings
like 'mobile' or 'rt565x' which are misleading in terms of usage domain.

Bug 200717065
Bug 200739452

Change-Id: Ifc2a5bf238cc222ca23681a9764809f6afb2de87
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2545307
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@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
Sameer Pujar
d0c00ff0a7 ASoC: tegra: Explicit driver name for sound card
This is inspired from following upstream commit:
https://lore.kernel.org/r/20210330180657.1867971-1-thierry.reding@gmail.com

For consistent audio configuration files between downstream and upstream
this change is required in downstream sound card driver as well.

Bug 200717065
Bug 200739452

Change-Id: Ibe37c0c892ab169eb9cf6fcf85015f22c4c7b658
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2545304
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@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
sheetal
9e4c08a7c2 ASoC: tegra: Update PLLA base rate for x8KHz
This change is decided as per Bug (Bug 200702569) and
it will keep the range for all channels within 35MHz.
Adding same change to make automation script to work.

Bug 200683609

Change-Id: Ibba3847133d643c0132e8660a8ae21c7383a8afd
Signed-off-by: sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2536432
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@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
Sameer Pujar
ae9fe52e1e ASoC: tegra: External codec setup in Tegra audio graph card
Tegra platforms support multiple external codecs which in some cases
require initial setup or runtime setup. Since common machine driver is
used, it uses DAI link names passed from DT to apply specific settings.
Use the same logic for Tegra audio graph card driver as well. In doing
so separate out codec setup part and move the same to tegra_codec.c
source file. This is reference in current downstream machine driver
and future Tegra audio graph card driver.

Going ahead alternate solution need to be identified to avoid dependency
on DAI link names. Upstream generic audio graph driver does not support
such method and passing DAI link names from DT won't be entertained in
upstream.

Bug 200692799

Change-Id: I40d134e89405fd8bb2d9aebfe2bce82816b545bd
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
b754b2459e ASoC: tegra: Populate non_legacy_dai_naming flag for codec components
The simple-card or audio-graph-card mark the DAI links as codec2codec
if all the components in a link have "non_legacy_dai_naming" flag set.
Thus populate this flag for all codec components.

Bug 200692799

Change-Id: Iaf7a030a0603034a1c594b9952bd8dbcf0551ef8
Signed-off-by: Sameer Pujar <spujar@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
b80b630e1d ASoC: tegra: Rename mixer controls of Mixer driver
Similar to upstreamed AHUB drivers, follow standard naming convention
for mixer controls used in Mixer driver. Thus update channel related
mixer controls.

Bug 200698314

Change-Id: I3d8ab06df7361a0d2bf8a732595fc1e1c8063c5d
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
70cfefd042 ASoC: tegra: Cleanup macros in Mixer driver
Remove unused macros in Mixer driver and use shorter names for
remaining macros wherever possible. This makes code look relatively
compact and cleaner.

Bug 200698314

Change-Id: I0fd188413222acf3483b596380699272514bdf4b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
5604eb841f ASoC: tegra: Rename AMX/ADX mixer controls
Similar to upstreamed AHUB drivers, follow standard naming convention
for AMX/ADX mixer controls. Thus update channel mixer controls.

Bug 200698314

Change-Id: If1e2252392493435203e28cb9b232a8fcdf7fadc
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
43b4285832 ASoC: tegra: Cleanup macros in AMX/ADX driver
Remove unused macros in AMX/ADX driver and use shorter names for
remaining macros wherever possible. This makes code look relatively
compact and cleaner.

Currently in AMX driver, Tegra210 regmap readable/writeable_reg()
callbacks use Tegra194 specific register range. As this looks
incorrect, maintain separate callbacks for readable/writeable_reg()
for Tegra210 and Tegra194. Use register range in these callbacks
to make it compact.

Bug 200698314

Change-Id: Iae466da9aaef722736ccaf49a490a3b24b6d683a
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
72643a1be8 ASoC: tegra: Rename MVC mixer controls
Similar to upstreamed AHUB drivers, follow standard naming convention
for MVC mixer controls. Right now there is no requirement to have
separate channel or bit format controls on input/output and AHUB/client
side. Single channel or bit format control is used for all. Hence rename
bit format control to look consistent with channel control.

Bug 200698314

Change-Id: I76976823d03ef3e3a47346aa928c11f9b26052c6
Signed-off-by: Sameer Pujar <spujar@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
8c768c53df ASoC: tegra: Rename SFC stereo conversion strings
As per upstream suggestion (on upstreamed AHUB drivers), rename
following srings:
 'ZERO' -> 'Zero'
 'COPY' -> 'Copy'

Bug 200698314

Change-Id: I62ff2f370f505e8811b4405e4a6dc033ba791bc3
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
99d23f60af ASoC: tegra: Use runtime PM get/put() on SFC device
SFC driver performs runtime PM operations on the parent device of SFC.
This is not necessary as runtime get/put() calls on the SFC device itself
would be sufficient. Because SFC device is child of AHUB device and
resuming child would resume parent device as well. This does not fix any
functional issue, but just makes code more easy to read.

Bug 200698314

Change-Id: Ia4ce4b45b8681d2db15af96f61433643dd4f3916
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
9f635d7089 ASoC: tegra: Cleanup macros in SFC driver
Remove unused macros in SFC driver and use short names for remaining
macros by dropping 'AXBAR' characters from the name. This is similar
to what is done for other upstreamed AHUB drivers. This makes code to
look relatively compact and cleaner.

Bug 200698314

Change-Id: Ib30a482105f3b4864e14647b253f670a10f9030d
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
2022-09-29 15:50:28 +05:30
Sameer Pujar
121433e898 ASoC: tegra: Rename SFC mixer controls
Similar to upstreamed AHUB drivers, follow standard naming convention
styles for SFC mixer control names. Also put all get() operations under
a single function for a better readability. Do the same for put()
operations as well.

Bug 200698314

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