public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Intel ICH - sound/pci/intel8x0.c
@ 2004-09-06  8:31 Matthieu Castet
  2004-09-06 11:27 ` Alan Cox
  0 siblings, 1 reply; 15+ messages in thread
From: Matthieu Castet @ 2004-09-06  8:31 UTC (permalink / raw)
  To: linux-kernel

> On Sul, 2004-09-05 at 22:24, Jon Smirl wrote:
> > I'd don't know enough about the LPC bridge chip to know what the
> > correct answer is for this. Right now I tend to think that the PCI
> > driver should own the bridge chip. If not the PCI driver then there
> > should be an explicit bridge driver. I don' think it is correct that a
> > joystick driver is attaching to a bridge chip given the simple fact
> 
> Nobody else currently needs to attach to it so why make life needlessly
> complicated.
> 
heu hw_random and i8xx_tco use also the lpc bridge, but hopefully they
don't attach it.
> > that all legacy IO - joystick, PS/2, parallel, serial, etc is located
> > off from that same bridge chip.
> > 
> > Matthieu's comments about using PNP for this seem to make sense. Are
> > we missing implementation of an ACPI feature for controlling these
> > ports?
> 
> See previous discussion. We have isapnp, biospnp but not great acpi pnp.
That why I start a patch implementing acpi PnP, but nobody seem
interested :(
> None of them help because you need to deal with hotplug.
Heu, I don't understant why you need to deal with hotplug ?
PnP modules works like pci modules. You make a list of know id, and then
you call {pci,pnp}_{port,irq,dma}_{start,len,...} to access resource of
the device.
Hotplug is need like for pci modules to autoload it.

Also using the LPC brigde the alsa driver don't know about the io port
and irq resource you had to pass them via modules option.
For the gameport, alsa driver use a hardcode value of 0x200 that is
wrong on my computer (it is 0x201).
For the midi port it don't use the irq...
With PnP, the bios/acpi give theses resourse.

For the bit you had to write in the LPC for enable io port, I made a
little test and even if you writte bit that disable the io gameport it
still work. Moreover, I think the bios autoset these bits.

Matthieu

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Intel ICH - sound/pci/intel8x0.c
@ 2004-09-06 15:48 Matthieu Castet
  0 siblings, 0 replies; 15+ messages in thread
From: Matthieu Castet @ 2004-09-06 15:48 UTC (permalink / raw)
  To: linux-kernel

> Takashi says the code is already gone in the alsa tree so we don't
> know how they fixed it.
They ask to use generic modules instead.

look at the cvs log :

Summary: remove gameport/MIDI support

snd-intel8x0's gameport/MIDI code has quite a few problems:  the port
addresses cannot be detected reliably (or not at all with newer LPC
bridge devices), joystick port address 0x208 isn't supported, the MIDI
interrupt isn't detected, PnP isn't supported, changing the port
addresses in the LPC bridge configuration doesn't affect the devices
in the Super-I/O chip connected to the LPC bus, and registering this
driver for the LPC bridge PCI device prevents other drivers using the
LPC's PCI id from loading later.

All these problems can be cured by removing the offending code and
using the proper modules for these devices (ns558/snd-mpu401) instead.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Intel ICH - sound/pci/intel8x0.c
@ 2004-09-06  8:40 Matthieu Castet
  0 siblings, 0 replies; 15+ messages in thread
From: Matthieu Castet @ 2004-09-06  8:40 UTC (permalink / raw)
  To: linux-kernel

> I just spent a while looking at the code. The joystick driver doesn't
> need to exist. Instead the snd_intel8x0_probe() routine could have a
> loop that does pci_get_subsys() over the ID's in
> snd_intel8x0_joystick_ids[]. When it finds one, use the config space
> to enable the joystick/midiports. You can locate the ports since
> pci_get_subsys() returns the pci_dev* for the bridge device.  Save the
> pci_dev* and set the ports back in snd_intel8x0_remove(). Don't forget
> to pci_put() the bridge device.
> 
yes, that is done in hw_random and 8xx_tco for a long time...

> This isn't a device driver for the bridge, we just want to locate it
> and flip some bits. Later on if a driver for the bridge get written it
> should support an API for setting these bits and the search loop can
> be removed.
> 
> All of these devices are listed as Intel LPC bridges:
> 2410, 2420, 2440, 244c, 2450, 2480, 2484, 24c0, 24cc, 24d0, 24dc,
> 25a1, 2640, 2641, 2642
> I have a 24D0 which isn't in the driver list, this is probably why
> MIDI doesn't work on my system.
Also check that you pass the righ io port to the modules (the irq won't
be use, it will use only polling mode )...

If you had enable pnpbios in your kernel, you could see your midi port
with :
for i in /sys/bus/pnp/devices/* ; do if [ "$(<$i/id)" = "PNP0b006" ];
then cat $i/resources;cat $i/options; fi ; done

Matthieu

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Intel ICH - sound/pci/intel8x0.c
@ 2004-09-05 18:48 Matthieu Castet
  2004-09-05 21:24 ` Jon Smirl
  0 siblings, 1 reply; 15+ messages in thread
