aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/hpt34x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/hpt34x.c')
-rw-r--r--drivers/ide/pci/hpt34x.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index 44ac0e2f7a09..67af1a7dde30 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -125,49 +125,45 @@ static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const cha
125 125
126static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif) 126static 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;
130}
132 131
133 hwif->drives[0].autotune = 1; 132static ide_pci_device_t hpt34x_chipsets[] __devinitdata = {
134 hwif->drives[1].autotune = 1; 133 { /* 0 */
135 134 .name = "HPT343",
136 pci_read_config_word(hwif->pci_dev, PCI_COMMAND, &pcicmd); 135 .init_chipset = init_chipset_hpt34x,
137 136 .init_hwif = init_hwif_hpt34x,
138 if (!hwif->dma_base) 137 .extra = 16,
139 return; 138 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
140 139 IDE_HFLAG_NO_AUTODMA,
140 .pio_mask = ATA_PIO5,
141 },
142 { /* 1 */
143 .name = "HPT345",
144 .init_chipset = init_chipset_hpt34x,
145 .init_hwif = init_hwif_hpt34x,
146 .extra = 16,
147 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
148 IDE_HFLAG_NO_AUTODMA |
149 IDE_HFLAG_OFF_BOARD,
150 .pio_mask = ATA_PIO5,
141#ifdef CONFIG_HPT34X_AUTODMA 151#ifdef CONFIG_HPT34X_AUTODMA
142 if ((pcicmd & PCI_COMMAND_MEMORY) == 0) 152 .swdma_mask = ATA_SWDMA2,
143 return; 153 .mwdma_mask = ATA_MWDMA2,
144 154 .udma_mask = ATA_UDMA2,
145 hwif->ultra_mask = 0x07;
146 hwif->mwdma_mask = 0x07;
147 hwif->swdma_mask = 0x07;
148#endif 155#endif
149} 156 }
150
151static ide_pci_device_t hpt34x_chipset __devinitdata = {
152 .name = "HPT34X",
153 .init_chipset = init_chipset_hpt34x,
154 .init_hwif = init_hwif_hpt34x,
155 .autodma = NOAUTODMA,
156 .bootable = NEVER_BOARD,
157 .extra = 16,
158 .pio_mask = ATA_PIO5,
159}; 157};
160 158
161static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id) 159static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
162{ 160{
163 ide_pci_device_t *d = &hpt34x_chipset; 161 ide_pci_device_t *d;
164 static char *chipset_names[] = {"HPT343", "HPT345"};
165 u16 pcicmd = 0; 162 u16 pcicmd = 0;
166 163
167 pci_read_config_word(dev, PCI_COMMAND, &pcicmd); 164 pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
168 165
169 d->name = chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]; 166 d = &hpt34x_chipsets[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0];
170 d->bootable = (pcicmd & PCI_COMMAND_MEMORY) ? OFF_BOARD : NEVER_BOARD;
171 167
172 return ide_setup_pci_device(dev, d); 168 return ide_setup_pci_device(dev, d);
173} 169}