20 #include <linux/kernel.h>
21 #include <linux/module.h>
22 #include <linux/device.h>
25 #include <linux/bitops.h>
27 #include <linux/slab.h>
35 #define SYSSTATUS_OFFSET 0x0014
36 #define LOCK_BASE_OFFSET 0x0800
38 #define SPINLOCK_NUMLOCKS_BIT_OFFSET (24)
41 #define SPINLOCK_NOTTAKEN (0)
42 #define SPINLOCK_TAKEN (1)
76 .trylock = omap_hwspinlock_trylock,
77 .unlock = omap_hwspinlock_unlock,
78 .relax = omap_hwspinlock_relax,
88 int num_locks,
i,
ret;
106 if (hweight_long(i & 0xf) != 1 || i > 8) {
113 bank = kzalloc(
sizeof(*bank) + num_locks *
sizeof(*hwlock),
GFP_KERNEL);
119 platform_set_drvdata(pdev, bank);
121 for (i = 0, hwlock = &bank->
lock[0]; i < num_locks; i++, hwlock++)
138 pm_runtime_disable(&pdev->
dev);
153 dev_err(&pdev->
dev,
"%s failed: %d\n", __func__, ret);
157 pm_runtime_disable(&pdev->
dev);
165 .probe = omap_hwspinlock_probe,
168 .name =
"omap_hwspinlock",
173 static int __init omap_hwspinlock_init(
void)
180 static void __exit omap_hwspinlock_exit(
void)