From: Matthieu Castet @ 2004-09-05 18:48 UTC (permalink / raw)
  To: linux-kernel

On Sul, 2004-09-05 at 03:43, Jon Smirl wrote:
> The joystick PCI ID table in intel8x0.c is not correct. Joysticks and
> MIDI ports are ISA devices and need be located by manual probing. This
> ID table needs to be removed. Joystick and MIDI ports do not have PCI
> IDs.

I agree, that was I explain in a previous post
(http://marc.theaimsgroup.com/?l=linux-kernel&m=109420281830288&w=2)
see the PS.


> It isn't that simple. The LPC bridge also contains the controls for
> the
> joystick ports. You also need them for hotplug handling of the bridge
> should someone stick one in a laptop docking station. The ID table
> also
> ensures the driver is loaded. It's probably true that it will need
> splitting up a bit if another driver also needs ownership of the LPC
> bridge but for now that hasn't happened.

Not for jostick and midi stuff you have to use pnp bus.
On my computer it works well :
I have removed the support of MIDI and GAMEPORT in alsa driver.
The gameport is handle with ns558
The midi device with a mpu401_pnp I post on the alsa mailling list
(http://sourceforge.net/mailarchive/forum.php?thread_id=5468125&forum_id=1751)
For that it work well you need a pnpbios patch
(http://marc.theaimsgroup.com/?l=linux-kernel&m=109411306024720&w=2) or
even try to use my pnpacpi patch
(http://marc.theaimsgroup.com/?l=linux-kernel&m=109430451522335&w=2)
And the isapnp hotplug script auto load the right module...

Regards,
Matthieu

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Intel ICH - sound/pci/intel8x0.c
@ 2004-09-05  2:43 Jon Smirl
  2004-09-05 11:55 ` Alan Cox
  2004-09-06 10:57 ` Takashi Iwai
  0 siblings, 2 replies; 15+ messages in thread
From: Jon Smirl @ 2004-09-05  2:43 UTC (permalink / raw)
  To: lkml, Jaroslav Kysela

The joystick PCI ID table in intel8x0.c is not correct. Joysticks and
MIDI ports are ISA devices and need be located by manual probing. This
ID table needs to be removed. Joystick and MIDI ports do not have PCI
IDs.

The PCI IDs in this table are for the ISA bridge chips, not the
joystick port.  These PC IDs should belong to the PCI bus driver. If I
fix the PCI bus driver to claim these like it should, joystick support
won't work any more.

static struct pci_device_id snd_intel8x0_joystick_ids[] = {
        { 0x8086, 0x2410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* 82801AA */
        { 0x8086, 0x2420, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* 82901AB */
        { 0x8086, 0x2440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICH2 */
        { 0x8086, 0x244c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* ICH2M */
        { 0x8086, 0x248c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* ICH3 */
        // { 0x8086, 0x7195, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* 440MX */
        // { 0x1039, 0x7012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SI7012 */
        { 0x10de, 0x01b2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* NFORCE */
        { 0x10de, 0x006b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* NFORCE2 */
        { 0x10de, 0x00db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* NFORCE3 */
        { 0, }
};

2410	82801AA ISA Bridge (LPC)
2420	82801AB ISA Bridge (LPC)
2440	82801BA ISA Bridge (LPC)
244c	82801BAM ISA Bridge (LPC)
248c	82801CAM ISA Bridge (LPC)
01b2	nForce ISA Bridge

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-09-06 15:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-06  8:31 Intel ICH - sound/pci/intel8x0.c Matthieu Castet
2004-09-06 11:27 ` Alan Cox
2004-09-06 14:11   ` Jon Smirl
  -- strict thread matches above, loose matches on Subject: below --
2004-09-06 15:48 Matthieu Castet
2004-09-06  8:40 Matthieu Castet
2004-09-05 18:48 Matthieu Castet
2004-09-05 21:24 ` Jon Smirl
2004-09-05 20:49   ` Alan Cox
2004-09-06  2:09     ` Randy.Dunlap
2004-09-06  4:07       ` Jon Smirl
2004-09-06  2:13     ` Jon Smirl
2004-09-05  2:43 Jon Smirl
2004-09-05 11:55 ` Alan Cox
2004-09-05 15:26   ` Jon Smirl
2004-09-06 10:57 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox