QCOM_RPMH depends on QCOM_COMMAND_DB, so the RPMh RSC device and the children it binds, such as the clock and power domain devices, are only built when Command DB is enabled. rpmh-rsc.c itself never calls into Command DB, only the RPMh users do.
In some scenarios, such as Snagboot mode, no Command DB data is available, so there is nothing for the driver to read. The RPMh RSC device and its clock children are still needed there, for example the rpmhcc clock used by UFS. Remove the dependency of QCOM_RPMH on QCOM_COMMAND_DB, and add stubs for cmd_db_read_slave_id() and cmd_db_read_aux_data() so that the RPMh users still build when QCOM_COMMAND_DB is disabled. The stubs return CMD_DB_HW_INVALID and an error pointer, and cmd_db_read_addr() already returns 0. The power domain, regulator and interconnect users therefore fail to probe with an error message, which is what they already do when Command DB has no data. Signed-off-by: Balaji Selvanathan <[email protected]> --- Changes in v10: - Newly added in v10, replaces the cmd-db.c change in v9 --- drivers/soc/qcom/Kconfig | 1 - include/soc/qcom/cmd-db.h | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index cdd9e30f43e..1799925f07a 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -20,7 +20,6 @@ config QCOM_COMMAND_DB config QCOM_RPMH bool "Qualcomm RPMh support" - depends on QCOM_COMMAND_DB help Say y here to support the Qualcomm RPMh (resource peripheral manager) if you need to control regulators on Qualcomm platforms, say y here. diff --git a/include/soc/qcom/cmd-db.h b/include/soc/qcom/cmd-db.h index 16609ac9d78..0d5693decd1 100644 --- a/include/soc/qcom/cmd-db.h +++ b/include/soc/qcom/cmd-db.h @@ -28,5 +28,12 @@ const void *cmd_db_read_aux_data(const char *resource_id, size_t *len); static inline u32 cmd_db_read_addr(const char *resource_id) { return 0; } +static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id) +{ return CMD_DB_HW_INVALID; } + +static inline const void *cmd_db_read_aux_data(const char *resource_id, + size_t *len) +{ return ERR_PTR(-ENODEV); } + #endif /* CONFIG_QCOM_COMMAND_DB */ #endif /* __QCOM_COMMAND_DB_H__ */ -- 2.34.1
