From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264758AbUEKOZQ (ORCPT ); Tue, 11 May 2004 10:25:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264759AbUEKOZP (ORCPT ); Tue, 11 May 2004 10:25:15 -0400 Received: from ns.suse.de ([195.135.220.2]:25988 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S264758AbUEKOZG (ORCPT ); Tue, 11 May 2004 10:25:06 -0400 Date: Tue, 11 May 2004 16:25:05 +0200 Message-ID: From: Takashi Iwai To: Andreas Schwab Cc: linux-kernel@vger.kernel.org Subject: Re: 2.6.6: ALSA sound/ppc/keywest.c:84: tumbler: cannot initialize the MCS In-Reply-To: References: User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 13) (Rational FORTRAN) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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); }