From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>,
alsa-devel@alsa-project.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 13/13] ASoC: tosa: move gpio probing to machine callbacks
Date: Tue, 25 Nov 2008 15:44:49 +0000 [thread overview]
Message-ID: <1227627889-8373-13-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1227627889-8373-12-git-send-email-broonie@opensource.wolfsonmicro.com>
From: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/pxa/tosa.c | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index 9d9be5a..48242b3 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -230,10 +230,32 @@ static struct snd_soc_dai_link tosa_dai[] = {
},
};
+static int tosa_probe(struct platform_device *dev)
+{
+ int ret;
+
+ ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
+ if (ret)
+ return ret;
+ ret = gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
+ if (ret)
+ gpio_free(TOSA_GPIO_L_MUTE);
+
+ return ret;
+}
+
+static int tosa_remove(struct platform_device *dev)
+{
+ gpio_free(TOSA_GPIO_L_MUTE);
+ return 0;
+}
+
static struct snd_soc_card tosa = {
.name = "Tosa",
.dai_link = tosa_dai,
.num_links = ARRAY_SIZE(tosa_dai),
+ .probe = tosa_probe,
+ .remove = tosa_remove,
};
static struct snd_soc_device tosa_snd_devdata = {
@@ -251,11 +273,6 @@ static int __init tosa_init(void)
if (!machine_is_tosa())
return -ENODEV;
- ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
- if (ret)
- return ret;
- gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
-
tosa_snd_device = platform_device_alloc("soc-audio", -1);
if (!tosa_snd_device) {
ret = -ENOMEM;
@@ -272,15 +289,12 @@ static int __init tosa_init(void)
platform_device_put(tosa_snd_device);
err_alloc:
- gpio_free(TOSA_GPIO_L_MUTE);
-
return ret;
}
static void __exit tosa_exit(void)
{
platform_device_unregister(tosa_snd_device);
- gpio_free(TOSA_GPIO_L_MUTE);
}
module_init(tosa_init);
--
1.5.6.5
next prev parent reply other threads:[~2008-11-25 15:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-25 15:43 [PATCH 00/13] ASoC updates Mark Brown
2008-11-25 15:44 ` [PATCH 01/13] ASoC: Use supplied DAI for WM9713 rather than substream Mark Brown
2008-11-25 15:44 ` [PATCH 02/13] ASoC: TWL4030: Disable soft-volume Mark Brown
2008-11-25 15:44 ` [PATCH 03/13] ASoC: TWL4030: Change the Master volume control to TLV Mark Brown
2008-11-25 15:44 ` [PATCH 04/13] ASoC: TWL4030: Add CGAIN volume control Mark Brown
2008-11-25 15:44 ` [PATCH 05/13] ASoC: TWL4030: Add helper function for output gain controls Mark Brown
2008-11-25 15:44 ` [PATCH 06/13] ASoC: Remove DAI type information Mark Brown
2008-11-25 15:44 ` [PATCH 07/13] ASoC: Flag AD1980 as an AC97 interface Mark Brown
2008-11-25 15:44 ` [PATCH 08/13] ASoC: Lower priority of resume work logging Mark Brown
2008-11-25 15:44 ` [PATCH 09/13] ASoC: OMAP: Apply channel constrains to N810 machine driver Mark Brown
2008-11-25 15:44 ` [PATCH 10/13] ASoC: OMAP: Add support for mono audio links in McBSP DAI Mark Brown
2008-11-25 15:44 ` [PATCH 11/13] ASoC: Fix TWL4030 Kconfig dependency Mark Brown
2008-11-25 15:44 ` [PATCH 12/13] ASoC: Add support for TI SDP3430 Mark Brown
2008-11-25 15:44 ` Mark Brown [this message]
2008-11-25 15:58 ` [PATCH 00/13] ASoC updates Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1227627889-8373-13-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=dbaryshkov@gmail.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.