Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Sep 1997 01:10:17 -0700
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        jonny@coppe.ufrj.br, gurney_j@resnet.uoregon.edu, multimedia@FreeBSD.ORG
Subject:   Re: More reports on the GUS PnP with Luigi's driver 
Message-ID:  <199709230810.BAA00712@rah.star-gate.com>
In-Reply-To: Your message of "Tue, 23 Sep 1997 08:35:53 %2B0200." <199709230635.IAA18612@labinfo.iet.unipi.it> 

next in thread | previous in thread | raw e-mail | index | archive | help
Don't worry , I think I know what to do 8)

Here is the doc  for the gus pnp chipset:

ftp://rah.star-gate.com/pub/iwpg.pdf

All the code necessary to set the gus pnp is in gus_wave.c and the
main entry routine to set the guspnp is IwaveOpen.

In the old sound driver guspnp18, right before probing for 
a gus , the driver calls IwaveOpen to set the gus pnp if it
finds one .
IwaveOpen does the pnp isolation and detection of the gus pnp however
since the PnP driver does this all whats needed is to pass all the
pnp information to IwaveOpen and set the card.


The following code sets the gus pnp:


	if (iw.pnprdp > 0 && iw.csn > 0) {
		IwavePnpSetCfg();
		IwavePnpActivate(AUDIO, ON);
		IwavePnpActivate(EXT, ON);
	}



	/* reset */
	outb(iw.igidxr, _URSTI);/* Pull reset */
	outb(iw.i8dp, 0x00);
	DELAY(1000 * 30);

	outb(iw.i8dp, 0x01);	/* Release reset */
	DELAY(1000 * 30);

	/* end of reset */


	IwaveMemCfg(NULL);


	tmp = IwaveRegPeek(IDECI);

	IwaveRegPoke(IDECI, tmp | 0x18);

	IwaveCodecMode(CODEC_MODE2);	/* Default codec mode  */
	IwaveRegPoke(ICMPTI, 0);

	outb(iw.igidxr, 0x99);
	tmp = inb(iw.i8dp);
	outb(iw.igidxr, 0x19);
	outb(iw.i8dp, tmp);



	IwaveCodecIrq(~CODEC_IRQ_ENABLE);

	Iwaveinitcodec();

	outb(iw.p2xr, 0x0c);	/* Disable line in, mic and line out */

	IwaveRegPoke(CLCI, 0x3f << 2);

	IwaveLineLevel(0, _CLOAI);
	IwaveLineLevel(0, _CROAI);

	IwaveLineMute(OFF, _CLOAI);
	IwaveLineMute(OFF, _CROAI);

	IwaveLineLevel(0, _CLLICI);
	IwaveLineLevel(0, _CRLICI);
	IwaveLineMute(OFF, _CLLICI);
	IwaveLineMute(OFF, _CRLICI);

	IwaveLineLevel(0, _CLDACI);
	IwaveLineLevel(0, _CRDACI);
	IwaveLineMute(ON, _CLDACI);
	IwaveLineMute(ON, _CRDACI);

	IwaveLineLevel(0, _CLLICI);
	IwaveLineLevel(0, _CRLICI);
	IwaveLineMute(ON, _CLLICI);
	IwaveLineMute(ON, _CRLICI);


	IwaveInputSource(LEFT_SOURCE, MIC_IN);
	IwaveInputSource(RIGHT_SOURCE, MIC_IN);

	outb(iw.pcodar, 0x9 | 0x40);
	outb(iw.cdatap, 0);
	IwaveCodecIrq(CODEC_IRQ_ENABLE);
	outb(iw.pcodar, _CFIG3I | 0x20);


	outb(iw.cdatap, 0xC2);	/* Enable Mode 3 IRQs & Synth  */

	outb(iw.igidxr, _URSTI);
	outb(iw.i8dp, GF1_SET | GF1_OUT_ENABLE | GF1_IRQ_ENABLE);
	DELAY(1000 * 30);
	iw.size_mem = IwaveMemSize();	/* Bytes of RAM in this mode */
	outb(iw.p2xr, 0xc);	/* enable output */
	IwaveRegPoke(CLCI, 0x3f << 2);

	IwaveCodecIrq(CODEC_IRQ_ENABLE);
	splx(flags);

	DELAY(1000 * 100);
	IwaveRegPoke(CPDFI, 0);

	return (TRUE);
---

	Cheers,
	Amancio


>From The Desk Of Luigi Rizzo :
> > The reason why Luigi's sound driver does not work with the gus pnp 
> > is because the gus pnp requires additional initialization beyond
> > PnP which currently the driver lacks.
> 
> exact. My driver _has never worked_ with the GusPnP, it merely has the
> hooks to recongize the card.
> 
> I have said this many times on the list but people seems to ignore
> emails, README files, etc :(
> 
> 	Cheers
> 	Luigi




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709230810.BAA00712>