ASoC: tegra: Fix ASRC ratio restore issue

"alsactl restore" was not able to restore the value
goes beyond the signed int range for Ratio control.
As Ratio control expected 64bit Integer, change the
type and bits to 64 for "ASRC1 Ratio<x>" controls.

Bug 4870215

Change-Id: I96967968af151fa7b00d1d63bacade4c4d1ccce4
Signed-off-by: Sheetal <sheetal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3221692
Reviewed-by: Hirak Biswas <hbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
This commit is contained in:
Sheetal
2024-10-01 05:52:36 +00:00
committed by Jon Hunter
parent ccdd799b54
commit 2e000ca873
2 changed files with 23 additions and 5 deletions

View File

@@ -700,6 +700,20 @@ int tegra186_virt_asrc_set_ratio(struct snd_kcontrol *kcontrol,
}
EXPORT_SYMBOL(tegra186_virt_asrc_set_ratio);
int tegra186_virt_ratio_param_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
struct soc_mreg_control *mc =
(struct soc_mreg_control *)kcontrol->private_value;
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER64;
uinfo->count = 1;
uinfo->value.integer.min = mc->min;
uinfo->value.integer.max = mc->max;
return 0;
}
EXPORT_SYMBOL(tegra186_virt_ratio_param_info);
int tegra186_virt_asrc_get_ratio_source(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
/* SPDX-License-Identifier: GPL-2.0-only
*
* SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION. All rights reserved.
*/
#ifndef __LINUX_VIRT_UTIL_H
@@ -84,10 +84,11 @@
#define SOC_SINGLE_EXT_FRAC(xname, xregbase, xmax, xget, xput) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
.info = snd_soc_info_xr_sx, .get = xget, \
.info = tegra186_virt_ratio_param_info, \
.get = xget, \
.put = xput, \
.private_value = (unsigned long)&(struct soc_mreg_control) \
{.regbase = xregbase, .regcount = 1, .nbits = 32, \
{.regbase = xregbase, .regcount = 1, .nbits = 64, \
.invert = 0, .min = 0, .max = xmax} }
#define ASRC_RATIO_CTRL_DECL(ename, reg) \
@@ -316,6 +317,9 @@ int tegra186_virt_asrc_get_ratio(struct snd_kcontrol *kcontrol,
int tegra186_virt_asrc_set_ratio(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int tegra186_virt_ratio_param_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo);
int tegra186_virt_asrc_get_ratio_source(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
int tegra186_virt_asrc_set_ratio_source(struct snd_kcontrol *kcontrol,