/* Assume the winbond 82c105 is the IDE controller on a p610/p615/p630. We should probably be more careful in case someone tries to plug in a similar adapter.  */
static void fixup_winbond_82c105(struct pci_dev *dev)
/* Assume the winbond 82c105 is the IDE controller on a p610/p615/p630. We should probably be more careful in case someone tries to plug in a similar adapter.  */
static void fixup_winbond_82c105(struct pci_dev *dev)
{
	int i;
	unsigned int reg;
	if (!machine_is(pseries))
		return;
	printk("Using INTC for W82c105 IDE controller.\n");
	pci_read_config_dword(dev, 0x40, &reg);
	pci_write_config_dword(dev, 0x40, reg | (1<<11));
	for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) {
		if (dev->resource[i].flags & IORESOURCE_IO
		    && dev->bus->number == 0 && dev->devfn == 0x81)
			dev->resource[i].flags &= ~IORESOURCE_IO;
		if (dev->resource[i].start == 0 && dev->resource[i].end) {
			dev->resource[i].flags = 0;
			dev->resource[i].end = 0;
		}
	}
}