1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2012 Freescale Semiconductor, Inc.
8 #include <linux/jiffies.h>
9 #include <linux/spinlock.h>
12 DEFINE_SPINLOCK(mxs_lock
);
14 int mxs_clk_wait(void __iomem
*reg
, u8 shift
)
16 unsigned long timeout
= jiffies
+ msecs_to_jiffies(10);
18 while (readl_relaxed(reg
) & (1 << shift
))
19 if (time_after(jiffies
, timeout
))