Caleb Connolly | ceb9262 | 2023-09-26 17:12:13 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */ |
| 3 | |
| 4 | #ifndef __QCOM_COMMAND_DB_H__ |
| 5 | #define __QCOM_COMMAND_DB_H__ |
| 6 | |
| 7 | #include <linux/err.h> |
| 8 | #include <dm/device.h> |
| 9 | |
| 10 | enum cmd_db_hw_type { |
| 11 | CMD_DB_HW_INVALID = 0, |
| 12 | CMD_DB_HW_MIN = 3, |
| 13 | CMD_DB_HW_ARC = CMD_DB_HW_MIN, |
| 14 | CMD_DB_HW_VRM = 4, |
| 15 | CMD_DB_HW_BCM = 5, |
| 16 | CMD_DB_HW_MAX = CMD_DB_HW_BCM, |
| 17 | CMD_DB_HW_ALL = 0xff, |
| 18 | }; |
| 19 | |
| 20 | #if IS_ENABLED(CONFIG_QCOM_COMMAND_DB) |
| 21 | u32 cmd_db_read_addr(const char *resource_id); |
| 22 | |
| 23 | const void *cmd_db_read_aux_data(const char *resource_id, size_t *len); |
| 24 | |
| 25 | enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id); |
| 26 | |
| 27 | int cmd_db_init(ofnode node); |
| 28 | |
| 29 | #else |
| 30 | static inline u32 cmd_db_read_addr(const char *resource_id) |
| 31 | { return 0; } |
| 32 | |
| 33 | static inline const void *cmd_db_read_aux_data(const char *resource_id, size_t *len) |
| 34 | { return ERR_PTR(-ENODEV); } |
| 35 | |
| 36 | static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id) |
| 37 | { return -ENODEV; } |
| 38 | |
| 39 | static inline int cmd_db_ready(void) |
| 40 | { return -ENODEV; } |
| 41 | #endif /* CONFIG_QCOM_COMMAND_DB */ |
| 42 | #endif /* __QCOM_COMMAND_DB_H__ */ |