24 #include <linux/module.h>
28 #include <linux/slab.h>
42 #define U8500_MAX_SEMAPHORE 32
43 #define RESET_SEMAPHORE (0)
51 #define HSEM_MASTER_ID 0x01
53 #define HSEM_REGISTER_OFFSET 0x08
55 #define HSEM_CTRL_REG 0x00
56 #define HSEM_ICRALL 0x90
57 #define HSEM_PROTOCOL_1 0x01
59 static int u8500_hsem_trylock(
struct hwspinlock *lock)
72 static void u8500_hsem_unlock(
struct hwspinlock *lock)
83 static void u8500_hsem_relax(
struct hwspinlock *lock)
89 .trylock = u8500_hsem_trylock,
90 .unlock = u8500_hsem_unlock,
91 .relax = u8500_hsem_relax,
122 bank = kzalloc(
sizeof(*bank) + num_locks *
sizeof(*hwlock),
GFP_KERNEL);
128 platform_set_drvdata(pdev, bank);
130 for (i = 0, hwlock = &bank->
lock[0]; i < num_locks; i++, hwlock++)
144 pm_runtime_disable(&pdev->
dev);
162 dev_err(&pdev->
dev,
"%s failed: %d\n", __func__, ret);
166 pm_runtime_disable(&pdev->
dev);
174 .probe = u8500_hsem_probe,
177 .name =
"u8500_hsem",
182 static int __init u8500_hsem_init(
void)
189 static void __exit u8500_hsem_exit(
void)