diff options
author | Tejun Heo <htejun@gmail.com> | 2006-04-11 09:22:29 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-11 13:19:11 -0400 |
commit | c22daff41001e9ccead87179ac0547f85447139e (patch) | |
tree | b8faa6e19419704c19f07a9f7043ab2435f719df /include/linux | |
parent | 643be977f9feba8c3c1e768fc06cac84596ec6f8 (diff) |
[PATCH] libata: implement ata_wait_register()
As waiting for some register bits to change seems to be a common
operation shared by some controllers, implement helper function
ata_wait_register(). This function also takes care of register write
flushing.
Note that the condition is inverted, the wait is over when the masked
value does NOT match @val. As we're waiting for bits to change, this
test is more powerful and allows the function to be used in more
places.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/libata.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index d5fd5c06e755..dd5bcb5d29b5 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -543,6 +543,9 @@ extern unsigned int ata_busy_sleep(struct ata_port *ap, | |||
543 | unsigned long timeout); | 543 | unsigned long timeout); |
544 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), | 544 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), |
545 | void *data, unsigned long delay); | 545 | void *data, unsigned long delay); |
546 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, | ||
547 | unsigned long interval_msec, | ||
548 | unsigned long timeout_msec); | ||
546 | 549 | ||
547 | /* | 550 | /* |
548 | * Default driver ops implementations | 551 | * Default driver ops implementations |