aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:08 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:08 -0500
commit81ca691981da718727281238b435dcf1528d2fda (patch)
tree4c4845a77d94fe91bd7d1345bf9d992852b8d572
parent4f52a32994f9e05fb8ae1a9ba3f20cd0b55145b7 (diff)
ide: add ide_set_irq() inline helper
There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-io.c9
-rw-r--r--drivers/ide/ide-iops.c10
-rw-r--r--drivers/ide/ide-probe.c12
-rw-r--r--drivers/ide/ide-taskfile.c3
-rw-r--r--include/linux/ide.h5
5 files changed, 17 insertions, 22 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index e37b09c81e3a..5b213dcaa5e6 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -939,8 +939,7 @@ static void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
939 if (rc) 939 if (rc)
940 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name); 940 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
941 SELECT_DRIVE(drive); 941 SELECT_DRIVE(drive);
942 if (IDE_CONTROL_REG) 942 ide_set_irq(drive, 1);
943 HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
944 rc = ide_wait_not_busy(HWIF(drive), 100000); 943 rc = ide_wait_not_busy(HWIF(drive), 100000);
945 if (rc) 944 if (rc)
946 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); 945 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
@@ -1213,15 +1212,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
1213 } 1212 }
1214 again: 1213 again:
1215 hwif = HWIF(drive); 1214 hwif = HWIF(drive);
1216 if (hwgroup->hwif->sharing_irq && 1215 if (hwgroup->hwif->sharing_irq && hwif != hwgroup->hwif) {
1217 hwif != hwgroup->hwif &&
1218 hwif->io_ports[IDE_CONTROL_OFFSET]) {
1219 /* 1216 /*
1220 * set nIEN for previous hwif, drives in the 1217 * set nIEN for previous hwif, drives in the
1221 * quirk_list may not like intr setups/cleanups 1218 * quirk_list may not like intr setups/cleanups
1222 */ 1219 */
1223 if (drive->quirk_list != 1) 1220 if (drive->quirk_list != 1)
1224 hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); 1221 ide_set_irq(drive, 0);
1225 } 1222 }
1226 hwgroup->hwif = hwif; 1223 hwgroup->hwif = hwif;
1227 hwgroup->drive = drive; 1224 hwgroup->drive = drive;
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 595a5cef41a2..a26c9ca784a6 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -688,8 +688,7 @@ int ide_driveid_update(ide_drive_t *drive)
688 */ 688 */
689 689
690 SELECT_MASK(drive, 1); 690 SELECT_MASK(drive, 1);
691 if (IDE_CONTROL_REG) 691 ide_set_irq(drive, 1);
692 hwif->OUTB(drive->ctl,IDE_CONTROL_REG);
693 msleep(50); 692 msleep(50);
694 hwif->OUTB(WIN_IDENTIFY, IDE_COMMAND_REG); 693 hwif->OUTB(WIN_IDENTIFY, IDE_COMMAND_REG);
695 timeout = jiffies + WAIT_WORSTCASE; 694 timeout = jiffies + WAIT_WORSTCASE;
@@ -772,13 +771,12 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
772 SELECT_DRIVE(drive); 771 SELECT_DRIVE(drive);
773 SELECT_MASK(drive, 0); 772 SELECT_MASK(drive, 0);
774 udelay(1); 773 udelay(1);
775 if (IDE_CONTROL_REG) 774 ide_set_irq(drive, 0);
776 hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG);
777 hwif->OUTB(speed, IDE_NSECTOR_REG); 775 hwif->OUTB(speed, IDE_NSECTOR_REG);
778 hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); 776 hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG);
779 hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG); 777 hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG);
780 if ((IDE_CONTROL_REG) && (drive->quirk_list == 2)) 778 if (drive->quirk_list == 2)
781 hwif->OUTB(drive->ctl, IDE_CONTROL_REG); 779 ide_set_irq(drive, 1);
782 780
783 error = __ide_wait_stat(drive, drive->ready_stat, 781 error = __ide_wait_stat(drive, drive->ready_stat,
784 BUSY_STAT|DRQ_STAT|ERR_STAT, 782 BUSY_STAT|DRQ_STAT|ERR_STAT,
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 18e9b82e132c..9d9f1c6d602a 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -350,22 +350,19 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd)
350 * the irq handler isn't expecting. 350 * the irq handler isn't expecting.
351 */ 351 */
352 if (IDE_CONTROL_REG) { 352 if (IDE_CONTROL_REG) {
353 u8 ctl = drive->ctl | 2;
354 if (!hwif->irq) { 353 if (!hwif->irq) {
355 autoprobe = 1; 354 autoprobe = 1;
356 cookie = probe_irq_on(); 355 cookie = probe_irq_on();
357 /* enable device irq */
358 ctl &= ~2;
359 } 356 }
360 hwif->OUTB(ctl, IDE_CONTROL_REG); 357 ide_set_irq(drive, autoprobe);
361 } 358 }
362 359
363 retval = actual_try_to_identify(drive, cmd); 360 retval = actual_try_to_identify(drive, cmd);
364 361
365 if (autoprobe) { 362 if (autoprobe) {
366 int irq; 363 int irq;
367 /* mask device irq */ 364
368 hwif->OUTB(drive->ctl|2, IDE_CONTROL_REG); 365 ide_set_irq(drive, 0);
369 /* clear drive IRQ */ 366 /* clear drive IRQ */
370 (void) hwif->INB(IDE_STATUS_REG); 367 (void) hwif->INB(IDE_STATUS_REG);
371 udelay(5); 368 udelay(5);
@@ -653,8 +650,7 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
653 /* Ignore disks that we will not probe for later. */ 650 /* Ignore disks that we will not probe for later. */
654 if (!drive->noprobe || drive->present) { 651 if (!drive->noprobe || drive->present) {
655 SELECT_DRIVE(drive); 652 SELECT_DRIVE(drive);
656 if (IDE_CONTROL_REG) 653 ide_set_irq(drive, 1);
657 hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
658 mdelay(2); 654 mdelay(2);
659 rc = ide_wait_not_busy(hwif, 35000); 655 rc = ide_wait_not_busy(hwif, 35000);
660 if (rc) 656 if (rc)
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 063e0eb6c9e4..c58edc86ed3e 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -83,8 +83,7 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
83 tf->hob_lbam, tf->hob_lbah); 83 tf->hob_lbam, tf->hob_lbah);
84#endif 84#endif
85 85
86 if (IDE_CONTROL_REG) 86 ide_set_irq(drive, 1);
87 hwif->OUTB(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */
88 87
89 if ((task->tf_flags & IDE_TFLAG_NO_SELECT_MASK) == 0) 88 if ((task->tf_flags & IDE_TFLAG_NO_SELECT_MASK) == 0)
90 SELECT_MASK(drive, 0); 89 SELECT_MASK(drive, 0);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 735737500f8f..74f1ef9c6d94 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1302,4 +1302,9 @@ static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
1302 return &hwif->drives[(drive->dn ^ 1) & 1]; 1302 return &hwif->drives[(drive->dn ^ 1) & 1];
1303} 1303}
1304 1304
1305static inline void ide_set_irq(ide_drive_t *drive, int on)
1306{
1307 drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG);
1308}
1309
1305#endif /* _IDE_H */ 1310#endif /* _IDE_H */