diff options
Diffstat (limited to 'drivers/ide/pci/hpt34x.c')
-rw-r--r-- | drivers/ide/pci/hpt34x.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index 470e06bd3f2d..0b0c08298348 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c | |||
@@ -125,51 +125,48 @@ static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const cha | |||
125 | 125 | ||
126 | static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif) | 126 | static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif) |
127 | { | 127 | { |
128 | u16 pcicmd = 0; | ||
129 | |||
130 | hwif->set_pio_mode = &hpt34x_set_pio_mode; | 128 | hwif->set_pio_mode = &hpt34x_set_pio_mode; |
131 | hwif->set_dma_mode = &hpt34x_set_mode; | 129 | hwif->set_dma_mode = &hpt34x_set_mode; |
132 | 130 | ||
133 | hwif->drives[0].autotune = 1; | 131 | hwif->drives[0].autotune = 1; |
134 | hwif->drives[1].autotune = 1; | 132 | hwif->drives[1].autotune = 1; |
133 | } | ||
135 | 134 | ||
136 | pci_read_config_word(hwif->pci_dev, PCI_COMMAND, &pcicmd); | 135 | static ide_pci_device_t hpt34x_chipsets[] __devinitdata = { |
137 | 136 | { /* 0 */ | |
138 | if (!hwif->dma_base) | 137 | .name = "HPT343", |
139 | return; | 138 | .init_chipset = init_chipset_hpt34x, |
140 | 139 | .init_hwif = init_hwif_hpt34x, | |
140 | .extra = 16, | ||
141 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | | ||
142 | IDE_HFLAG_NO_AUTODMA, | ||
143 | .pio_mask = ATA_PIO5, | ||
144 | }, | ||
145 | { /* 1 */ | ||
146 | .name = "HPT345", | ||
147 | .init_chipset = init_chipset_hpt34x, | ||
148 | .init_hwif = init_hwif_hpt34x, | ||
149 | .extra = 16, | ||
150 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | | ||
151 | IDE_HFLAG_NO_AUTODMA | | ||
152 | IDE_HFLAG_OFF_BOARD, | ||
153 | .pio_mask = ATA_PIO5, | ||
141 | #ifdef CONFIG_HPT34X_AUTODMA | 154 | #ifdef CONFIG_HPT34X_AUTODMA |
142 | if ((pcicmd & PCI_COMMAND_MEMORY) == 0) | 155 | .swdma_mask = ATA_SWDMA2, |
143 | return; | 156 | .mwdma_mask = ATA_MWDMA2, |
144 | 157 | .udma_mask = ATA_UDMA2, | |
145 | hwif->ultra_mask = 0x07; | ||
146 | hwif->mwdma_mask = 0x07; | ||
147 | hwif->swdma_mask = 0x07; | ||
148 | #endif | 158 | #endif |
149 | } | 159 | } |
150 | |||
151 | static ide_pci_device_t hpt34x_chipset __devinitdata = { | ||
152 | .name = "HPT34X", | ||
153 | .init_chipset = init_chipset_hpt34x, | ||
154 | .init_hwif = init_hwif_hpt34x, | ||
155 | .extra = 16, | ||
156 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA, | ||
157 | .pio_mask = ATA_PIO5, | ||
158 | }; | 160 | }; |
159 | 161 | ||
160 | static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 162 | static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
161 | { | 163 | { |
162 | ide_pci_device_t *d = &hpt34x_chipset; | 164 | ide_pci_device_t *d; |
163 | static char *chipset_names[] = {"HPT343", "HPT345"}; | ||
164 | u16 pcicmd = 0; | 165 | u16 pcicmd = 0; |
165 | 166 | ||
166 | pci_read_config_word(dev, PCI_COMMAND, &pcicmd); | 167 | pci_read_config_word(dev, PCI_COMMAND, &pcicmd); |
167 | 168 | ||
168 | d->name = chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]; | 169 | d = &hpt34x_chipsets[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]; |
169 | if (pcicmd & PCI_COMMAND_MEMORY) | ||
170 | d->host_flags |= IDE_HFLAG_OFF_BOARD; | ||
171 | else | ||
172 | d->host_flags &= ~IDE_HFLAG_OFF_BOARD; | ||
173 | 170 | ||
174 | return ide_setup_pci_device(dev, d); | 171 | return ide_setup_pci_device(dev, d); |
175 | } | 172 | } |