ISA Plug & Play support by Jaroslav Kysela ========================================================= Interface /proc/isapnp ====================== Read commands: -------------- No comment.. Write commands: --------------- With the write interface you can simply activate or modify the configuration for ISA Plug & Play devices. It is mainly useable for drivers which don't use the ISA Plug & Play kernel support yet. card - select PnP device by vendor identification csn - select PnP device by CSN dev - select logical device auto - run autoconfigure activate - activate logical device deactivate - deactivate logical device port - set port 0-7 to value irq - set IRQ 0-1 to value dma - set DMA 0-1 to value memory - set memory 0-3 to value poke - poke configuration byte to selected register pokew - poke configuration word to selected register poked - poke configuration dword to selected register Explanation: - variable begins with zero - variable begins with one - is in form 'PNP0000' - is in form 'PNP0000' Example: cat > /proc/isapnp <prepare() only initialize the resource members in the device structure. This structure contains all resources set to auto configuration values after the initialization. The driver for ISA PnP device may modify (or not) some resources to skip auto configuration for the given resource. The function isapnp_configure does: - resources which have the auto configuration value are configured - the auto configuration is created using ISA PnP resource map - the function writes configuration to ISA PnP configuration registers - the function returns to the caller actual used resources Example (game port initialization) ================================== /*** initialization ***/ struct pci_dev *dev; /* find the first game port, use standard PnP IDs */ dev = isapnp_find_dev(NULL, ISAPNP_VENDOR('P','N','P'), ISAPNP_FUNCTION(0xb02f), NULL); if (!dev) return -ENODEV; if (dev->prepare(dev)<0) return -EAGAIN; if (!(dev->resource[0].flags & IORESOURCE_IO)) return -ENODEV; if (!dev->ro) { /* override resource */ if (user_port != USER_PORT_AUTO_VALUE) isapnp_resource_change(&dev->resource[0], user_port, 1); } if (dev->activate(dev)<0) { printk("isapnp configure failed (out of resources?)\n"); return -ENOMEM; } user_port = dev->resource[0].start; /* get real port */ /*** deactivation ***/ /* to deactivate use: */ if (dev) dev->deactivate(dev);