From: Takashi Iwai Subject: Re: Changed ens1370.c to enable Suspend ens1371 Date: Mon, 14 Nov 2005 18:02:59 +0100 Message-ID: References: <4374DBBC.9040100@gmx.de> <43787D8A.5090907@gmx.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <43787D8A.5090907@gmx.de> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: "Kurt J. Bosch" Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Mon, 14 Nov 2005 13:05:30 +0100, Kurt J. Bosch wrote: > > Summary: Fix missing suspend/resume-code for ens1371 > > This patch fixes missing suspend/resume-code for snd-ens1371 > (but not for snd-ens1370) > > Signed-off-by: Kurt J. Bosch > > --- 2.6.10-5-686/ens1370.org.c 2004-12-24 22:35:24.000000000 +0100 > +++ 2.6.10-5-686/ens1370.c 2005-11-14 11:36:58.000000000 +0100 > @@ -19,6 +19,14 @@ > * > */ > > +/* Power-Management-Code ( CONFIG_PM ) > + * for ens1371 only ( FIXME ) > + * derived from cs4281.c, atiixp.c and via82xx.c > + * using http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c1540.htm > + * by Kurt J. Bosch > + */ > + > + > #include > #include > #include > @@ -1875,6 +1883,129 @@ > }; > #endif > > +static void snd_ensoniq_chip_init(ensoniq_t * ensoniq) > +{ > +#ifdef CHIP1371 > + int idx; > + struct pci_dev *pci = ensoniq->pci; > +#endif > +// this code was part of snd_ensoniq_create > +#ifdef CHIP1370 > + outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL)); > + outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL)); > + outl(ES_MEM_PAGEO(ES_PAGE_ADC), ES_REG(ensoniq, MEM_PAGE)); > + outl(ensoniq->dma_bug.addr, ES_REG(ensoniq, PHANTOM_FRAME)); > + outl(0, ES_REG(ensoniq, PHANTOM_COUNT)); > +#else > + outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL)); > + outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL)); > + outl(0, ES_REG(ensoniq, 1371_LEGACY)); > + for (idx = 0; es1371_ac97_reset_hack[idx].vid != (unsigned short)PCI_ANY_ID; idx++) > + if (pci->vendor == es1371_ac97_reset_hack[idx].vid && > + pci->device == es1371_ac97_reset_hack[idx].did && > + ensoniq->rev == es1371_ac97_reset_hack[idx].rev) { > + unsigned long tmo; > + signed long tmo2; > + > + ensoniq->cssr |= ES_1371_ST_AC97_RST; ensoniq->cssr shouldn't be overridden here. > +static int snd_ensoniq_resume (snd_card_t * card, > + unsigned int state) > +{ > + ensoniq_t *ensoniq = card->pm_private_data; > + > + pci_enable_device(ensoniq->pci); > + pci_set_power_state(ensoniq->pci, 0); > + pci_set_master(ensoniq->pci); Don't mix up tab and spaces. > +#ifdef CHIP1371 /* FIXME - this should apply to 1370 too as soon as 1370-suspend-code is written by some one :) */ > + snd_card_set_pm_callback(card, snd_ensoniq_suspend, snd_ensoniq_resume, ensoniq); > +#endif It's still better than nothing. Better to remove this ifdef. > @@ -2364,6 +2432,9 @@ > .id_table = snd_audiopci_ids, > .probe = snd_audiopci_probe, > .remove = __devexit_p(snd_audiopci_remove), > +#ifdef CHIP1371 /* FIXME - this should apply to 1370 too as soon as 1370-suspend-code is written by some one :) */ > + SND_PCI_PM_CALLBACKS > +#endif Ditto. Takashi ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php