Re: PCI device initialization.

From: Brian Gerst (bgerst@quark.vpplus.com)
Date: Thu Mar 30 2000 - 21:11:58 EST


Rui Sousa wrote:
>
> Brian Gerst wrote:
> > The joystick port on the SBLive is already enabled by default, it just
> > is not located at the legacy address (0x201). The register you speak of
> > I am guessing mirrors the port at 0x201, but this is only for DOS
> > compatability and is unnecessary.
>
> No. There is another register on the sound card (HCFG_JOYENABLE - Internal joystick enable)
> which is enabled if the chip revision is greater than 6. This is what is in the source
> and I whithout any documentation from Creative I don't really now what it
> does.

Ah, I have a rev 7 chip so it was enabled by default.

> The writing to the PCI configuration space register was another issue and
> I stopped doing it. I figured out that, as you say, it was unnecessary.
> My question now is (with the present unmodified joystick drivers, and if the sound
> card driver initializes the joystick device and reserves the IO ports) if the only
> thing needed to get the joystick working is to pass the IO port in the module options?

Don't let the sound card driver reserve the gameport IO region. I take
it you are using Creative's driver, because ALSA does the right thing.
ALSA also sets HCFG_JOYENABLE on older rev chips.

> In my case the joystick is at IO ports eff0 (the actual PCI register value is eff1), does a:
>
> insmod joy-analog js_an=eff0,x
>
> suffice?

Yes.

> > I have a patch for the joystick driver at
> > http://quark.vpplus.com/~bgerst/linux/diff-gameport-99p1.gz which can
> > autodetect PCI and PnP gameports. This is probably what you are looking
> > for.
>
> The part of auto detection and IO ports reservation (request_region()) is
> on the sound card driver, so there is a bit of a conflict here. If your
> patches make it into the kernel then I'll remove the code from the sound card
> driver. Your solution is definitely more general and more integrated with the
> joystick drivers.

Since the gameport on the SBLive is a seperate PCI device, the sound
driver need not manage its resources. Other sound cards are different,
especially those with "enhanced" gameports, which are usually buried in
the midst of the soundcard registers.

-- 

Brian Gerst

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:28 EST