diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c index 06b5495a79fd845efc28ccc222de5633e8d650c8..cbb0abb97407fb07d5b814199b61fa1064f857c4 100644 --- a/drivers/ide/pci/cy82c693.c +++ b/drivers/ide/pci/cy82c693.c @@ -338,6 +338,9 @@ static void cy82c693_tune_drive (ide_drive_t *drive, u8 pio) */ unsigned int __init init_chipset_cy82c693(struct pci_dev *dev, const char *name) { + if (PCI_FUNC(dev->devfn) != 1) + return 0; + #ifdef CY82C693_SETDMA_CLOCK u8 data = 0; #endif /* CY82C693_SETDMA_CLOCK */ @@ -411,20 +414,30 @@ void __init init_hwif_cy82c693(ide_hwif_t *hwif) #endif /* CONFIG_BLK_DEV_IDEDMA */ } -void __init init_dma_cy82c693 (ide_hwif_t *hwif, unsigned long dmabase) +static __initdata ide_hwif_t *primary; + +void __init init_iops_cy82c693(ide_hwif_t *hwif) { - ide_setup_dma(hwif, dmabase, 8); + if (PCI_FUNC(hwif->pci_dev->devfn) == 1) + primary = hwif; + else { + hwif->mate = primary; + hwif->channel = 1; + } } -extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); - static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id) { ide_pci_device_t *d = &cy82c693_chipsets[id->driver_data]; - if ((!(PCI_FUNC(dev->devfn) & 1) || - (!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE)))) - return 0; /* CY82C693 is more than only a IDE controller */ - ide_setup_pci_device(dev, d); + struct pci_dev *dev2; + + /* CY82C693 is more than only a IDE controller. + Function 1 is primary IDE channel, function 2 - secondary. */ + if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && + PCI_FUNC(dev->devfn) == 1) { + dev2 = pci_find_slot(dev->bus->number, dev->devfn + 1); + ide_setup_pci_devices(dev, dev2, d); + } return 0; } diff --git a/drivers/ide/pci/cy82c693.h b/drivers/ide/pci/cy82c693.h index b5c6f9652d519da115799d08c2b929d3addf84bd..d7c8d19a852310cc86a9085784d1aa994a641c56 100644 --- a/drivers/ide/pci/cy82c693.h +++ b/drivers/ide/pci/cy82c693.h @@ -66,7 +66,7 @@ typedef struct pio_clocks_s { extern unsigned int init_chipset_cy82c693(struct pci_dev *, const char *); extern void init_hwif_cy82c693(ide_hwif_t *); -extern void init_dma_cy82c693(ide_hwif_t *, unsigned long); +extern void init_iops_cy82c693(ide_hwif_t *); static ide_pci_device_t cy82c693_chipsets[] __initdata = { { /* 0 */ @@ -74,10 +74,10 @@ static ide_pci_device_t cy82c693_chipsets[] __initdata = { device: PCI_DEVICE_ID_CONTAQ_82C693, name: "CY82C693", init_chipset: init_chipset_cy82c693, - init_iops: NULL, + init_iops: init_iops_cy82c693, init_hwif: init_hwif_cy82c693, - init_dma: init_dma_cy82c693, - channels: 2, + init_dma: NULL, + channels: 1, autodma: AUTODMA, enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, bootable: ON_BOARD, diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 29dfacd9b29dda0c2f4068d02516b3a685b223a0..8ef4fc169dec7c9513f76fb40331016e310f7c4b 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -250,6 +250,7 @@ static unsigned long __init ide_get_or_set_dma_base (ide_hwif_t *hwif) switch(dev->device) { case PCI_DEVICE_ID_AL_M5219: + case PCI_DEVICE_ID_AL_M5229: case PCI_DEVICE_ID_AMD_VIPER_7409: case PCI_DEVICE_ID_CMD_643: case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: