aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-10-18 11:04:33 -0400
committerMark Brown <broonie@kernel.org>2015-10-22 08:49:20 -0400
commit26d9ca3462df8f7e83fc372b23c8da5ed2b1c4f3 (patch)
tree6b05dea43a4c97116de5b5e0853abf38e9b24fee
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff)
ASoC: Let snd_soc_limit_volume() take a snd_soc_card
snd_soc_limit_volume() operates on a card and the CODEC that is passed in is only used to look up the card. Let it directly take the card instead. This makes it possible to use it when no snd_soc_codec is available. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc.h2
-rw-r--r--sound/soc/omap/rx51.c2
-rw-r--r--sound/soc/soc-ops.c8
3 files changed, 6 insertions, 6 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 884e728b09d9..71e0c0566b6e 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -591,7 +591,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
591 struct snd_ctl_elem_value *ucontrol); 591 struct snd_ctl_elem_value *ucontrol);
592int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol, 592int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
593 struct snd_ctl_elem_value *ucontrol); 593 struct snd_ctl_elem_value *ucontrol);
594int snd_soc_limit_volume(struct snd_soc_codec *codec, 594int snd_soc_limit_volume(struct snd_soc_card *card,
595 const char *name, int max); 595 const char *name, int max);
596int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, 596int snd_soc_bytes_info(struct snd_kcontrol *kcontrol,
597 struct snd_ctl_elem_info *uinfo); 597 struct snd_ctl_elem_info *uinfo);
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 3bebfb1d3a6f..99538900a253 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -297,7 +297,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
297 dev_err(card->dev, "Failed to add TPA6130A2 controls\n"); 297 dev_err(card->dev, "Failed to add TPA6130A2 controls\n");
298 return err; 298 return err;
299 } 299 }
300 snd_soc_limit_volume(codec, "TPA6130A2 Headphone Playback Volume", 42); 300 snd_soc_limit_volume(card, "TPA6130A2 Headphone Playback Volume", 42);
301 301
302 err = omap_mcbsp_st_add_controls(rtd, 2); 302 err = omap_mcbsp_st_add_controls(rtd, 2);
303 if (err < 0) { 303 if (err < 0) {
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index 100d92b5b77e..20f702add3f8 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -560,16 +560,16 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range);
560/** 560/**
561 * snd_soc_limit_volume - Set new limit to an existing volume control. 561 * snd_soc_limit_volume - Set new limit to an existing volume control.
562 * 562 *
563 * @codec: where to look for the control 563 * @card: where to look for the control
564 * @name: Name of the control 564 * @name: Name of the control
565 * @max: new maximum limit 565 * @max: new maximum limit
566 * 566 *
567 * Return 0 for success, else error. 567 * Return 0 for success, else error.
568 */ 568 */
569int snd_soc_limit_volume(struct snd_soc_codec *codec, 569int snd_soc_limit_volume(struct snd_soc_card *card,
570 const char *name, int max) 570 const char *name, int max)
571{ 571{
572 struct snd_card *card = codec->component.card->snd_card; 572 struct snd_card *snd_card = card->snd_card;
573 struct snd_kcontrol *kctl; 573 struct snd_kcontrol *kctl;
574 struct soc_mixer_control *mc; 574 struct soc_mixer_control *mc;
575 int found = 0; 575 int found = 0;
@@ -579,7 +579,7 @@ int snd_soc_limit_volume(struct snd_soc_codec *codec,
579 if (unlikely(!name || max <= 0)) 579 if (unlikely(!name || max <= 0))
580 return -EINVAL; 580 return -EINVAL;
581 581
582 list_for_each_entry(kctl, &card->controls, list) { 582 list_for_each_entry(kctl, &snd_card->controls, list) {
583 if (!strncmp(kctl->id.name, name, sizeof(kctl->id.name))) { 583 if (!strncmp(kctl->id.name, name, sizeof(kctl->id.name))) {
584 found = 1; 584 found = 1;
585 break; 585 break;