summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2024-02-19 18:44:10 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2024-02-19 18:44:10 +0100
commit8da9ec7456dcc055bccc8fefc81c026034a7676c (patch)
tree7d2de21f98d92985bb6ef31c9fee62d3cd341a6f
parent9220bf6c14dc5477c6638f5016f8dd88c646990f (diff)
Revert "ASoC: ops: Clarify snd_soc_info_volsw_sx()"
This reverts commit 6f668d2cbd2e2b87a3f347070704714453383712.
-rw-r--r--sound/soc/soc-ops.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index 7e1cbc23bba5..8c0e7ad66eb2 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -203,8 +203,7 @@ EXPORT_SYMBOL_GPL(snd_soc_info_volsw);
* Callback to provide information about a single mixer control, or a double
* mixer control that spans 2 registers of the SX TLV type. SX TLV controls
* have a range that represents both positive and negative values either side
- * of zero but without a sign bit. min is the minimum register value, max is
- * the number of steps.
+ * of zero but without a sign bit.
*
* Returns 0 for success.
*/
@@ -213,21 +212,12 @@ int snd_soc_info_volsw_sx(struct snd_kcontrol *kcontrol,
{
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
- int max;
- if (mc->platform_max)
- max = mc->platform_max;
- else
- max = mc->max;
-
- if (max == 1 && !strstr(kcontrol->id.name, " Volume"))
- uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
- else
- uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
-
- uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
- uinfo->value.integer.min = 0;
- uinfo->value.integer.max = max;
+ snd_soc_info_volsw(kcontrol, uinfo);
+ /* Max represents the number of levels in an SX control not the
+ * maximum value, so add the minimum value back on
+ */
+ uinfo->value.integer.max += mc->min;
return 0;
}