* [PATCH] ASoC: core: Fix snd_soc_add_card_controls to pass correct data
@ 2012-02-14 22:56 Stephen Warren
2012-02-14 23:17 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2012-02-14 22:56 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Stephen Warren
Commit 022658b "ASoC: core: Add support for DAI and machine kcontrols."
created new functions to create controls for cards, codecs, platforms,
and DAIs. The new snd_soc_add_card_controls() passed the wrong "data" to
utility function snd_soc_add_controls(); it should be passing a codec,
but instead ended up passing the soc_card. Fix this.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
sound/soc/soc-core.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 8bd9995..e44b6f6 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2095,9 +2095,13 @@ int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
const struct snd_kcontrol_new *controls, int num_controls)
{
struct snd_card *card = soc_card->snd_card;
+ struct snd_soc_codec *codec =
+ list_first_entry(&soc_card->codec_dev_list,
+ struct snd_soc_codec,
+ card_list);
return snd_soc_add_controls(card, soc_card->dev, controls, num_controls,
- NULL, soc_card);
+ NULL, codec);
}
EXPORT_SYMBOL_GPL(snd_soc_add_card_controls);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: core: Fix snd_soc_add_card_controls to pass correct data
2012-02-14 22:56 [PATCH] ASoC: core: Fix snd_soc_add_card_controls to pass correct data Stephen Warren
@ 2012-02-14 23:17 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-02-14 23:17 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 976 bytes --]
On Tue, Feb 14, 2012 at 03:56:33PM -0700, Stephen Warren wrote:
> Commit 022658b "ASoC: core: Add support for DAI and machine kcontrols."
> created new functions to create controls for cards, codecs, platforms,
> and DAIs. The new snd_soc_add_card_controls() passed the wrong "data" to
> utility function snd_soc_add_controls(); it should be passing a codec,
> but instead ended up passing the soc_card. Fix this.
Well, sort of. The idea with Liam's commit was to split things out so
that card operations got given a card so the argument change was
intentional. What's gone wrong is that things like PIN_SWITCH() (which
is only ever used by cards) weren't updated to match so they still
expect to find a CODEC there. This'll quite probably have broken some
other machine specific controls too.
I'll send a patch for PIN_SWITCH later today but it looks like we need
an audit of all the drivers using non-CODEC adds to make sure they don't
assume a CODEC in the callbacks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-14 23:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14 22:56 [PATCH] ASoC: core: Fix snd_soc_add_card_controls to pass correct data Stephen Warren
2012-02-14 23:17 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.