commit d1edce71135cc6d98c0a4b5729774542b676e769 Author: sophgo-forum-service <forum_service@sophgo.com> Date: Fri Mar 15 16:07:33 2024 +0800 [fix] recommend using ssh method to clone repo. [fix] fix sensor driver repo branch name.
24 lines
468 B
C
24 lines
468 B
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Copyright 2012 Freescale Semiconductor, Inc.
|
|
*/
|
|
|
|
#include <linux/err.h>
|
|
#include <linux/io.h>
|
|
#include <linux/jiffies.h>
|
|
#include <linux/spinlock.h>
|
|
#include "clk.h"
|
|
|
|
DEFINE_SPINLOCK(mxs_lock);
|
|
|
|
int mxs_clk_wait(void __iomem *reg, u8 shift)
|
|
{
|
|
unsigned long timeout = jiffies + msecs_to_jiffies(10);
|
|
|
|
while (readl_relaxed(reg) & (1 << shift))
|
|
if (time_after(jiffies, timeout))
|
|
return -ETIMEDOUT;
|
|
|
|
return 0;
|
|
}
|