Skip to content

Commit b2461e2

Browse files
MrVanShawn Guo
authored andcommitted
firmware: imx: Add stub functions for SCMI MISC API
To ensure successful builds when CONFIG_IMX_SCMI_MISC_DRV is not enabled, this patch adds static inline stub implementations for the following functions: - scmi_imx_misc_ctrl_get() - scmi_imx_misc_ctrl_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. This patch also drops the changes in commit 540c830 ("firmware: imx: remove duplicate scmi_imx_misc_ctrl_get()"). The original change aimed to simplify the handling of optional features by removing conditional stubs. However, the use of conditional stubs is necessary when CONFIG_IMX_SCMI_MISC_DRV is n, while consumer driver is set to y. This is not a matter of preserving legacy patterns, but rather to ensure that there is no link error whether for module or built-in. Fixes: 0b4f8a6 ("firmware: imx: Add i.MX95 MISC 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 37e5caa commit b2461e2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • include/linux/firmware/imx

include/linux/firmware/imx/sm.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,20 @@
2626
#define SCMI_IMX94_CTRL_SAI3_MCLK 5U /*!< WAKE SAI3 MCLK */
2727
#define SCMI_IMX94_CTRL_SAI4_MCLK 6U /*!< WAKE SAI4 MCLK */
2828

29+
#if IS_ENABLED(CONFIG_IMX_SCMI_MISC_DRV)
2930
int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val);
3031
int scmi_imx_misc_ctrl_set(u32 id, u32 val);
32+
#else
33+
static inline int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
34+
{
35+
return -EOPNOTSUPP;
36+
}
37+
38+
static inline int scmi_imx_misc_ctrl_set(u32 id, u32 val)
39+
{
40+
return -EOPNOTSUPP;
41+
}
42+
#endif
3143

3244
int scmi_imx_cpu_start(u32 cpuid, bool start);
3345
int scmi_imx_cpu_started(u32 cpuid, bool *started);

0 commit comments

Comments
 (0)