Skip to content

Commit 222accf

Browse files
MrVanShawn Guo
authored andcommitted
firmware: imx: Add stub functions for SCMI CPU API
To ensure successful builds when CONFIG_IMX_SCMI_CPU_DRV is not enabled, this patch adds static inline stub implementations for the following functions: - scmi_imx_cpu_start() - scmi_imx_cpu_started() - scmi_imx_cpu_reset_vector_set() These stubs return -EOPNOTSUPP to indicate that the functionality is not supported in the current configuration. This avoids potential build or link errors in code that conditionally calls these functions based on feature availability. Fixes: 1055faa ("firmware: imx: Add i.MX95 SCMI CPU driver") Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
1 parent 3fb91b5 commit 222accf

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

  • include/linux/firmware/imx

include/linux/firmware/imx/sm.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,28 @@ static inline int scmi_imx_misc_ctrl_set(u32 id, u32 val)
4141
}
4242
#endif
4343

44+
#if IS_ENABLED(CONFIG_IMX_SCMI_CPU_DRV)
4445
int scmi_imx_cpu_start(u32 cpuid, bool start);
4546
int scmi_imx_cpu_started(u32 cpuid, bool *started);
4647
int scmi_imx_cpu_reset_vector_set(u32 cpuid, u64 vector, bool start, bool boot,
4748
bool resume);
49+
#else
50+
static inline int scmi_imx_cpu_start(u32 cpuid, bool start)
51+
{
52+
return -EOPNOTSUPP;
53+
}
54+
55+
static inline int scmi_imx_cpu_started(u32 cpuid, bool *started)
56+
{
57+
return -EOPNOTSUPP;
58+
}
59+
60+
static inline int scmi_imx_cpu_reset_vector_set(u32 cpuid, u64 vector, bool start,
61+
bool boot, bool resume)
62+
{
63+
return -EOPNOTSUPP;
64+
}
65+
#endif
4866

4967
enum scmi_imx_lmm_op {
5068
SCMI_IMX_LMM_BOOT,

0 commit comments

Comments
 (0)