From: Marek Vasut <marek.vasut@gmail.com>
To: alsa-devel@alsa-project.org, Mark Brown <broonie@sirena.org.uk>
Subject: Palm27x-asoc: fix it to work without jack gpio specified
Date: Mon, 1 Jun 2009 22:30:58 +0200 [thread overview]
Message-ID: <200906012230.58977.marek.vasut@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 93 bytes --]
Hi,
the patch follows. The problem was with palmz72 which doesn't have the jack
detection.
[-- Attachment #2: 0001-Palm27x-aSoC-Make-it-work-without-jack-GPIO-specifi.patch --]
[-- Type: text/x-diff, Size: 2533 bytes --]
From 4b569013e47b03199d7efda812cb329736723f0a Mon Sep 17 00:00:00 2001
From: Marek Vasut <marek.vasut@gmail.com>
Date: Mon, 1 Jun 2009 17:57:15 +0200
Subject: [PATCH 1/2] Palm27x-aSoC: Make it work without jack GPIO specified
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
sound/soc/pxa/palm27x.c | 41 +++++++++++++++++++++--------------------
1 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index e6102fd..628e13e 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -204,25 +204,22 @@ static int palm27x_asoc_probe(struct platform_device *pdev)
{
int ret;
- if (!(machine_is_palmtx() || machine_is_palmt5() ||
- machine_is_palmld() || machine_is_palmte2()))
- return -ENODEV;
-
- if (pdev->dev.platform_data)
+ if (pdev->dev.platform_data) {
palm27x_ep_gpio = ((struct palm27x_asoc_info *)
(pdev->dev.platform_data))->jack_gpio;
- ret = gpio_request(palm27x_ep_gpio, "Headphone Jack");
- if (ret)
- return ret;
- ret = gpio_direction_input(palm27x_ep_gpio);
- if (ret)
- goto err_alloc;
-
- if (request_irq(gpio_to_irq(palm27x_ep_gpio), palm27x_interrupt,
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
- "Headphone jack", NULL))
- goto err_alloc;
+ ret = gpio_request(palm27x_ep_gpio, "Headphone Jack");
+ if (ret)
+ return ret;
+ ret = gpio_direction_input(palm27x_ep_gpio);
+ if (ret)
+ goto err_alloc;
+
+ if (request_irq(gpio_to_irq(palm27x_ep_gpio), palm27x_interrupt,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ "Headphone jack", NULL))
+ goto err_alloc;
+ }
palm27x_snd_device = platform_device_alloc("soc-audio", -1);
if (!palm27x_snd_device) {
@@ -242,17 +239,21 @@ static int palm27x_asoc_probe(struct platform_device *pdev)
put_device:
platform_device_put(palm27x_snd_device);
err_dev:
- free_irq(gpio_to_irq(palm27x_ep_gpio), NULL);
+ if (pdev->dev.platform_data)
+ free_irq(gpio_to_irq(palm27x_ep_gpio), NULL);
err_alloc:
- gpio_free(palm27x_ep_gpio);
+ if (pdev->dev.platform_data)
+ gpio_free(palm27x_ep_gpio);
return ret;
}
static int __devexit palm27x_asoc_remove(struct platform_device *pdev)
{
- free_irq(gpio_to_irq(palm27x_ep_gpio), NULL);
- gpio_free(palm27x_ep_gpio);
+ if (pdev->dev.platform_data) {
+ free_irq(gpio_to_irq(palm27x_ep_gpio), NULL);
+ gpio_free(palm27x_ep_gpio);
+ }
platform_device_unregister(palm27x_snd_device);
return 0;
}
--
1.6.2.1
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next reply other threads:[~2009-06-01 20:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-01 20:30 Marek Vasut [this message]
2009-06-01 22:58 ` Palm27x-asoc: fix it to work without jack gpio specified Mark Brown
2009-06-02 0:11 ` Marek Vasut
2009-06-02 9:48 ` Mark Brown
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=200906012230.58977.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@sirena.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox