aboutsummaryrefslogtreecommitdiff
path: root/sound/aoa/codecs/snd-aoa-codec-toonie.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-08-08 17:09:11 +1000
committerPaul Mackerras <paulus@samba.org>2006-08-08 17:09:11 +1000
commit32bc6e095d75233e7c87cc6fa0e07942b124d194 (patch)
tree8f83ef9a23d52d1305878b65dd98fc22b09b7f3e /sound/aoa/codecs/snd-aoa-codec-toonie.c
parent5cf13911b1e72707b6f0eb39b2d819ec6e343d76 (diff)
parent81b73dd92b97423b8f5324a59044da478c04f4c4 (diff)
Merge branch 'merge'
Diffstat (limited to 'sound/aoa/codecs/snd-aoa-codec-toonie.c')
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-toonie.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-toonie.c b/sound/aoa/codecs/snd-aoa-codec-toonie.c
index bcc555647e7..3c7d1d8a9a6 100644
--- a/sound/aoa/codecs/snd-aoa-codec-toonie.c
+++ b/sound/aoa/codecs/snd-aoa-codec-toonie.c
@@ -51,6 +51,13 @@ static struct transfer_info toonie_transfers[] = {
{}
};
+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_info = {
.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_codec *codec)
{
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;
}