* [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates
@ 2012-12-28 21:15 Mike Dunn
2012-12-28 21:15 ` [PATCH 1/2] ASoC: palm27x: fix widgets and routes in dai_link init Mike Dunn
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Mike Dunn @ 2012-12-28 21:15 UTC (permalink / raw)
To: alsa-devel
Cc: Marek Vasut, Mike Dunn, Mark Brown, Haojian Zhuang, Eric Miao,
Robert Jarzmik, Liam Girdwood
Hi,
A fix and an update to the palm27x machine driver.
Happy New Year!
Mike Dunn (2):
ASoC: palm27x: fix widgets and routes in dai_link init
ASoC: palm27x: register card in platform_driver probe
sound/soc/pxa/palm27x.c | 36 +++++++++---------------------------
1 files changed, 9 insertions(+), 27 deletions(-)
--
1.7.8.6
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ASoC: palm27x: fix widgets and routes in dai_link init
2012-12-28 21:15 [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates Mike Dunn
@ 2012-12-28 21:15 ` Mike Dunn
2012-12-28 21:16 ` [PATCH 2/2] ASoC: palm27x: register card in platform_driver probe Mike Dunn
2013-01-02 13:06 ` [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mike Dunn @ 2012-12-28 21:15 UTC (permalink / raw)
To: alsa-devel
Cc: Marek Vasut, Mike Dunn, Mark Brown, Haojian Zhuang, Eric Miao,
Robert Jarzmik, Liam Girdwood
ASoC core code now handles creation of controls and routing based on contents of
struct snd_soc_card, so remove calls to snd_soc_dapm_new_controls() and
snd_soc_dapm_add_routes() from the snd_soc_dai_link init function, and add
widget and route definitions to struct snd_soc_card.
Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
sound/soc/pxa/palm27x.c | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index 2074e2d..bb062e6 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -79,17 +79,6 @@ static int palm27x_ac97_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_dapm_context *dapm = &codec->dapm;
int err;
- /* add palm27x specific widgets */
- err = snd_soc_dapm_new_controls(dapm, palm27x_dapm_widgets,
- ARRAY_SIZE(palm27x_dapm_widgets));
- if (err)
- return err;
-
- /* set up palm27x specific audio path audio_map */
- err = snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
- if (err)
- return err;
-
/* connected pins */
if (machine_is_palmld())
snd_soc_dapm_enable_pin(dapm, "MIC1");
@@ -149,6 +138,10 @@ static struct snd_soc_card palm27x_asoc = {
.owner = THIS_MODULE,
.dai_link = palm27x_dai,
.num_links = ARRAY_SIZE(palm27x_dai),
+ .dapm_widgets = palm27x_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(palm27x_dapm_widgets),
+ .dapm_routes = audio_map,
+ .num_dapm_routes = ARRAY_SIZE(audio_map)
};
static struct platform_device *palm27x_snd_device;
--
1.7.8.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ASoC: palm27x: register card in platform_driver probe
2012-12-28 21:15 [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates Mike Dunn
2012-12-28 21:15 ` [PATCH 1/2] ASoC: palm27x: fix widgets and routes in dai_link init Mike Dunn
@ 2012-12-28 21:16 ` Mike Dunn
2013-01-02 13:06 ` [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mike Dunn @ 2012-12-28 21:16 UTC (permalink / raw)
To: alsa-devel
Cc: Marek Vasut, Mike Dunn, Mark Brown, Haojian Zhuang, Eric Miao,
Robert Jarzmik, Liam Girdwood
Remove creation of an soc-audio device from the machine platform_driver probe
function, and add a call to snd_soc_register_card() instead.
The current code still works, but this mechanism has been deprecated, if I'm not
mistaken. The ASoC core code produces the warning "ASoC: machine Palm/PXA27x
should use snd_soc_register_card()"
Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
sound/soc/pxa/palm27x.c | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index bb062e6..d822eab 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -144,8 +144,6 @@ static struct snd_soc_card palm27x_asoc = {
.num_dapm_routes = ARRAY_SIZE(audio_map)
};
-static struct platform_device *palm27x_snd_device;
-
static int palm27x_asoc_probe(struct platform_device *pdev)
{
int ret;
@@ -162,21 +160,12 @@ static int palm27x_asoc_probe(struct platform_device *pdev)
hs_jack_gpios[0].gpio = ((struct palm27x_asoc_info *)
(pdev->dev.platform_data))->jack_gpio;
- palm27x_snd_device = platform_device_alloc("soc-audio", -1);
- if (!palm27x_snd_device)
- return -ENOMEM;
-
- platform_set_drvdata(palm27x_snd_device, &palm27x_asoc);
- ret = platform_device_add(palm27x_snd_device);
-
- if (ret != 0)
- goto put_device;
-
- return 0;
-
-put_device:
- platform_device_put(palm27x_snd_device);
+ palm27x_asoc.dev = &pdev->dev;
+ ret = snd_soc_register_card(&palm27x_asoc);
+ if (ret)
+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+ ret);
return ret;
}
--
1.7.8.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates
2012-12-28 21:15 [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates Mike Dunn
2012-12-28 21:15 ` [PATCH 1/2] ASoC: palm27x: fix widgets and routes in dai_link init Mike Dunn
2012-12-28 21:16 ` [PATCH 2/2] ASoC: palm27x: register card in platform_driver probe Mike Dunn
@ 2013-01-02 13:06 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-01-02 13:06 UTC (permalink / raw)
To: Mike Dunn
Cc: Marek Vasut, alsa-devel, Eric Miao, Haojian Zhuang,
Robert Jarzmik, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 150 bytes --]
On Fri, Dec 28, 2012 at 01:15:58PM -0800, Mike Dunn wrote:
> Hi,
>
> A fix and an update to the palm27x machine driver.
Applied both, thanks.
[-- 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] 4+ messages in thread
end of thread, other threads:[~2013-01-02 13:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-28 21:15 [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates Mike Dunn
2012-12-28 21:15 ` [PATCH 1/2] ASoC: palm27x: fix widgets and routes in dai_link init Mike Dunn
2012-12-28 21:16 ` [PATCH 2/2] ASoC: palm27x: register card in platform_driver probe Mike Dunn
2013-01-02 13:06 ` [PATCH 0/2] ASoC: palm27x: machine driver fixes and updates 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.