tvafe_cvd.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*******************************************************************
  2. * Copyright C 2010 by Amlogic, Inc. All Rights Reserved.
  3. * File name: TVAFE_CVD.h
  4. * Description: IO function, structure, enum, used in TVIN AFE sub-module processing
  5. *******************************************************************/
  6. #ifndef _TVAFE_CVD_H
  7. #define _TVAFE_CVD_H
  8. // ***************************************************************************
  9. // *** enum definitions *********************************************
  10. // ***************************************************************************
  11. typedef enum tvafe_cvd2_state_e {
  12. TVAFE_CVD2_STATE_IDLE = 0,
  13. TVAFE_CVD2_STATE_INIT,
  14. TVAFE_CVD2_STATE_FIND,
  15. } tvafe_cvd2_state_t;
  16. // ***************************************************************************
  17. // *** structure definitions *********************************************
  18. // ***************************************************************************
  19. typedef struct tvafe_cvd2_hw_data_s {
  20. bool no_sig;
  21. bool h_lock;
  22. bool v_lock;
  23. bool h_nonstd;
  24. bool v_nonstd;
  25. bool no_color_burst;
  26. bool comb3d_off;
  27. bool chroma_lock;
  28. bool pal;
  29. bool secam;
  30. bool line625;
  31. bool noisy;
  32. bool vcr;
  33. bool vcrtrick;
  34. bool vcrff;
  35. bool vcrrew;
  36. unsigned char cordic;
  37. } tvafe_cvd2_hw_data_t;
  38. //CVD2 status list
  39. typedef struct tvafe_cvd2_info_s {
  40. struct tvafe_cvd2_hw_data_s hw_data[3];
  41. struct tvafe_cvd2_hw_data_s data;
  42. unsigned char hw_data_cur;
  43. bool s_video;
  44. bool tuner;
  45. enum tvin_sig_fmt_e config_fmt;
  46. enum tvin_sig_fmt_e manual_fmt;
  47. enum tvafe_cvd2_state_e state;
  48. unsigned int state_cnt;
  49. unsigned int mem_addr;
  50. unsigned int mem_size;
  51. #ifdef TVAFE_SET_CVBS_CDTO_EN
  52. unsigned int hcnt64[4];
  53. unsigned int hcnt64_cnt;
  54. #endif
  55. #ifdef TVAFE_SET_CVBS_PGA_EN
  56. unsigned short dgain[4];
  57. unsigned short dgain_cnt;
  58. #endif
  59. unsigned int comb_check_cnt;
  60. unsigned int fmt_shift_cnt;
  61. unsigned int fmt_loop_cnt;
  62. bool non_std_enable;
  63. bool non_std_config;
  64. bool non_std_worst;
  65. bool adc_reload_en;
  66. } tvafe_cvd2_info_t;
  67. // *****************************************************************************
  68. // ******** GLOBAL FUNCTION CLAIM ********
  69. // *****************************************************************************
  70. extern void tvafe_cvd2_try_format(struct tvafe_cvd2_info_s *cvd2_info, enum tvin_sig_fmt_e fmt);
  71. extern void tvafe_cvd2_set_default(struct tvafe_cvd2_info_s *cvd2_info);
  72. extern bool tvafe_cvd2_no_sig(struct tvafe_cvd2_info_s *cvd2_info);
  73. extern bool tvafe_cvd2_fmt_chg(struct tvafe_cvd2_info_s *cvd2_info);
  74. extern enum tvin_sig_fmt_e tvafe_cvd2_get_format(struct tvafe_cvd2_info_s *cvd2_info);
  75. #ifdef TVAFE_SET_CVBS_PGA_EN
  76. extern void tvafe_set_cvbs_pga(struct tvafe_cvd2_info_s *cvd2_info);
  77. #endif
  78. #ifdef TVAFE_SET_CVBS_CDTO_EN
  79. extern void tvafe_set_cvbs_cdto(struct tvafe_cvd2_info_s *cvd2_info, unsigned int hcnt64);
  80. #endif
  81. void tvafe_check_cvbs_3d_comb(struct tvafe_cvd2_info_s *cvd2_info);
  82. void tvafe_cvd2_reset_pga(struct tvafe_cvd2_info_s *cvd2_info);
  83. #ifdef TVAFE_SET_CVBS_MANUAL_FMT_POS
  84. void tvafe_cvd2_set_video_positon(struct tvafe_cvd2_info_s *cvd2_info, enum tvin_sig_fmt_e fmt);
  85. #endif
  86. #endif // _TVAFE_CVD_H