aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2010-01-18 02:19:14 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-19 04:25:01 -0500
commita337c2272731d538827153b32f547ef7c131a4cb (patch)
tree640bdb34eb3d008c1253b66f42fb0912c3659aaa /drivers/ide
parentfb7b0d5b4096ec2a0f76538a4461345af14e0781 (diff)
pdc202xx_old: add ->init_hwif method
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/pdc202xx_old.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index 35161dd840a0..1d20594ee420 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> 2 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
3 * Copyright (C) 2006-2007, 2009 MontaVista Software, Inc. 3 * Copyright (C) 2006-2007, 2009 MontaVista Software, Inc.
4 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 4 * Copyright (C) 2007-2010 Bartlomiej Zolnierkiewicz
5 * 5 *
6 * Portions Copyright (C) 1999 Promise Technology, Inc. 6 * Portions Copyright (C) 1999 Promise Technology, Inc.
7 * Author: Frank Tiernan (frankt@promise.com) 7 * Author: Frank Tiernan (frankt@promise.com)
@@ -21,8 +21,6 @@
21 21
22#define DRV_NAME "pdc202xx_old" 22#define DRV_NAME "pdc202xx_old"
23 23
24static void pdc_old_disable_66MHz_clock(ide_hwif_t *);
25
26static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed) 24static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed)
27{ 25{
28 ide_hwif_t *hwif = drive->hwif; 26 ide_hwif_t *hwif = drive->hwif;
@@ -32,12 +30,6 @@ static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed)
32 u8 AP = 0, BP = 0, CP = 0; 30 u8 AP = 0, BP = 0, CP = 0;
33 u8 TA = 0, TB = 0, TC = 0; 31 u8 TA = 0, TB = 0, TC = 0;
34 32
35 /*
36 * TODO: do this once per channel
37 */
38 if (dev->device != PCI_DEVICE_ID_PROMISE_20246)
39 pdc_old_disable_66MHz_clock(hwif);
40
41 pci_read_config_byte(dev, drive_pci, &AP); 33 pci_read_config_byte(dev, drive_pci, &AP);
42 pci_read_config_byte(dev, drive_pci + 1, &BP); 34 pci_read_config_byte(dev, drive_pci + 1, &BP);
43 pci_read_config_byte(dev, drive_pci + 2, &CP); 35 pci_read_config_byte(dev, drive_pci + 2, &CP);
@@ -145,6 +137,11 @@ static void pdc_old_disable_66MHz_clock(ide_hwif_t *hwif)
145 outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg); 137 outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg);
146} 138}
147 139
140static void pdc2026x_init_hwif(ide_hwif_t *hwif)
141{
142 pdc_old_disable_66MHz_clock(hwif);
143}
144
148static void pdc202xx_dma_start(ide_drive_t *drive) 145static void pdc202xx_dma_start(ide_drive_t *drive)
149{ 146{
150 if (drive->current_speed > XFER_UDMA_2) 147 if (drive->current_speed > XFER_UDMA_2)
@@ -261,6 +258,7 @@ static const struct ide_dma_ops pdc2026x_dma_ops = {
261 { \ 258 { \
262 .name = DRV_NAME, \ 259 .name = DRV_NAME, \
263 .init_chipset = init_chipset_pdc202xx, \ 260 .init_chipset = init_chipset_pdc202xx, \
261 .init_hwif = pdc2026x_init_hwif, \
264 .port_ops = &pdc2026x_port_ops, \ 262 .port_ops = &pdc2026x_port_ops, \
265 .dma_ops = &pdc2026x_dma_ops, \ 263 .dma_ops = &pdc2026x_dma_ops, \
266 .host_flags = IDE_HFLAGS_PDC202XX, \ 264 .host_flags = IDE_HFLAGS_PDC202XX, \
@@ -356,6 +354,6 @@ static void __exit pdc202xx_ide_exit(void)
356module_init(pdc202xx_ide_init); 354module_init(pdc202xx_ide_init);
357module_exit(pdc202xx_ide_exit); 355module_exit(pdc202xx_ide_exit);
358 356
359MODULE_AUTHOR("Andre Hedrick, Frank Tiernan"); 357MODULE_AUTHOR("Andre Hedrick, Frank Tiernan, Bartlomiej Zolnierkiewicz");
360MODULE_DESCRIPTION("PCI driver module for older Promise IDE"); 358MODULE_DESCRIPTION("PCI driver module for older Promise IDE");
361MODULE_LICENSE("GPL"); 359MODULE_LICENSE("GPL");