aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sl82c105.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-04-28 00:01:34 -0400
committerSteve French <sfrench@us.ibm.com>2008-04-28 00:01:34 -0400
commit1dbbb6077426f8ce63d6a59c5ac6613e1689cbde (patch)
tree6141d4d7a8eb7c557705bdfa764137d4fd2e4924 /drivers/ide/pci/sl82c105.c
parentd09e860cf07e7c9ee12920a09f5080e30a12a23a (diff)
parent064922a805ec7aadfafdd27aa6b4908d737c3c1d (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/ide/pci/sl82c105.c')
-rw-r--r--drivers/ide/pci/sl82c105.c83
1 files changed, 39 insertions, 44 deletions
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 1f00251a4a87..ce84fa045d39 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -179,7 +179,7 @@ static void sl82c105_dma_start(ide_drive_t *drive)
179 struct pci_dev *dev = to_pci_dev(hwif->dev); 179 struct pci_dev *dev = to_pci_dev(hwif->dev);
180 int reg = 0x44 + drive->dn * 4; 180 int reg = 0x44 + drive->dn * 4;
181 181
182 DBG(("%s(drive:%s)\n", __FUNCTION__, drive->name)); 182 DBG(("%s(drive:%s)\n", __func__, drive->name));
183 183
184 pci_write_config_word(dev, reg, drive->drive_data >> 16); 184 pci_write_config_word(dev, reg, drive->drive_data >> 16);
185 185
@@ -203,7 +203,7 @@ static int sl82c105_dma_end(ide_drive_t *drive)
203 int reg = 0x44 + drive->dn * 4; 203 int reg = 0x44 + drive->dn * 4;
204 int ret; 204 int ret;
205 205
206 DBG(("%s(drive:%s)\n", __FUNCTION__, drive->name)); 206 DBG(("%s(drive:%s)\n", __func__, drive->name));
207 207
208 ret = __ide_dma_end(drive); 208 ret = __ide_dma_end(drive);
209 209
@@ -232,7 +232,7 @@ static void sl82c105_resetproc(ide_drive_t *drive)
232 * Return the revision of the Winbond bridge 232 * Return the revision of the Winbond bridge
233 * which this function is part of. 233 * which this function is part of.
234 */ 234 */
235static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) 235static u8 sl82c105_bridge_revision(struct pci_dev *dev)
236{ 236{
237 struct pci_dev *bridge; 237 struct pci_dev *bridge;
238 238
@@ -282,64 +282,59 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c
282 return dev->irq; 282 return dev->irq;
283} 283}
284 284
285/* 285static const struct ide_port_ops sl82c105_port_ops = {
286 * Initialise IDE channel 286 .set_pio_mode = sl82c105_set_pio_mode,
287 */ 287 .set_dma_mode = sl82c105_set_dma_mode,
288static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) 288 .resetproc = sl82c105_resetproc,
289{ 289};
290 struct pci_dev *dev = to_pci_dev(hwif->dev);
291 unsigned int rev;
292
293 DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index));
294
295 hwif->set_pio_mode = &sl82c105_set_pio_mode;
296 hwif->set_dma_mode = &sl82c105_set_dma_mode;
297 hwif->resetproc = &sl82c105_resetproc;
298
299 if (!hwif->dma_base)
300 return;
301
302 rev = sl82c105_bridge_revision(dev);
303 if (rev <= 5) {
304 /*
305 * Never ever EVER under any circumstances enable
306 * DMA when the bridge is this old.
307 */
308 printk(" %s: Winbond W83C553 bridge revision %d, "
309 "BM-DMA disabled\n", hwif->name, rev);
310 return;
311 }
312
313 hwif->mwdma_mask = ATA_MWDMA2;
314
315 hwif->dma_lost_irq = &sl82c105_dma_lost_irq;
316 hwif->dma_start = &sl82c105_dma_start;
317 hwif->ide_dma_end = &sl82c105_dma_end;
318 hwif->dma_timeout = &sl82c105_dma_timeout;
319 290
320 if (hwif->mate) 291static const struct ide_dma_ops sl82c105_dma_ops = {
321 hwif->serialized = hwif->mate->serialized = 1; 292 .dma_host_set = ide_dma_host_set,
322} 293 .dma_setup = ide_dma_setup,
294 .dma_exec_cmd = ide_dma_exec_cmd,
295 .dma_start = sl82c105_dma_start,
296 .dma_end = sl82c105_dma_end,
297 .dma_test_irq = ide_dma_test_irq,
298 .dma_lost_irq = sl82c105_dma_lost_irq,
299 .dma_timeout = sl82c105_dma_timeout,
300};
323 301
324static const struct ide_port_info sl82c105_chipset __devinitdata = { 302static const struct ide_port_info sl82c105_chipset __devinitdata = {
325 .name = "W82C105", 303 .name = "W82C105",
326 .init_chipset = init_chipset_sl82c105, 304 .init_chipset = init_chipset_sl82c105,
327 .init_hwif = init_hwif_sl82c105,
328 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, 305 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
306 .port_ops = &sl82c105_port_ops,
307 .dma_ops = &sl82c105_dma_ops,
329 .host_flags = IDE_HFLAG_IO_32BIT | 308 .host_flags = IDE_HFLAG_IO_32BIT |
330 IDE_HFLAG_UNMASK_IRQS | 309 IDE_HFLAG_UNMASK_IRQS |
331/* FIXME: check for Compatibility mode in generic IDE PCI code */ 310/* FIXME: check for Compatibility mode in generic IDE PCI code */
332#if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT) 311#if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT)
333 IDE_HFLAG_FORCE_LEGACY_IRQS | 312 IDE_HFLAG_FORCE_LEGACY_IRQS |
334#endif 313#endif
335 IDE_HFLAG_NO_AUTODMA | 314 IDE_HFLAG_SERIALIZE_DMA |
336 IDE_HFLAG_BOOTABLE, 315 IDE_HFLAG_NO_AUTODMA,
337 .pio_mask = ATA_PIO5, 316 .pio_mask = ATA_PIO5,
317 .mwdma_mask = ATA_MWDMA2,
338}; 318};
339 319
340static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id) 320static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id)
341{ 321{
342 return ide_setup_pci_device(dev, &sl82c105_chipset); 322 struct ide_port_info d = sl82c105_chipset;
323 u8 rev = sl82c105_bridge_revision(dev);
324
325 if (rev <= 5) {
326 /*
327 * Never ever EVER under any circumstances enable
328 * DMA when the bridge is this old.
329 */
330 printk(KERN_INFO "W82C105_IDE: Winbond W83C553 bridge "
331 "revision %d, BM-DMA disabled\n", rev);
332 d.dma_ops = NULL;
333 d.mwdma_mask = 0;
334 d.host_flags &= ~IDE_HFLAG_SERIALIZE_DMA;
335 }
336
337 return ide_setup_pci_device(dev, &d);
343} 338}
344 339
345static const struct pci_device_id sl82c105_pci_tbl[] = { 340static const struct pci_device_id sl82c105_pci_tbl[] = {