tvafe.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*******************************************************************
  2. * Copyright C 2010 by Amlogic, Inc. All Rights Reserved.
  3. * File name: tvafe.h
  4. * Description: IO function, structure, enum, used in TVIN AFE sub-module processing
  5. *******************************************************************/
  6. #ifndef _TVAFE_H
  7. #define _TVAFE_H
  8. #include <linux/tvin/tvin.h>
  9. #include "tvin_global.h"
  10. #include "tvin_format_table.h"
  11. #include "tvafe_cvd.h"
  12. /******************************Definitions************************************/
  13. #define ABS(x) ( (x)<0 ? -(x) : (x))
  14. // ***************************************************************************
  15. // *** enum definitions *********************************************
  16. // ***************************************************************************
  17. typedef enum tvafe_src_type_e {
  18. TVAFE_SRC_TYPE_NULL = 0,
  19. TVAFE_SRC_TYPE_CVBS,
  20. TVAFE_SRC_TYPE_SVIDEO,
  21. TVAFE_SRC_TYPE_VGA,
  22. TVAFE_SRC_TYPE_COMP,
  23. TVAFE_SRC_TYPE_SCART,
  24. } tvafe_src_type_t;
  25. // ***************************************************************************
  26. // *** structure definitions *********************************************
  27. // ***************************************************************************
  28. typedef struct tvafe_operand_s {
  29. unsigned int a;
  30. unsigned int b;
  31. unsigned int c;
  32. unsigned int step;
  33. unsigned int bpg_h;
  34. unsigned int bpg_v;
  35. unsigned int clk_ctl;
  36. unsigned int clk_ext :1;
  37. unsigned int bpg_m :2;
  38. unsigned int lpf_a :1;
  39. unsigned int lpf_b :1;
  40. unsigned int lpf_c :1;
  41. unsigned int clamp_inv:1;
  42. unsigned int clamp_ext:1;
  43. unsigned int adj :1;
  44. unsigned int cnt :3;
  45. unsigned int dir :1;
  46. unsigned int dir0 :1;
  47. unsigned int dir1 :1;
  48. unsigned int dir2 :1;
  49. unsigned int adc0;
  50. unsigned int adc1;
  51. unsigned int adc2;
  52. unsigned int data0;
  53. unsigned int data1;
  54. unsigned int data2;
  55. } tvafe_operand_t;
  56. typedef struct tvafe_info_s {
  57. struct tvafe_cvd2_info_s cvd2_info;
  58. struct tvafe_pin_mux_s *pinmux;
  59. //signal parameters
  60. struct tvin_parm_s param;
  61. enum tvafe_cmd_status_e cmd_status;
  62. //WSS data
  63. struct tvafe_comp_wss_s comp_wss;
  64. //adc calibration data
  65. struct tvafe_adc_cal_s adc_cal_val;
  66. struct tvafe_operand_s operand;
  67. unsigned char watchdog_cnt;
  68. unsigned char vga_auto_flag: 1;
  69. /* tvafe last fmt */
  70. enum tvin_sig_fmt_e last_fmt;
  71. struct tvafe_vga_parm_s vga_parm;
  72. } tvafe_info_t;
  73. #endif // _TVAFE_H