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