#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/bitops.h>
#include <linux/pm_runtime.h>
#include <linux/spinlock.h>
#include <linux/hwspinlock.h>
#include <linux/platform_device.h>
#include "hwspinlock_internal.h"
#define SYSSTATUS_OFFSET 0x0014
#define LOCK_BASE_OFFSET 0x0800
#define SPINLOCK_NUMLOCKS_BIT_OFFSET (24)
#define SPINLOCK_NOTTAKEN (0)
#define SPINLOCK_TAKEN (1)
static int omap_hwspinlock_trylock(struct hwspinlock *lock)
void __iomem *lock_addr = lock->priv;
return (SPINLOCK_NOTTAKEN == readl(lock_addr));
static void omap_hwspinlock_unlock(struct hwspinlock *lock)
void __iomem *lock_addr = lock->priv;
writel(SPINLOCK_NOTTAKEN, lock_addr);
static void omap_hwspinlock_relax(struct hwspinlock *lock)