s5p_cec.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* drivers/media/platform/s5p-cec/s5p_cec.h
  2. *
  3. * Samsung S5P HDMI CEC driver
  4. *
  5. * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. */
  12. #ifndef _S5P_CEC_H_
  13. #define _S5P_CEC_H_ __FILE__
  14. #include <linux/clk.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/kernel.h>
  17. #include <linux/mfd/syscon.h>
  18. #include <linux/module.h>
  19. #include <linux/of.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/pm_runtime.h>
  22. #include <linux/timer.h>
  23. #include <linux/workqueue.h>
  24. #include <media/cec.h>
  25. #include "exynos_hdmi_cec.h"
  26. #include "regs-cec.h"
  27. #include "s5p_cec.h"
  28. #define CEC_NAME "s5p-cec"
  29. #define CEC_STATUS_TX_RUNNING (1 << 0)
  30. #define CEC_STATUS_TX_TRANSFERRING (1 << 1)
  31. #define CEC_STATUS_TX_DONE (1 << 2)
  32. #define CEC_STATUS_TX_ERROR (1 << 3)
  33. #define CEC_STATUS_TX_NACK (1 << 4)
  34. #define CEC_STATUS_TX_BYTES (0xFF << 8)
  35. #define CEC_STATUS_RX_RUNNING (1 << 16)
  36. #define CEC_STATUS_RX_RECEIVING (1 << 17)
  37. #define CEC_STATUS_RX_DONE (1 << 18)
  38. #define CEC_STATUS_RX_ERROR (1 << 19)
  39. #define CEC_STATUS_RX_BCAST (1 << 20)
  40. #define CEC_STATUS_RX_BYTES (0xFF << 24)
  41. #define CEC_WORKER_TX_DONE (1 << 0)
  42. #define CEC_WORKER_RX_MSG (1 << 1)
  43. /* CEC Rx buffer size */
  44. #define CEC_RX_BUFF_SIZE 16
  45. /* CEC Tx buffer size */
  46. #define CEC_TX_BUFF_SIZE 16
  47. enum cec_state {
  48. STATE_IDLE,
  49. STATE_BUSY,
  50. STATE_DONE,
  51. STATE_NACK,
  52. STATE_ERROR
  53. };
  54. struct cec_notifier;
  55. struct s5p_cec_dev {
  56. struct cec_adapter *adap;
  57. struct clk *clk;
  58. struct device *dev;
  59. struct mutex lock;
  60. struct regmap *pmu;
  61. struct cec_notifier *notifier;
  62. int irq;
  63. void __iomem *reg;
  64. enum cec_state rx;
  65. enum cec_state tx;
  66. struct cec_msg msg;
  67. };
  68. #endif /* _S5P_CEC_H_ */