summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2018-01-23 17:14:55 +0100
committerJagan Teki <jagan@amarulasolutions.com>2018-01-24 12:03:43 +0530
commit48263504c8d501678acaa90c075f3f7cda17c316 (patch)
tree3236bf8890e2258f1f9af5e42ab42aac6768bb3b /include
parent91fe458bbfcd6485b9413cf398bbfeb6947861ec (diff)
wait_bit: use wait_for_bit_le32 and remove wait_for_bit
wait_for_bit callers use the 32 bit LE version Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'include')
-rw-r--r--include/wait_bit.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/include/wait_bit.h b/include/wait_bit.h
index e8acfa57766..bd021baa484 100644
--- a/include/wait_bit.h
+++ b/include/wait_bit.h
@@ -16,60 +16,6 @@
#include <asm/io.h>
/**
- * wait_for_bit() waits for bit set/cleared in register
- *
- * Function polls register waiting for specific bit(s) change
- * (either 0->1 or 1->0). It can fail under two conditions:
- * - Timeout
- * - User interaction (CTRL-C)
- * Function succeeds only if all bits of masked register are set/cleared
- * (depending on set option).
- *
- * @param prefix Prefix added to timeout messagge (message visible only
- * with debug enabled)
- * @param reg Register that will be read (using readl())
- * @param mask Bit(s) of register that must be active
- * @param set Selects wait condition (bit set or clear)
- * @param timeout_ms Timeout (in miliseconds)
- * @param breakable Enables CTRL-C interruption
- * @return 0 on success, -ETIMEDOUT or -EINTR on failure
- */
-static inline int wait_for_bit(const char *prefix, const u32 *reg,
- const u32 mask, const bool set,
- const unsigned int timeout_ms,
- const bool breakable)
-{
- u32 val;
- unsigned long start = get_timer(0);
-
- while (1) {
- val = readl(reg);
-
- if (!set)
- val = ~val;
-
- if ((val & mask) == mask)
- return 0;
-
- if (get_timer(start) > timeout_ms)
- break;
-
- if (breakable && ctrlc()) {
- puts("Abort\n");
- return -EINTR;
- }
-
- udelay(1);
- WATCHDOG_RESET();
- }
-
- debug("%s: Timeout (reg=%p mask=%08x wait_set=%i)\n", prefix, reg, mask,
- set);
-
- return -ETIMEDOUT;
-}
-
-/**
* wait_for_bit_x() waits for bit set/cleared in register
*
* Function polls register waiting for specific bit(s) change