* [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs
@ 2010-10-12 14:57 Mark Brown
2010-10-12 14:57 ` [PATCH 2/2] ASoC: Restore DAI ID specification for WM8994 Mark Brown
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Mark Brown @ 2010-10-12 14:57 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
The driver can specify a DAI ID number so use that.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/soc-core.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4f6ea8c..c20cf7f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3015,7 +3015,10 @@ int snd_soc_register_dais(struct device *dev,
}
dai->dev = dev;
- dai->id = i;
+ if (dai->driver->id)
+ dai->id = dai->driver->id;
+ else
+ dai->id = i;
dai->driver = &dai_drv[i];
if (!dai->driver->ops)
dai->driver->ops = &null_dai_ops;
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] ASoC: Restore DAI ID specification for WM8994 2010-10-12 14:57 [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs Mark Brown @ 2010-10-12 14:57 ` Mark Brown 2010-10-13 9:30 ` Liam Girdwood 2010-10-12 17:05 ` [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs Mark Brown 2010-10-12 18:49 ` Timur Tabi 2 siblings, 1 reply; 6+ messages in thread From: Mark Brown @ 2010-10-12 14:57 UTC (permalink / raw) To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown WM8994 relies on the DAIs having IDs that match the AIF numbers. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> --- sound/soc/codecs/wm8994.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index cb9338e..9ccda44 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3850,6 +3850,7 @@ static struct snd_soc_dai_ops wm8994_aif3_dai_ops = { static struct snd_soc_dai_driver wm8994_dai[] = { { .name = "wm8994-aif1", + .id = 1, .playback = { .stream_name = "AIF1 Playback", .channels_min = 2, @@ -3868,6 +3869,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = { }, { .name = "wm8994-aif2", + .id = 2, .playback = { .stream_name = "AIF2 Playback", .channels_min = 2, @@ -3886,6 +3888,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = { }, { .name = "wm8994-aif3", + .id = 3, .playback = { .stream_name = "AIF3 Playback", .channels_min = 2, -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: Restore DAI ID specification for WM8994 2010-10-12 14:57 ` [PATCH 2/2] ASoC: Restore DAI ID specification for WM8994 Mark Brown @ 2010-10-13 9:30 ` Liam Girdwood 0 siblings, 0 replies; 6+ messages in thread From: Liam Girdwood @ 2010-10-13 9:30 UTC (permalink / raw) To: Mark Brown; +Cc: alsa-devel, patches On Tue, 2010-10-12 at 15:57 +0100, Mark Brown wrote: > WM8994 relies on the DAIs having IDs that match the AIF numbers. > > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> > --- > sound/soc/codecs/wm8994.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c > index cb9338e..9ccda44 100644 > --- a/sound/soc/codecs/wm8994.c > +++ b/sound/soc/codecs/wm8994.c > @@ -3850,6 +3850,7 @@ static struct snd_soc_dai_ops wm8994_aif3_dai_ops = { > static struct snd_soc_dai_driver wm8994_dai[] = { > { > .name = "wm8994-aif1", > + .id = 1, > .playback = { > .stream_name = "AIF1 Playback", > .channels_min = 2, > @@ -3868,6 +3869,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = { > }, > { > .name = "wm8994-aif2", > + .id = 2, > .playback = { > .stream_name = "AIF2 Playback", > .channels_min = 2, > @@ -3886,6 +3888,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = { > }, > { > .name = "wm8994-aif3", > + .id = 3, > .playback = { > .stream_name = "AIF3 Playback", > .channels_min = 2, Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> -- Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs 2010-10-12 14:57 [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs Mark Brown 2010-10-12 14:57 ` [PATCH 2/2] ASoC: Restore DAI ID specification for WM8994 Mark Brown @ 2010-10-12 17:05 ` Mark Brown 2010-10-12 18:49 ` Timur Tabi 2 siblings, 0 replies; 6+ messages in thread From: Mark Brown @ 2010-10-12 17:05 UTC (permalink / raw) To: Liam Girdwood; +Cc: alsa-devel, patches On Tue, Oct 12, 2010 at 03:57:55PM +0100, Mark Brown wrote: > dai->dev = dev; > - dai->id = i; > + if (dai->driver->id) > + dai->id = dai->driver->id; > + else > + dai->id = i; > dai->driver = &dai_drv[i]; Sorry, sent the wrong version of this - obviously the new check should go after the assignment. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs 2010-10-12 14:57 [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs Mark Brown 2010-10-12 14:57 ` [PATCH 2/2] ASoC: Restore DAI ID specification for WM8994 Mark Brown 2010-10-12 17:05 ` [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs Mark Brown @ 2010-10-12 18:49 ` Timur Tabi 2010-10-12 21:33 ` Mark Brown 2 siblings, 1 reply; 6+ messages in thread From: Timur Tabi @ 2010-10-12 18:49 UTC (permalink / raw) To: Mark Brown; +Cc: alsa-devel, patches, Liam Girdwood On Tue, Oct 12, 2010 at 9:57 AM, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: > The driver can specify a DAI ID number so use that. > > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> > --- > sound/soc/soc-core.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c > index 4f6ea8c..c20cf7f 100644 > --- a/sound/soc/soc-core.c > +++ b/sound/soc/soc-core.c > @@ -3015,7 +3015,10 @@ int snd_soc_register_dais(struct device *dev, > } > > dai->dev = dev; > - dai->id = i; > + if (dai->driver->id) > + dai->id = dai->driver->id; > + else > + dai->id = i; I haven't looked at the code, but doesn't this assume that a DAI ID of 0 is invalid? I have a suspicion I need to retest my driver to make sure it still works. -- Timur Tabi Linux kernel developer at Freescale ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs 2010-10-12 18:49 ` Timur Tabi @ 2010-10-12 21:33 ` Mark Brown 0 siblings, 0 replies; 6+ messages in thread From: Mark Brown @ 2010-10-12 21:33 UTC (permalink / raw) To: Timur Tabi; +Cc: alsa-devel, patches, Liam Girdwood On Tue, Oct 12, 2010 at 01:49:52PM -0500, Timur Tabi wrote: > On Tue, Oct 12, 2010 at 9:57 AM, Mark Brown > > - dai->id = i; > > + if (dai->driver->id) > > + dai->id = dai->driver->id; > > + else > > + dai->id = i; > I haven't looked at the code, but doesn't this assume that a DAI ID of > 0 is invalid? > I have a suspicion I need to retest my driver to make sure it still works. This makes no change to the behaviour when the DAI ID is zero. Previously it would be overwritten with i, with the new code it is still overwritten with i. You can specify a DAI ID of zero, but only for the first DAI. This is a limitation but avoids having to manually set the DAI ID in the simple case where they're all numbered sequentially from zero. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-10-13 9:30 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-10-12 14:57 [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs Mark Brown 2010-10-12 14:57 ` [PATCH 2/2] ASoC: Restore DAI ID specification for WM8994 Mark Brown 2010-10-13 9:30 ` Liam Girdwood 2010-10-12 17:05 ` [PATCH 1/2] ASoC: Pay attention to driver supplied DAI IDs Mark Brown 2010-10-12 18:49 ` Timur Tabi 2010-10-12 21:33 ` Mark Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).