Subversion Repositories Kolibri OS

Rev

Rev 6082 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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