Rev 5056 | Rev 6102 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1408 | serge | 1 | #ifndef _LINUX_FIRMWARE_H |
2 | #define _LINUX_FIRMWARE_H |
||
3 | |||
1412 | serge | 4 | #include |
5 | #include |
||
6 | #include |
||
6082 | serge | 7 | #include |
8 | #include |
||
1408 | serge | 9 | |
10 | #define FW_ACTION_NOHOTPLUG 0 |
||
11 | #define FW_ACTION_HOTPLUG 1 |
||
12 | |||
1412 | serge | 13 | struct device; |
14 | |||
15 | struct platform_device |
||
16 | { |
||
17 | struct device dev; |
||
18 | }; |
||
19 | |||
1408 | serge | 20 | struct firmware { |
21 | size_t size; |
||
22 | const u8 *data; |
||
23 | }; |
||
24 | |||
25 | |||
26 | struct builtin_fw { |
||
27 | char *name; |
||
28 | void *data; |
||
29 | unsigned long size; |
||
30 | }; |
||
31 | |||
32 | /* We have to play tricks here much like stringify() to get the |
||
33 | __COUNTER__ macro to be expanded as we want it */ |
||
34 | #define __fw_concat1(x, y) x##y |
||
35 | #define __fw_concat(x, y) __fw_concat1(x, y) |
||
36 | |||
37 | #define DECLARE_BUILTIN_FIRMWARE(name, blob) \ |
||
38 | DECLARE_BUILTIN_FIRMWARE_SIZE(name, &(blob), sizeof(blob)) |
||
39 | |||
40 | #define DECLARE_BUILTIN_FIRMWARE_SIZE(name, blob, size) \ |
||
41 | static const struct builtin_fw __fw_concat(__builtin_fw,__COUNTER__) \ |
||
42 | __used __section(.builtin_fw) = { name, blob, size } |
||
43 | |||
44 | int request_firmware(const struct firmware **fw, const char *name, |
||
45 | struct device *device); |
||
46 | int request_firmware_nowait( |
||
5056 | serge | 47 | struct module *module, bool uevent, |
48 | const char *name, struct device *device, gfp_t gfp, void *context, |
||
1408 | serge | 49 | void (*cont)(const struct firmware *fw, void *context)); |
5056 | serge | 50 | int request_firmware_direct(const struct firmware **fw, const char *name, |
51 | struct device *device); |
||
1408 | serge | 52 | |
53 | void release_firmware(const struct firmware *fw); |
||
54 | |||
1412 | serge | 55 | |
56 | #define platform_device_unregister(x) |
||
57 | |||
58 | struct platform_device |
||
59 | *platform_device_register_simple(const char*, int, void*, unsigned int); |
||
60 | |||
61 | #define MAX_ERRNO 4095 |
||
62 | |||
63 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) |
||
64 | |||
1408 | serge | 65 | |
66 | #endif |