aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2010-01-18 02:21:12 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-19 04:52:30 -0500
commit5740345b877e2c8745cdf454674b45919679f231 (patch)
tree2086557997f52c38a8e9f86d85f2055b20b8f336 /drivers/ide
parentcde727be967a86aee01042f35c8a861728272cf1 (diff)
alim15x3: fix handling of command timings
Stop depending on the BIOS setup. Based on libata pata_ali host driver. 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/alim15x3.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c
index 8e29801bbeb0..529f8e2218ac 100644
--- a/drivers/ide/alim15x3.c
+++ b/drivers/ide/alim15x3.c
@@ -84,14 +84,18 @@ static void ali_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
84 struct ide_timing p; 84 struct ide_timing p;
85 85
86 ide_timing_compute(pair, pair->pio_mode, &p, T, 1); 86 ide_timing_compute(pair, pair->pio_mode, &p, T, 1);
87 ide_timing_merge(&p, &t, &t, IDE_TIMING_SETUP); 87 ide_timing_merge(&p, &t, &t,
88 IDE_TIMING_SETUP | IDE_TIMING_8BIT);
88 if (pair->dma_mode) { 89 if (pair->dma_mode) {
89 ide_timing_compute(pair, pair->dma_mode, &p, T, 1); 90 ide_timing_compute(pair, pair->dma_mode, &p, T, 1);
90 ide_timing_merge(&p, &t, &t, IDE_TIMING_SETUP); 91 ide_timing_merge(&p, &t, &t,
92 IDE_TIMING_SETUP | IDE_TIMING_8BIT);
91 } 93 }
92 } 94 }
93 95
94 t.setup = clamp_val(t.setup, 1, 8) & 7; 96 t.setup = clamp_val(t.setup, 1, 8) & 7;
97 t.act8b = clamp_val(t.act8b, 1, 8) & 7;
98 t.rec8b = clamp_val(t.rec8b, 1, 16) & 15;
95 t.active = clamp_val(t.active, 1, 8) & 7; 99 t.active = clamp_val(t.active, 1, 8) & 7;
96 t.recover = clamp_val(t.recover, 1, 16) & 15; 100 t.recover = clamp_val(t.recover, 1, 16) & 15;
97 101
@@ -101,6 +105,7 @@ static void ali_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
101 ali_fifo_control(hwif, drive, (drive->media == ide_disk) ? 0x05 : 0x00); 105 ali_fifo_control(hwif, drive, (drive->media == ide_disk) ? 0x05 : 0x00);
102 106
103 pci_write_config_byte(dev, port, t.setup); 107 pci_write_config_byte(dev, port, t.setup);
108 pci_write_config_byte(dev, port + 1, (t.act8b << 4) | t.rec8b);
104 pci_write_config_byte(dev, port + unit + 2, 109 pci_write_config_byte(dev, port + unit + 2,
105 (t.active << 4) | t.recover); 110 (t.active << 4) | t.recover);
106} 111}