Lionel Debieve | 11985d1 | 2025-04-01 15:14:09 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause */ |
| 2 | /* |
| 3 | * Copyright (C) 2023, STMicroelectronics - All Rights Reserved |
| 4 | */ |
| 5 | |
| 6 | #ifndef MACH_ETZPC_H |
| 7 | #define MACH_ETZPC_H |
| 8 | |
| 9 | #include <linux/types.h> |
| 10 | |
| 11 | /** |
| 12 | * stm32_etzpc_check_access - Check ETZPC accesses for given device node |
| 13 | * |
| 14 | * @device_node Node of the device for which the accesses are checked |
| 15 | * |
| 16 | * @returns 0 on success (if access is granted), -EINVAL if access is denied. |
| 17 | * Else, returns an appropriate negative ERRNO value |
| 18 | */ |
| 19 | int stm32_etzpc_check_access(ofnode device_node); |
| 20 | |
| 21 | /** |
| 22 | * stm32_etzpc_check_access_by_id - Check ETZPC accesses for given id |
| 23 | * |
| 24 | * @device_node Node of the device to get a reference on ETZPC |
| 25 | * @id ID of the resource to check |
| 26 | * |
| 27 | * @returns 0 on success (if access is granted), -EINVAL if access is denied. |
| 28 | * Else, returns an appropriate negative ERRNO value |
| 29 | */ |
| 30 | int stm32_etzpc_check_access_by_id(ofnode device_node, u32 id); |
| 31 | |
| 32 | #endif /* MACH_ETZPC_H*/ |