Re: PCI device initialization.

From: Rui Sousa (rsousa@grad.physics.sunysb.edu)
Date: Thu Mar 30 2000 - 20:15:16 EST


Brian Gerst wrote:
>
> Rui Sousa wrote:
> > The sound card has a register to enable the joystick port so I need to know
> > where the sound card IO ports begin (and maybe to make use of a spinlock that
> > serializes hardware registers access).
> >
> > Giving it a little more thought I will probably just set the register from the
> > sound card initialization, it's much easier and should work just fine...
>
> 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.

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?

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?
  
> 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.

Thank you for your help,

Rui Sousa

-
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