diff options
Diffstat (limited to 'drivers/ide/pci/cs5520.c')
-rw-r--r-- | drivers/ide/pci/cs5520.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index 1217d2a747fb..fbce90048aec 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c | |||
@@ -96,22 +96,13 @@ static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
96 | reg = inb(hwif->dma_base + 0x02 + 8*controller); | 96 | reg = inb(hwif->dma_base + 0x02 + 8*controller); |
97 | reg |= 1<<((drive->dn&1)+5); | 97 | reg |= 1<<((drive->dn&1)+5); |
98 | outb(reg, hwif->dma_base + 0x02 + 8*controller); | 98 | outb(reg, hwif->dma_base + 0x02 + 8*controller); |
99 | |||
100 | (void)ide_config_drive_speed(drive, XFER_PIO_0 + pio); | ||
101 | } | 99 | } |
102 | 100 | ||
103 | static int cs5520_tune_chipset(ide_drive_t *drive, const u8 speed) | 101 | static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed) |
104 | { | 102 | { |
105 | printk(KERN_ERR "cs55x0: bad ide timing.\n"); | 103 | printk(KERN_ERR "cs55x0: bad ide timing.\n"); |
106 | 104 | ||
107 | cs5520_set_pio_mode(drive, 0); | 105 | cs5520_set_pio_mode(drive, 0); |
108 | |||
109 | /* | ||
110 | * FIXME: this is incorrect to return zero here but | ||
111 | * since all users of ide_set_xfer_rate() ignore | ||
112 | * the return value it is not a problem currently | ||
113 | */ | ||
114 | return 0; | ||
115 | } | 106 | } |
116 | 107 | ||
117 | static int cs5520_config_drive_xfer_rate(ide_drive_t *drive) | 108 | static int cs5520_config_drive_xfer_rate(ide_drive_t *drive) |
@@ -150,26 +141,25 @@ static int cs5520_dma_on(ide_drive_t *drive) | |||
150 | static void __devinit init_hwif_cs5520(ide_hwif_t *hwif) | 141 | static void __devinit init_hwif_cs5520(ide_hwif_t *hwif) |
151 | { | 142 | { |
152 | hwif->set_pio_mode = &cs5520_set_pio_mode; | 143 | hwif->set_pio_mode = &cs5520_set_pio_mode; |
153 | hwif->speedproc = &cs5520_tune_chipset; | 144 | hwif->set_dma_mode = &cs5520_set_dma_mode; |
154 | hwif->ide_dma_check = &cs5520_config_drive_xfer_rate; | ||
155 | hwif->ide_dma_on = &cs5520_dma_on; | ||
156 | 145 | ||
157 | if(!noautodma) | 146 | if (hwif->dma_base == 0) { |
158 | hwif->autodma = 1; | 147 | hwif->drives[1].autotune = hwif->drives[0].autotune = 1; |
159 | |||
160 | if(!hwif->dma_base) | ||
161 | { | ||
162 | hwif->drives[0].autotune = 1; | ||
163 | hwif->drives[1].autotune = 1; | ||
164 | return; | 148 | return; |
165 | } | 149 | } |
166 | 150 | ||
151 | hwif->ide_dma_check = &cs5520_config_drive_xfer_rate; | ||
152 | hwif->ide_dma_on = &cs5520_dma_on; | ||
153 | |||
167 | /* ATAPI is harder so leave it for now */ | 154 | /* ATAPI is harder so leave it for now */ |
168 | hwif->atapi_dma = 0; | 155 | hwif->atapi_dma = 0; |
169 | hwif->ultra_mask = 0; | 156 | hwif->ultra_mask = 0; |
170 | hwif->swdma_mask = 0; | 157 | hwif->swdma_mask = 0; |
171 | hwif->mwdma_mask = 0; | 158 | hwif->mwdma_mask = 0; |
172 | 159 | ||
160 | if (!noautodma) | ||
161 | hwif->autodma = 1; | ||
162 | |||
173 | hwif->drives[0].autodma = hwif->autodma; | 163 | hwif->drives[0].autodma = hwif->autodma; |
174 | hwif->drives[1].autodma = hwif->autodma; | 164 | hwif->drives[1].autodma = hwif->autodma; |
175 | } | 165 | } |