pci_set_power_state(dev,0); dev->current_state = 0; 
pci_set_power_state(dev, PCI_D0); dev->current_state = PM_EVENT_ON; 
static int sc1200_resume (struct pci_dev *dev){	ide_hwif_t	*hwif = NULL;printk("SC1200: resume\n");	pci_set_power_state(dev,0);	// bring chip back from sleep state	dev->current_state = 0;	pci_enable_device(dev);	//	// loop over all interfaces that are part of this pci device:	//	while ((hwif = lookup_pci_dev(hwif, dev)) != NULL) {		unsigned int		basereg, r, d, format;		sc1200_saved_state_t	*ss = (sc1200_saved_state_t *)hwif->config_data;printk("%s: SC1200: resume\n", hwif->name);		//		// Restore timing registers:  this may be unnecessary if BIOS also does it		//		basereg = hwif->channel ? 0x50 : 0x40;		if (ss != NULL) {			for (r = 0; r < 4; ++r) {				pci_write_config_dword(hwif->pci_dev, basereg + (r<<2), ss->regs[r]);			}		}		//		// Re-program drive PIO modes		//		pci_read_config_dword(hwif->pci_dev, basereg+4, &format);		format = (format >> 31) & 1;		if (format)			format += sc1200_get_pci_clock();		for (d = 0; d < 2; ++d) {			ide_drive_t *drive = &(hwif->drives[d]);			if (drive->present) {				unsigned int pio, timings;				pci_read_config_dword(hwif->pci_dev, basereg+(drive->select.b.unit << 3), &timings);				for (pio = 0; pio <= 4; ++pio) {					if (sc1200_pio_timings[format][pio] == timings)						break;				}				if (pio > 4)					pio = 255; /* autotune */				(void)sc1200_tuneproc(drive, pio);			}		}		//		// Re-program drive DMA modes		//		for (d = 0; d < MAX_DRIVES; ++d) {			ide_drive_t *drive = &(hwif->drives[d]);			if (drive->present && !__ide_dma_bad_drive(drive)) {				int was_using_dma = drive->using_dma;				hwif->ide_dma_off_quietly(drive);				sc1200_config_dma(drive);				if (!was_using_dma && drive->using_dma) {					hwif->ide_dma_off_quietly(drive);				}			}		}	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ca078bae813dd46c0f9b102fdfb4a3384641ff48/sc1200.c/buggy/drivers/ide/pci/sc1200.c