Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __FIRMWARE_FALLBACK_H
0003 #define __FIRMWARE_FALLBACK_H
0004 
0005 #include <linux/firmware.h>
0006 #include <linux/device.h>
0007 
0008 #include "firmware.h"
0009 #include "sysfs.h"
0010 
0011 #ifdef CONFIG_FW_LOADER_USER_HELPER
0012 int firmware_fallback_sysfs(struct firmware *fw, const char *name,
0013                 struct device *device,
0014                 u32 opt_flags,
0015                 int ret);
0016 void kill_pending_fw_fallback_reqs(bool only_kill_custom);
0017 
0018 void fw_fallback_set_cache_timeout(void);
0019 void fw_fallback_set_default_timeout(void);
0020 
0021 #else /* CONFIG_FW_LOADER_USER_HELPER */
0022 static inline int firmware_fallback_sysfs(struct firmware *fw, const char *name,
0023                       struct device *device,
0024                       u32 opt_flags,
0025                       int ret)
0026 {
0027     /* Keep carrying over the same error */
0028     return ret;
0029 }
0030 
0031 static inline void kill_pending_fw_fallback_reqs(bool only_kill_custom) { }
0032 static inline void fw_fallback_set_cache_timeout(void) { }
0033 static inline void fw_fallback_set_default_timeout(void) { }
0034 #endif /* CONFIG_FW_LOADER_USER_HELPER */
0035 
0036 #ifdef CONFIG_EFI_EMBEDDED_FIRMWARE
0037 int firmware_fallback_platform(struct fw_priv *fw_priv);
0038 #else
0039 static inline int firmware_fallback_platform(struct fw_priv *fw_priv)
0040 {
0041     return -ENOENT;
0042 }
0043 #endif
0044 
0045 #endif /* __FIRMWARE_FALLBACK_H */