ir-kbd-i2c.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _IR_I2C
  2. #define _IR_I2C
  3. #include <media/ir-common.h>
  4. #define DEFAULT_POLLING_INTERVAL 100 /* ms */
  5. struct IR_i2c;
  6. struct IR_i2c {
  7. char *ir_codes;
  8. struct i2c_client *c;
  9. struct input_dev *input;
  10. struct ir_input_state ir;
  11. u64 ir_type;
  12. /* Used to avoid fast repeating */
  13. unsigned char old;
  14. u32 polling_interval; /* in ms */
  15. struct delayed_work work;
  16. char name[32];
  17. char phys[32];
  18. int (*get_key)(struct IR_i2c*, u32*, u32*);
  19. };
  20. enum ir_kbd_get_key_fn {
  21. IR_KBD_GET_KEY_CUSTOM = 0,
  22. IR_KBD_GET_KEY_PIXELVIEW,
  23. IR_KBD_GET_KEY_HAUP,
  24. IR_KBD_GET_KEY_KNC1,
  25. IR_KBD_GET_KEY_FUSIONHDTV,
  26. IR_KBD_GET_KEY_HAUP_XVR,
  27. IR_KBD_GET_KEY_AVERMEDIA_CARDBUS,
  28. };
  29. /* Can be passed when instantiating an ir_video i2c device */
  30. struct IR_i2c_init_data {
  31. char *ir_codes;
  32. const char *name;
  33. u64 type; /* IR_TYPE_RC5, etc */
  34. u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
  35. /*
  36. * Specify either a function pointer or a value indicating one of
  37. * ir_kbd_i2c's internal get_key functions
  38. */
  39. int (*get_key)(struct IR_i2c*, u32*, u32*);
  40. enum ir_kbd_get_key_fn internal_get_key_func;
  41. };
  42. #endif