Re: 2.6.6: ALSA sound/ppc/keywest.c:84: tumbler: cannot initialize the MCS
From: Takashi Iwai
Date: Tue May 11 2004 - 09:26:23 EST
At Tue, 11 May 2004 00:28:47 +0200,
Andreas Schwab wrote:
>
> I've never been able to get a working sound with ALSA after booting my
> iBook G3 (dmasound is working fine). Any idea what's wrong with
> snd-powermac?
does the attached patch work? it's a partial patch from the latest
ALSA cvs tree.
the problem seems like the initialization of i2c-keywest.
Takashi
--- linux/sound/ppc/keywest.c 2004-04-06 23:51:33.000000000 +0200
+++ linux/sound/ppc/keywest.c 2004-04-23 16:13:03.000000000 +0200
@@ -79,12 +79,7 @@
new_client->id = keywest_ctx->id++; /* Automatically unique */
keywest_ctx->client = new_client;
-
- if ((err = keywest_ctx->init_client(keywest_ctx)) < 0) {
- snd_printk(KERN_ERR "tumbler: cannot initialize the MCS\n");
- goto __err;
- }
-
+
/* Tell the i2c layer a new client has arrived */
if (i2c_attach_client(new_client)) {
snd_printk(KERN_ERR "tumbler: cannot attach i2c client\n");
@@ -121,6 +116,17 @@
}
}
+int __init snd_pmac_tumbler_post_init(void)
+{
+ int err;
+
+ if ((err = keywest_ctx->init_client(keywest_ctx)) < 0) {
+ snd_printk(KERN_ERR "tumbler: %i :cannot initialize the MCS\n", err);
+ return err;
+ }
+ return 0;
+}
+
/* exported */
int __init snd_pmac_keywest_init(pmac_keywest_t *i2c)
{
--- linux/sound/ppc/pmac.h 2004-04-06 23:51:33.000000000 +0200
+++ linux/sound/ppc/pmac.h 2004-04-23 16:13:03.000000000 +0200
@@ -180,6 +180,7 @@
int snd_pmac_burgundy_init(pmac_t *chip);
int snd_pmac_daca_init(pmac_t *chip);
int snd_pmac_tumbler_init(pmac_t *chip);
+int snd_pmac_tumbler_post_init(void);
/* i2c functions */
typedef struct snd_pmac_keywest {
--- linux/sound/ppc/powermac.c 2004-04-06 23:51:33.000000000 +0200
+++ linux/sound/ppc/powermac.c 2004-04-23 16:13:03.000000000 +0200
@@ -104,7 +104,7 @@
sprintf(card->shortname, "PowerMac %s", name_ext);
sprintf(card->longname, "%s (Dev %d) Sub-frame %d",
card->shortname, chip->device_id, chip->subframe);
- if ((err = snd_pmac_tumbler_init(chip)) < 0)
+ if ( snd_pmac_tumbler_init(chip) < 0 || snd_pmac_tumbler_post_init() < 0)
goto __error;
break;
case PMAC_AWACS:
--- linux/sound/ppc/tumbler.c 2004-04-06 23:51:33.000000000 +0200
+++ linux/sound/ppc/tumbler.c 2004-04-23 16:14:45.000000000 +0200
@@ -684,6 +684,8 @@
static int snapper_set_capture_source(pmac_tumbler_t *mix)
{
+ if (! mix->i2c.client)
+ return -ENODEV;
return snd_pmac_keywest_write_byte(&mix->i2c, TAS_REG_ACS,
mix->capture_source ? 2 : 0);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/