| // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| * Copyright (C) 2018, STMicroelectronics - All Rights Reserved |
| static int sandbox_lock(struct udevice *dev, int index) |
| struct sandbox_state *state = state_get_current(); |
| state->hwspinlock = true; |
| static int sandbox_unlock(struct udevice *dev, int index) |
| struct sandbox_state *state = state_get_current(); |
| state->hwspinlock = false; |
| static const struct hwspinlock_ops sandbox_hwspinlock_ops = { |
| .unlock = sandbox_unlock, |
| static const struct udevice_id sandbox_hwspinlock_ids[] = { |
| { .compatible = "sandbox,hwspinlock" }, |
| U_BOOT_DRIVER(hwspinlock_sandbox) = { |
| .name = "hwspinlock_sandbox", |
| .of_match = sandbox_hwspinlock_ids, |
| .ops = &sandbox_hwspinlock_ops, |