All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linuxppc-dev@ozlabs.org
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 2/5] aoa: fix toonie codec
Date: Tue, 18 Jul 2006 19:28:43 +0200	[thread overview]
Message-ID: <20060718173016.348627000@sipsolutions.net> (raw)
In-Reply-To: 20060718172841.046446000@sipsolutions.net

This patch fixes the toonie codec to be actually usable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

--- linux-2.6-fetch.orig/sound/aoa/codecs/snd-aoa-codec-toonie.c	2006-07-18 11:40:32.363476868 +0200
+++ linux-2.6-fetch/sound/aoa/codecs/snd-aoa-codec-toonie.c	2006-07-18 11:52:29.783476868 +0200
@@ -51,6 +51,13 @@ static struct transfer_info toonie_trans
 	{}
 };
 
+static int toonie_usable(struct codec_info_item *cii,
+			 struct transfer_info *ti,
+			 struct transfer_info *out)
+{
+	return 1;
+}
+
 #ifdef CONFIG_PM
 static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
 {
@@ -69,6 +76,7 @@ static struct codec_info toonie_codec_in
 	.sysclock_factor = 256,
 	.bus_factor = 64,
 	.owner = THIS_MODULE,
+	.usable = toonie_usable,
 #ifdef CONFIG_PM
 	.suspend = toonie_suspend,
 	.resume = toonie_resume,
@@ -79,19 +87,20 @@ static int toonie_init_codec(struct aoa_
 {
 	struct toonie *toonie = codec_to_toonie(codec);
 
+	/* nothing connected? what a joke! */
+	if (toonie->codec.connected != 1)
+		return -ENOTCONN;
+
 	if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
 		printk(KERN_ERR PFX "failed to create toonie snd device!\n");
 		return -ENODEV;
 	}
 
-	/* nothing connected? what a joke! */
-	if (toonie->codec.connected != 1)
-		return -ENOTCONN;
-
 	if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
 						     aoa_get_card(),
 						     &toonie_codec_info, toonie)) {
 		printk(KERN_ERR PFX "error creating toonie pcm\n");
+		snd_device_free(aoa_get_card(), toonie);
 		return -ENODEV;
 	}
 

--

  parent reply	other threads:[~2006-07-18 18:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18 17:28 [PATCH 0/5] powerpc sound, some more patches Johannes Berg
2006-07-18 17:28 ` [PATCH 1/5] aoa: feature gpio layer: fix IRQ access Johannes Berg
2006-07-18 17:28 ` Johannes Berg
2006-07-18 18:45   ` Benjamin Herrenschmidt
2006-07-18 18:45     ` Benjamin Herrenschmidt
2006-07-18 17:28 ` Johannes Berg [this message]
2006-07-18 17:28 ` [PATCH 2/5] aoa: fix toonie codec Johannes Berg
2006-07-18 17:28 ` [PATCH 3/5] make snd-powermac load even when it cant bind the device Johannes Berg
2006-07-18 17:28 ` Johannes Berg
2006-07-18 17:28 ` [PATCH 4/5] aoa: platform function gpio: ignore errors from functions that dont exist Johannes Berg
2006-07-18 17:28 ` Johannes Berg
2006-07-18 17:28 ` [PATCH 5/5] add MAINTAINERS entry for snd-aoa Johannes Berg
2006-07-18 17:28 ` Johannes Berg
2006-07-25 14:17 ` [PATCH 0/5] powerpc sound, some more patches Takashi Iwai
2006-07-25 14:17   ` [Alsa-devel] " Takashi Iwai
2006-07-25 15:13   ` Johannes Berg
2006-07-25 15:13     ` [Alsa-devel] " Johannes Berg
2006-07-25 15:21     ` Takashi Iwai
2006-07-25 15:21       ` [Alsa-devel] " Takashi Iwai
2006-08-05 16:09       ` Johannes Berg
2006-08-05 16:09         ` [Alsa-devel] " Johannes Berg
2006-07-25 21:52     ` Benjamin Herrenschmidt
2006-07-26 17:19       ` Johannes Berg
2006-07-26 17:19         ` [Alsa-devel] " Johannes Berg
2006-07-25 21:52     ` Benjamin Herrenschmidt

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=20060718173016.348627000@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=linuxppc-dev@ozlabs.org \
    /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.