img-ir-raw.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * ImgTec IR Raw Decoder found in PowerDown Controller.
  3. *
  4. * Copyright 2010-2014 Imagination Technologies Ltd.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #ifndef _IMG_IR_RAW_H_
  12. #define _IMG_IR_RAW_H_
  13. struct img_ir_priv;
  14. #ifdef CONFIG_IR_IMG_RAW
  15. /**
  16. * struct img_ir_priv_raw - Private driver data for raw decoder.
  17. * @rdev: Raw remote control device
  18. * @timer: Timer to echo samples to keep soft decoders happy.
  19. * @last_status: Last raw status bits.
  20. */
  21. struct img_ir_priv_raw {
  22. struct rc_dev *rdev;
  23. struct timer_list timer;
  24. u32 last_status;
  25. };
  26. static inline bool img_ir_raw_enabled(struct img_ir_priv_raw *raw)
  27. {
  28. return raw->rdev;
  29. };
  30. void img_ir_isr_raw(struct img_ir_priv *priv, u32 irq_status);
  31. void img_ir_setup_raw(struct img_ir_priv *priv);
  32. int img_ir_probe_raw(struct img_ir_priv *priv);
  33. void img_ir_remove_raw(struct img_ir_priv *priv);
  34. #else
  35. struct img_ir_priv_raw {
  36. };
  37. static inline bool img_ir_raw_enabled(struct img_ir_priv_raw *raw)
  38. {
  39. return false;
  40. };
  41. static inline void img_ir_isr_raw(struct img_ir_priv *priv, u32 irq_status)
  42. {
  43. }
  44. static inline void img_ir_setup_raw(struct img_ir_priv *priv)
  45. {
  46. }
  47. static inline int img_ir_probe_raw(struct img_ir_priv *priv)
  48. {
  49. return -ENODEV;
  50. }
  51. static inline void img_ir_remove_raw(struct img_ir_priv *priv)
  52. {
  53. }
  54. #endif /* CONFIG_IR_IMG_RAW */
  55. #endif /* _IMG_IR_RAW_H_ */