ASoC: Let snd_soc_limit_volume() take a snd_soc_card
PATCH 1/1 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.
--- include/sound/soc.h | 2 +- sound/soc/omap/rx51.c | 2 +- sound/soc/soc-ops.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
include/sound/soc.h +1 -1
@@ -612,7 +612,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);int snd_soc_get_volsw_range (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol); -int snd_soc_limit_volume (struct snd_soc_codec *codec, +int snd_soc_limit_volume (struct snd_soc_card *card,const char *name,int max);int snd_soc_bytes_info (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_info *uinfo);
sound/soc/omap/rx51.c +1 -1
@@ -297,7 +297,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)dev_err (card->dev,"Failed to add TPA6130A2 controls\n" );return err; } -snd_soc_limit_volume (codec,"TPA6130A2 Headphone Playback Volume" ,42 ); +snd_soc_limit_volume (card,"TPA6130A2 Headphone Playback Volume" ,42 ); err =omap_mcbsp_st_add_controls (rtd,2 );if (err <0 ) {
sound/soc/soc-ops.c +4 -4
@@ -588,16 +588,16 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range);/** * snd_soc_limit_volume - Set new limit to an existing volume control. * -* @codec: where to look for the control +* @card: where to look for the control * @name: Name of the control * @max: new maximum limit * * Return 0 for success, else error. */ -int snd_soc_limit_volume (struct snd_soc_codec *codec, +int snd_soc_limit_volume (struct snd_soc_card *card,const char *name,int max) { -struct snd_card *card = codec->component.card->snd_card; +struct snd_card *snd_card = card->snd_card;struct snd_kcontrol *kctl;struct soc_mixer_control *mc;int found =0 ;
@@ -607,7 +607,7 @@ int snd_soc_limit_volume(struct snd_soc_codec *codec,if (unlikely (!name || max <=0 ))return -EINVAL ; -list_for_each_entry (kctl, &card->controls, list) { +list_for_each_entry (kctl, &snd_card->controls, list) {if (!strncmp (kctl->id.name, name,sizeof (kctl->id.name))) { found =1 ;break ;
Signature · 1 line
2.1.4
Quoted 9 lines · Lars-Peter Clausen
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 nosnd_soc_codecis available.Signed-off-by Lars-Peter Clausen <[email protected]>--- include/sound/soc.h | 2 +- sound/soc/omap/rx51.c | 2 +- sound/soc/soc-ops.c | 8 ++++----
For rx51:
Mark Brown
maintainerApplied "ASoC: Let snd_soc_limit_volume() take a snd_soc_card" to the asoc tree
In reply to Lars-Peter ClausenThe patch
ASoC: Let snd_soc_limit_volume() take a snd_soc_card
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
26d9ca3462df8f7e83fc372b23c8da5ed2b1c4f3Mon Sep 17 00:00:00 2001
From: Lars-Peter Clausen <[email protected]>
Date: Sun, 18 Oct 2015 17:04:33 +0200
Subject: [PATCH] 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.
--- include/sound/soc.h | 2 +- sound/soc/omap/rx51.c | 2 +- sound/soc/soc-ops.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
include/sound/soc.h +1 -1
@@ -591,7 +591,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);int snd_soc_get_volsw_range (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *ucontrol); -int snd_soc_limit_volume (struct snd_soc_codec *codec, +int snd_soc_limit_volume (struct snd_soc_card *card,const char *name,int max);int snd_soc_bytes_info (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_info *uinfo);
sound/soc/omap/rx51.c +1 -1
@@ -297,7 +297,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)dev_err (card->dev,"Failed to add TPA6130A2 controls\n" );return err; } -snd_soc_limit_volume (codec,"TPA6130A2 Headphone Playback Volume" ,42 ); +snd_soc_limit_volume (card,"TPA6130A2 Headphone Playback Volume" ,42 ); err =omap_mcbsp_st_add_controls (rtd,2 );if (err <0 ) {
sound/soc/soc-ops.c +4 -4
@@ -560,16 +560,16 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range);/** * snd_soc_limit_volume - Set new limit to an existing volume control. * -* @codec: where to look for the control +* @card: where to look for the control * @name: Name of the control * @max: new maximum limit * * Return 0 for success, else error. */ -int snd_soc_limit_volume (struct snd_soc_codec *codec, +int snd_soc_limit_volume (struct snd_soc_card *card,const char *name,int max) { -struct snd_card *card = codec->component.card->snd_card; +struct snd_card *snd_card = card->snd_card;struct snd_kcontrol *kctl;struct soc_mixer_control *mc;int found =0 ;
@@ -579,7 +579,7 @@ int snd_soc_limit_volume(struct snd_soc_codec *codec,if (unlikely (!name || max <=0 ))return -EINVAL ; -list_for_each_entry (kctl, &card->controls, list) { +list_for_each_entry (kctl, &snd_card->controls, list) {if (!strncmp (kctl->id.name, name,sizeof (kctl->id.name))) { found =1 ;break ;
Signature · 1 line
2.6.1
Mark Brown
maintainerQuoted 3 lines · Lars-Peter Clausen
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 nosnd_soc_codecis available.
It was actually in theory supposed to be a per device thing but indeed that's not the current implementation.