static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char *name) 
static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const char *name) 
static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char *name){	struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;	unsigned long flags;	dev = NULL;	while ((dev = pci_find_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != NULL) {		switch (dev->device) {			case PCI_DEVICE_ID_CYRIX_PCI_MASTER:				master_0 = dev;				break;			case PCI_DEVICE_ID_CYRIX_5530_LEGACY:				cs5530_0 = dev;				break;		}	}	if (!master_0) {		printk(KERN_ERR "%s: unable to locate PCI MASTER function\n", name);		return 0;	}	if (!cs5530_0) {		printk(KERN_ERR "%s: unable to locate CS5530 LEGACY function\n", name);		return 0;	}	spin_lock_irqsave(&ide_lock, flags);		/* all CPUs (there should only be one CPU with this chipset) */	/*	 * Enable BusMaster and MemoryWriteAndInvalidate for the cs5530:	 * -->  OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530	 */	pci_set_master(cs5530_0);	pci_set_mwi(cs5530_0);	/*	 * Set PCI CacheLineSize to 16-bytes:	 * --> Write 0x04 into 8-bit PCI CACHELINESIZE reg of function 0 of the cs5530	 */	pci_write_config_byte(cs5530_0, PCI_CACHE_LINE_SIZE, 0x04);	/*	 * Disable trapping of UDMA register accesses (Win98 hack):	 * --> Write 0x5006 into 16-bit reg at offset 0xd0 of function 0 of the cs5530	 */	pci_write_config_word(cs5530_0, 0xd0, 0x5006);	/*	 * Bit-1 at 0x40 enables MemoryWriteAndInvalidate on internal X-bus:	 * The other settings are what is necessary to get the register	 * into a sane state for IDE DMA operation.	 */	pci_write_config_byte(master_0, 0x40, 0x1e);	/* 	 * Set max PCI burst size (16-bytes seems to work best):	 *	   16bytes: set bit-1 at 0x41 (reg value of 0x16)	 *	all others: clear bit-1 at 0x41, and do:	 *	  128bytes: OR 0x00 at 0x41	 *	  256bytes: OR 0x04 at 0x41	 *	  512bytes: OR 0x08 at 0x41	 *	 1024bytes: OR 0x0c at 0x41	 */	pci_write_config_byte(master_0, 0x41, 0x14);	/*	 * These settings are necessary to get the chip	 * into a sane state for IDE DMA operation.	 */	pci_write_config_byte(master_0, 0x42, 0x00);	pci_write_config_byte(master_0, 0x43, 0xc1);	spin_unlock_irqrestore(&ide_lock, flags);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/88de8e996f16b958721368ed9b4fd4e29cdb923e/cs5530.c/buggy/drivers/ide/pci/cs5530.c