aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/opti621.c
diff options
context:
space:
mode:
authorPaolo Ciarrocchi <paolo.ciarrocchi@gmail.com>2008-04-26 11:36:41 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 11:36:41 -0400
commit4eb68a256d223ce71ae8399e51264708cbc8002b (patch)
treed536f2d7bc53b1e66fe0674b27f1093815a0beed /drivers/ide/pci/opti621.c
parent177b8fe9a5f58731e72d5b582a707868e2a29d11 (diff)
IDE: Coding Style fixes to drivers/ide/pci/opti621.c
Compile tested. [bart: some fixes, md5sum checked] Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/opti621.c')
-rw-r--r--drivers/ide/pci/opti621.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
index cfd46ae11428..88a4dd94eeea 100644
--- a/drivers/ide/pci/opti621.c
+++ b/drivers/ide/pci/opti621.c
@@ -57,9 +57,9 @@
57 * (use idebus=xx to select PCI bus speed). 57 * (use idebus=xx to select PCI bus speed).
58 * 58 *
59 * Version 0.1, Nov 8, 1996 59 * Version 0.1, Nov 8, 1996
60 * by Jaromir Koutek, for 2.1.8. 60 * by Jaromir Koutek, for 2.1.8.
61 * Initial version of driver. 61 * Initial version of driver.
62 * 62 *
63 * Version 0.2 63 * Version 0.2
64 * Number 0.2 skipped. 64 * Number 0.2 skipped.
65 * 65 *
@@ -75,7 +75,7 @@
75 * by Jaromir Koutek 75 * by Jaromir Koutek
76 * Updates for use with (again) new IDE block driver. 76 * Updates for use with (again) new IDE block driver.
77 * Update of documentation. 77 * Update of documentation.
78 * 78 *
79 * Version 0.6, Jan 2, 1999 79 * Version 0.6, Jan 2, 1999
80 * by Jaromir Koutek 80 * by Jaromir Koutek
81 * Reversed to version 0.3 of the driver, because 81 * Reversed to version 0.3 of the driver, because
@@ -208,29 +208,34 @@ typedef struct pio_clocks_s {
208 208
209static void compute_clocks(int pio, pio_clocks_t *clks) 209static void compute_clocks(int pio, pio_clocks_t *clks)
210{ 210{
211 if (pio != PIO_NOT_EXIST) { 211 if (pio != PIO_NOT_EXIST) {
212 int adr_setup, data_pls; 212 int adr_setup, data_pls;
213 int bus_speed = system_bus_clock(); 213 int bus_speed = system_bus_clock();
214 214
215 adr_setup = ide_pio_timings[pio].setup_time; 215 adr_setup = ide_pio_timings[pio].setup_time;
216 data_pls = ide_pio_timings[pio].active_time; 216 data_pls = ide_pio_timings[pio].active_time;
217 clks->address_time = cmpt_clk(adr_setup, bus_speed); 217 clks->address_time = cmpt_clk(adr_setup, bus_speed);
218 clks->data_time = cmpt_clk(data_pls, bus_speed); 218 clks->data_time = cmpt_clk(data_pls, bus_speed);
219 clks->recovery_time = cmpt_clk(ide_pio_timings[pio].cycle_time 219 clks->recovery_time = cmpt_clk(ide_pio_timings[pio].cycle_time
220 - adr_setup-data_pls, bus_speed); 220 - adr_setup-data_pls, bus_speed);
221 if (clks->address_time<1) clks->address_time = 1; 221 if (clks->address_time < 1)
222 if (clks->address_time>4) clks->address_time = 4; 222 clks->address_time = 1;
223 if (clks->data_time<1) clks->data_time = 1; 223 if (clks->address_time > 4)
224 if (clks->data_time>16) clks->data_time = 16; 224 clks->address_time = 4;
225 if (clks->recovery_time<2) clks->recovery_time = 2; 225 if (clks->data_time < 1)
226 if (clks->recovery_time>17) clks->recovery_time = 17; 226 clks->data_time = 1;
227 if (clks->data_time > 16)
228 clks->data_time = 16;
229 if (clks->recovery_time < 2)
230 clks->recovery_time = 2;
231 if (clks->recovery_time > 17)
232 clks->recovery_time = 17;
227 } else { 233 } else {
228 clks->address_time = 1; 234 clks->address_time = 1;
229 clks->data_time = 1; 235 clks->data_time = 1;
230 clks->recovery_time = 2; 236 clks->recovery_time = 2;
231 /* minimal values */ 237 /* minimal values */
232 } 238 }
233
234} 239}
235 240
236static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) 241static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
@@ -247,8 +252,8 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
247 252
248 /* sets drive->drive_data for both drives */ 253 /* sets drive->drive_data for both drives */
249 compute_pios(drive, pio); 254 compute_pios(drive, pio);
250 pio1 = hwif->drives[0].drive_data; 255 pio1 = hwif->drives[0].drive_data;
251 pio2 = hwif->drives[1].drive_data; 256 pio2 = hwif->drives[1].drive_data;
252 257
253 compute_clocks(pio1, &first); 258 compute_clocks(pio1, &first);
254 compute_clocks(pio2, &second); 259 compute_clocks(pio2, &second);
@@ -275,7 +280,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
275 280
276 spin_lock_irqsave(&opti621_lock, flags); 281 spin_lock_irqsave(&opti621_lock, flags);
277 282
278 reg_base = hwif->io_ports[IDE_DATA_OFFSET]; 283 reg_base = hwif->io_ports[IDE_DATA_OFFSET];
279 284
280 /* allow Register-B */ 285 /* allow Register-B */
281 outb(0xc0, reg_base + CNTRL_REG); 286 outb(0xc0, reg_base + CNTRL_REG);
@@ -324,7 +329,7 @@ static void __devinit opti621_port_init_devs(ide_hwif_t *hwif)
324/* 329/*
325 * init_hwif_opti621() is called once for each hwif found at boot. 330 * init_hwif_opti621() is called once for each hwif found at boot.
326 */ 331 */
327static void __devinit init_hwif_opti621 (ide_hwif_t *hwif) 332static void __devinit init_hwif_opti621(ide_hwif_t *hwif)
328{ 333{
329 hwif->port_init_devs = opti621_port_init_devs; 334 hwif->port_init_devs = opti621_port_init_devs;
330 hwif->set_pio_mode = &opti621_set_pio_mode; 335 hwif->set_pio_mode = &opti621_set_pio_mode;
@@ -334,15 +339,15 @@ static const struct ide_port_info opti621_chipsets[] __devinitdata = {
334 { /* 0 */ 339 { /* 0 */
335 .name = "OPTI621", 340 .name = "OPTI621",
336 .init_hwif = init_hwif_opti621, 341 .init_hwif = init_hwif_opti621,
337 .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, 342 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} },
338 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 343 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
339 .pio_mask = ATA_PIO3, 344 .pio_mask = ATA_PIO3,
340 .swdma_mask = ATA_SWDMA2, 345 .swdma_mask = ATA_SWDMA2,
341 .mwdma_mask = ATA_MWDMA2, 346 .mwdma_mask = ATA_MWDMA2,
342 },{ /* 1 */ 347 }, { /* 1 */
343 .name = "OPTI621X", 348 .name = "OPTI621X",
344 .init_hwif = init_hwif_opti621, 349 .init_hwif = init_hwif_opti621,
345 .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, 350 .enablebits = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} },
346 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, 351 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
347 .pio_mask = ATA_PIO3, 352 .pio_mask = ATA_PIO3,
348 .swdma_mask = ATA_SWDMA2, 353 .swdma_mask = ATA_SWDMA2,