123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #include <core/device.h>
- #include <core/firmware.h>
- int
- nvkm_firmware_get(struct nvkm_device *device, const char *fwname,
- const struct firmware **fw)
- {
- char f[64];
- char cname[16];
- int i;
-
- strncpy(cname, device->chip->name, sizeof(cname));
- cname[sizeof(cname) - 1] = '\0';
- i = strlen(cname);
- while (i) {
- --i;
- cname[i] = tolower(cname[i]);
- }
- snprintf(f, sizeof(f), "nvidia/%s/%s.bin", cname, fwname);
- return request_firmware(fw, f, device->dev);
- }
- void
- nvkm_firmware_put(const struct firmware *fw)
- {
- release_firmware(fw);
- }
|