Lines Matching +full:am654 +full:- +full:hwspinlock

1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2010-2015 Texas Instruments Incorporated - http://www.ti.com
8 * Hari Kanigeri <h-kanigeri2@ti.com>
9 * Ohad Ben-Cohen <ohad@wizery.com>
21 #include <linux/hwspinlock.h>
37 static int omap_hwspinlock_trylock(struct hwspinlock *lock) in omap_hwspinlock_trylock()
39 void __iomem *lock_addr = lock->priv; in omap_hwspinlock_trylock()
45 static void omap_hwspinlock_unlock(struct hwspinlock *lock) in omap_hwspinlock_unlock()
47 void __iomem *lock_addr = lock->priv; in omap_hwspinlock_unlock()
63 static void omap_hwspinlock_relax(struct hwspinlock *lock) in omap_hwspinlock_relax()
76 struct device_node *node = pdev->dev.of_node; in omap_hwspinlock_probe()
78 struct hwspinlock *hwlock; in omap_hwspinlock_probe()
81 /* Only a single hwspinlock block device is supported */ in omap_hwspinlock_probe()
85 return -ENODEV; in omap_hwspinlock_probe()
95 pm_runtime_enable(&pdev->dev); in omap_hwspinlock_probe()
96 ret = pm_runtime_get_sync(&pdev->dev); in omap_hwspinlock_probe()
98 pm_runtime_put_noidle(&pdev->dev); in omap_hwspinlock_probe()
110 ret = pm_runtime_put(&pdev->dev); in omap_hwspinlock_probe()
116 ret = -EINVAL; in omap_hwspinlock_probe()
122 bank = devm_kzalloc(&pdev->dev, struct_size(bank, lock, num_locks), in omap_hwspinlock_probe()
125 ret = -ENOMEM; in omap_hwspinlock_probe()
131 for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++) in omap_hwspinlock_probe()
132 hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i; in omap_hwspinlock_probe()
134 ret = hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops, in omap_hwspinlock_probe()
139 dev_dbg(&pdev->dev, "Registered %d locks with HwSpinlock core\n", in omap_hwspinlock_probe()
145 pm_runtime_disable(&pdev->dev); in omap_hwspinlock_probe()
156 dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); in omap_hwspinlock_remove()
160 pm_runtime_disable(&pdev->dev); in omap_hwspinlock_remove()
166 { .compatible = "ti,omap4-hwspinlock", },
167 { .compatible = "ti,am654-hwspinlock", },
197 MODULE_AUTHOR("Hari Kanigeri <h-kanigeri2@ti.com>");
198 MODULE_AUTHOR("Ohad Ben-Cohen <ohad@wizery.com>");