• Home
  • Raw
  • Download

Lines Matching full:firmware

3  * main.c - Multi purpose firmware loading support
24 #include <linux/firmware.h>
40 #include "firmware.h"
44 MODULE_DESCRIPTION("Multi purpose firmware loading support");
55 * Names of firmware images which have been cached successfully
57 * helper can trace which firmware images have been cached
93 /* Builtin firmware support */
100 static void fw_copy_to_prealloc_buf(struct firmware *fw, in fw_copy_to_prealloc_buf()
108 static bool fw_get_builtin_firmware(struct firmware *fw, const char *name, in fw_get_builtin_firmware()
126 static bool fw_is_builtin_firmware(const struct firmware *fw) in fw_is_builtin_firmware()
137 #else /* Module case - no builtin firmware support */
139 static inline bool fw_get_builtin_firmware(struct firmware *fw, in fw_get_builtin_firmware()
146 static inline bool fw_is_builtin_firmware(const struct firmware *fw) in fw_is_builtin_firmware()
208 /* Returns 1 for batching firmware requests with the same name */
277 /* direct firmware loading support */
281 "/lib/firmware/updates/" UTS_RELEASE,
282 "/lib/firmware/updates",
283 "/lib/firmware/" UTS_RELEASE,
284 "/lib/firmware"
293 MODULE_PARM_DESC(path, "customized firmware image search path with a higher priority than default p…
349 /* firmware holds the ownership of pages */
350 static void firmware_free_data(const struct firmware *fw) in firmware_free_data()
360 /* store the pages buffer info firmware from buf */
361 static void fw_set_page_data(struct fw_priv *fw_priv, struct firmware *fw) in fw_set_page_data()
416 /* add firmware name into devres list */
451 int assign_fw(struct firmware *fw, struct device *device, in assign_fw()
464 * add firmware name into devres list so that we can auto cache in assign_fw()
465 * and uncache firmware for device. in assign_fw()
470 /* don't cache firmware handled without uevent */ in assign_fw()
481 * After caching firmware image is started, let it piggyback in assign_fw()
482 * on request firmware. in assign_fw()
496 /* prepare firmware and firmware_buf structs;
497 * return 0 if a firmware is already assigned, 1 if need to load one,
501 _request_firmware_prepare(struct firmware **firmware_p, const char *name, in _request_firmware_prepare()
505 struct firmware *firmware; in _request_firmware_prepare() local
509 *firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL); in _request_firmware_prepare()
510 if (!firmware) { in _request_firmware_prepare()
511 dev_err(device, "%s: kmalloc(struct firmware) failed\n", in _request_firmware_prepare()
516 if (fw_get_builtin_firmware(firmware, name, dbuf, size)) { in _request_firmware_prepare()
526 * of requesting firmware. in _request_firmware_prepare()
528 firmware->priv = fw_priv; in _request_firmware_prepare()
533 fw_set_page_data(fw_priv, firmware); in _request_firmware_prepare()
552 static void fw_abort_batch_reqs(struct firmware *fw) in fw_abort_batch_reqs()
567 _request_firmware(const struct firmware **firmware_p, const char *name, in _request_firmware()
571 struct firmware *fw = NULL; in _request_firmware()
591 "Direct firmware load for %s failed with error %d\n", in _request_firmware()
609 * request_firmware() - send firmware request and wait for it
610 * @firmware_p: pointer to firmware image
611 * @name: name of firmware file
612 * @device: device for which firmware is being loaded
614 * @firmware_p will be used to return a firmware image by the name
619 * @name will be used as $FIRMWARE in the uevent environment and
621 * firmware image for this or any other device.
629 request_firmware(const struct firmware **firmware_p, const char *name, in request_firmware()
645 * @firmware: pointer to firmware image
646 * @name: name of firmware file
647 * @device: device for which firmware is being loaded
652 * however, however failures to find the firmware file with it are still
656 int firmware_request_nowarn(const struct firmware **firmware, const char *name, in firmware_request_nowarn() argument
663 ret = _request_firmware(firmware, name, device, NULL, 0, in firmware_request_nowarn()
671 * request_firmware_direct() - load firmware directly without usermode helper
672 * @firmware_p: pointer to firmware image
673 * @name: name of firmware file
674 * @device: device for which firmware is being loaded
677 * fall back to usermode helper even if the firmware couldn't be loaded
681 int request_firmware_direct(const struct firmware **firmware_p, in request_firmware_direct()
696 * firmware_request_cache() - cache firmware for suspend so resume can use it
697 * @name: name of firmware file
698 * @device: device for which firmware should be cached for
701 * require loading firmware on system reboot. This optimization may still
702 * require the firmware present on resume from suspend. This routine can be
703 * used to ensure the firmware is present on resume from suspend in these
720 * request_firmware_into_buf() - load firmware into a previously allocated buffer
721 * @firmware_p: pointer to firmware image
722 * @name: name of firmware file
723 * @device: device for which firmware is being loaded and DMA region allocated
724 * @buf: address of buffer to load firmware into
728 * allocate a buffer to hold the firmware data. Instead, the firmware
732 * This function doesn't cache firmware either.
735 request_firmware_into_buf(const struct firmware **firmware_p, const char *name, in request_firmware_into_buf()
752 * release_firmware() - release the resource associated with a firmware image
753 * @fw: firmware resource to release
755 void release_firmware(const struct firmware *fw) in release_firmware()
772 void (*cont)(const struct firmware *fw, void *context);
779 const struct firmware *fw; in request_firmware_work_func()
795 * @module: module requesting the firmware
796 * @uevent: sends uevent to copy the firmware image if this flag
797 * is non-zero else the firmware copy must be done manually.
798 * @name: name of firmware file
799 * @device: device for which firmware is being loaded
802 * @fw may be %NULL if firmware request fails.
803 * @cont: function will be called asynchronously when the firmware
811 * requesting firmware in their ->probe() methods, if
820 void (*cont)(const struct firmware *fw, void *context)) in request_firmware_nowait()
863 * cache_firmware() - cache one firmware image in kernel memory space
864 * @fw_name: the firmware image name
866 * Cache firmware in kernel memory so that drivers can use it when
867 * system isn't ready for them to request firmware image from userspace.
869 * nowait version to get the cached firmware without any interacting
872 * Return 0 if the firmware image has been cached successfully
879 const struct firmware *fw; in cache_firmware()
905 * uncache_firmware() - remove one cached firmware image
906 * @fw_name: the firmware image name
908 * Uncache one firmware image which has been cached successfully
911 * Return 0 if the firmware cache has been removed successfully
918 struct firmware fw; in uncache_firmware()
1044 /* only one cache entry for one firmware */ in dev_cache_fw_image()
1081 * device_cache_fw_images() - cache devices' firmware
1084 * successfully before, the firmware names are recored into the
1088 * time when system is not ready to complete loading firmware.
1107 /* wait for completion of caching firmware for all devices */ in device_cache_fw_images()
1114 * device_uncache_fw_images() - uncache devices' firmware
1176 /* stop caching firmware once syscore_suspend is reached */