aboutsummaryrefslogtreecommitdiffstats
path: root/sound/aoa
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-08-08 03:09:11 -0400
committerPaul Mackerras <paulus@samba.org>2006-08-08 03:09:11 -0400
commit32bc6e095d75233e7c87cc6fa0e07942b124d194 (patch)
tree8f83ef9a23d52d1305878b65dd98fc22b09b7f3e /sound/aoa
parent5cf13911b1e72707b6f0eb39b2d819ec6e343d76 (diff)
parent81b73dd92b97423b8f5324a59044da478c04f4c4 (diff)
Merge branch 'merge'
Diffstat (limited to 'sound/aoa')
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-toonie.c17
-rw-r--r--sound/aoa/core/snd-aoa-gpio-feature.c7
-rw-r--r--sound/aoa/core/snd-aoa-gpio-pmf.c2
3 files changed, 19 insertions, 7 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-toonie.c b/sound/aoa/codecs/snd-aoa-codec-toonie.c
index bcc555647e79..3c7d1d8a9a6f 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[] = {
51 {} 51 {}
52}; 52};
53 53
54static int toonie_usable(struct codec_info_item *cii,
55 struct transfer_info *ti,
56 struct transfer_info *out)
57{
58 return 1;
59}
60
54#ifdef CONFIG_PM 61#ifdef CONFIG_PM
55static int toonie_suspend(struct codec_info_item *cii, pm_message_t state) 62static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
56{ 63{
@@ -69,6 +76,7 @@ static struct codec_info toonie_codec_info = {
69 .sysclock_factor = 256, 76 .sysclock_factor = 256,
70 .bus_factor = 64, 77 .bus_factor = 64,
71 .owner = THIS_MODULE, 78 .owner = THIS_MODULE,
79 .usable = toonie_usable,
72#ifdef CONFIG_PM 80#ifdef CONFIG_PM
73 .suspend = toonie_suspend, 81 .suspend = toonie_suspend,
74 .resume = toonie_resume, 82 .resume = toonie_resume,
@@ -79,19 +87,20 @@ static int toonie_init_codec(struct aoa_codec *codec)
79{ 87{
80 struct toonie *toonie = codec_to_toonie(codec); 88 struct toonie *toonie = codec_to_toonie(codec);
81 89
90 /* nothing connected? what a joke! */
91 if (toonie->codec.connected != 1)
92 return -ENOTCONN;
93
82 if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) { 94 if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
83 printk(KERN_ERR PFX "failed to create toonie snd device!\n"); 95 printk(KERN_ERR PFX "failed to create toonie snd device!\n");
84 return -ENODEV; 96 return -ENODEV;
85 } 97 }
86 98
87 /* nothing connected? what a joke! */
88 if (toonie->codec.connected != 1)
89 return -ENOTCONN;
90
91 if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev, 99 if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
92 aoa_get_card(), 100 aoa_get_card(),
93 &toonie_codec_info, toonie)) { 101 &toonie_codec_info, toonie)) {
94 printk(KERN_ERR PFX "error creating toonie pcm\n"); 102 printk(KERN_ERR PFX "error creating toonie pcm\n");
103 snd_device_free(aoa_get_card(), toonie);
95 return -ENODEV; 104 return -ENODEV;
96 } 105 }
97 106
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
index 2ab55330b31c..7c26089527f6 100644
--- a/sound/aoa/core/snd-aoa-gpio-feature.c
+++ b/sound/aoa/core/snd-aoa-gpio-feature.c
@@ -112,7 +112,10 @@ static struct device_node *get_gpio(char *name,
112 112
113static void get_irq(struct device_node * np, int *irqptr) 113static void get_irq(struct device_node * np, int *irqptr)
114{ 114{
115 *irqptr = irq_of_parse_and_map(np, 0); 115 if (np)
116 *irqptr = irq_of_parse_and_map(np, 0);
117 else
118 *irqptr = NO_IRQ;
116} 119}
117 120
118/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ 121/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
@@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_runtime *rt,
322 return -EINVAL; 325 return -EINVAL;
323 } 326 }
324 327
325 if (irq == -1) 328 if (irq == NO_IRQ)
326 return -ENODEV; 329 return -ENODEV;
327 330
328 mutex_lock(&notif->mutex); 331 mutex_lock(&notif->mutex);
diff --git a/sound/aoa/core/snd-aoa-gpio-pmf.c b/sound/aoa/core/snd-aoa-gpio-pmf.c
index 3d57fd1aec4b..2836c3218391 100644
--- a/sound/aoa/core/snd-aoa-gpio-pmf.c
+++ b/sound/aoa/core/snd-aoa-gpio-pmf.c
@@ -18,7 +18,7 @@ static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
18 \ 18 \
19 if (unlikely(!rt)) return; \ 19 if (unlikely(!rt)) return; \
20 rc = pmf_call_function(rt->node, #name "-mute", &args); \ 20 rc = pmf_call_function(rt->node, #name "-mute", &args); \
21 if (rc) \ 21 if (rc && rc != -ENODEV) \
22 printk(KERN_WARNING "pmf_gpio_set_" #name \ 22 printk(KERN_WARNING "pmf_gpio_set_" #name \
23 " failed, rc: %d\n", rc); \ 23 " failed, rc: %d\n", rc); \
24 rt->implementation_private &= ~(1<<bit); \ 24 rt->implementation_private &= ~(1<<bit); \