xref: /openbmc/linux/include/soc/qcom/cmd-db.h (revision d0e22329)
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 
8 enum cmd_db_hw_type {
9 	CMD_DB_HW_INVALID = 0,
10 	CMD_DB_HW_MIN     = 3,
11 	CMD_DB_HW_ARC     = CMD_DB_HW_MIN,
12 	CMD_DB_HW_VRM     = 4,
13 	CMD_DB_HW_BCM     = 5,
14 	CMD_DB_HW_MAX     = CMD_DB_HW_BCM,
15 	CMD_DB_HW_ALL     = 0xff,
16 };
17 
18 #if IS_ENABLED(CONFIG_QCOM_COMMAND_DB)
19 u32 cmd_db_read_addr(const char *resource_id);
20 
21 const void *cmd_db_read_aux_data(const char *resource_id, size_t *len);
22 
23 enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id);
24 
25 int cmd_db_ready(void);
26 #else
27 static inline u32 cmd_db_read_addr(const char *resource_id)
28 { return 0; }
29 
30 static inline const void *cmd_db_read_aux_data(const char *resource_id, size_t *len)
31 { return ERR_PTR(-ENODEV); }
32 
33 static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id)
34 { return -ENODEV; }
35 
36 static inline int cmd_db_ready(void)
37 { return -ENODEV; }
38 #endif /* CONFIG_QCOM_COMMAND_DB */
39 #endif /* __QCOM_COMMAND_DB_H__ */
40