ir-kbd-i2c.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef _IR_I2C
  2. #define _IR_I2C
  3. #include <media/rc-core.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 rc_dev *rc;
  10. /* Used to avoid fast repeating */
  11. unsigned char old;
  12. u32 polling_interval; /* in ms */
  13. struct delayed_work work;
  14. char name[32];
  15. char phys[32];
  16. int (*get_key)(struct IR_i2c *ir, enum rc_type *protocol,
  17. u32 *scancode, u8 *toggle);
  18. };
  19. enum ir_kbd_get_key_fn {
  20. IR_KBD_GET_KEY_CUSTOM = 0,
  21. IR_KBD_GET_KEY_PIXELVIEW,
  22. IR_KBD_GET_KEY_HAUP,
  23. IR_KBD_GET_KEY_KNC1,
  24. IR_KBD_GET_KEY_FUSIONHDTV,
  25. IR_KBD_GET_KEY_HAUP_XVR,
  26. IR_KBD_GET_KEY_AVERMEDIA_CARDBUS,
  27. };
  28. /* Can be passed when instantiating an ir_video i2c device */
  29. struct IR_i2c_init_data {
  30. char *ir_codes;
  31. const char *name;
  32. u64 type; /* RC_BIT_RC5, etc */
  33. u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
  34. /*
  35. * Specify either a function pointer or a value indicating one of
  36. * ir_kbd_i2c's internal get_key functions
  37. */
  38. int (*get_key)(struct IR_i2c *ir, enum rc_type *protocol,
  39. u32 *scancode, u8 *toggle);
  40. enum ir_kbd_get_key_fn internal_get_key_func;
  41. struct rc_dev *rc_dev;
  42. };
  43. #endif