cmd-db.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */
  3. #ifndef __QCOM_COMMAND_DB_H__
  4. #define __QCOM_COMMAND_DB_H__
  5. enum cmd_db_hw_type {
  6. CMD_DB_HW_INVALID = 0,
  7. CMD_DB_HW_MIN = 3,
  8. CMD_DB_HW_ARC = CMD_DB_HW_MIN,
  9. CMD_DB_HW_VRM = 4,
  10. CMD_DB_HW_BCM = 5,
  11. CMD_DB_HW_MAX = CMD_DB_HW_BCM,
  12. CMD_DB_HW_ALL = 0xff,
  13. };
  14. #if IS_ENABLED(CONFIG_QCOM_COMMAND_DB)
  15. u32 cmd_db_read_addr(const char *resource_id);
  16. int cmd_db_read_aux_data(const char *resource_id, u8 *data, size_t len);
  17. size_t cmd_db_read_aux_data_len(const char *resource_id);
  18. enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id);
  19. int cmd_db_ready(void);
  20. #else
  21. static inline u32 cmd_db_read_addr(const char *resource_id)
  22. { return 0; }
  23. static inline int cmd_db_read_aux_data(const char *resource_id, u8 *data,
  24. size_t len)
  25. { return -ENODEV; }
  26. static inline size_t cmd_db_read_aux_data_len(const char *resource_id)
  27. { return -ENODEV; }
  28. static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id)
  29. { return -ENODEV; }
  30. static inline int cmd_db_ready(void)
  31. { return -ENODEV; }
  32. #endif /* CONFIG_QCOM_COMMAND_DB */
  33. #endif /* __QCOM_COMMAND_DB_H__ */