fm_private.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef __FM_PRIVATE_H__
  2. #define __FM_PRIVATE_H__
  3. #include "fm_typedef.h"
  4. typedef enum fm_priv_state {
  5. UNINITED,
  6. INITED
  7. } fm_priv_state_t;
  8. typedef enum fm_adpll_state {
  9. FM_ADPLL_ON,
  10. FM_ADPLL_OFF
  11. } fm_adpll_state_t;
  12. typedef enum fm_hl_dese {
  13. FM_HL_DESE_LOW,
  14. FM_HL_DESE_HIGH
  15. } fm_hl_dese_t;
  16. typedef enum fm_adpll_clk {
  17. FM_ADPLL_16M,
  18. FM_ADPLL_15M
  19. } fm_adpll_clk_t;
  20. typedef enum fm_mcu_desense {
  21. FM_MCU_DESE_ENABLE,
  22. FM_MCU_DESE_DISABLE
  23. } fm_mcu_desense_t;
  24. typedef enum fm_gps_desense {
  25. FM_GPS_DESE_ENABLE,
  26. FM_GPS_DESE_DISABLE
  27. } fm_gps_desense_t;
  28. /* 6620 */
  29. typedef struct MT6620fm_priv_cb {
  30. /* Basic functions. */
  31. int (*hl_side)(uint16_t freq, int *hl);
  32. int (*adpll_freq_avoid)(uint16_t freq, int *freqavoid);
  33. int (*mcu_freq_avoid)(uint16_t freq, int *freqavoid);
  34. int (*tx_pwr_ctrl)(uint16_t freq, int *ctr);
  35. int (*rtc_drift_ctrl)(uint16_t freq, int *ctr);
  36. int (*tx_desense_wifi)(uint16_t freq, int *ctr);
  37. int (*is_dese_chan)(fm_u16 freq); /* check if this is a de-sense channel */
  38. } MT6620fm_priv_cb_t;
  39. typedef struct MT6620fm_priv {
  40. int state;
  41. void *data;
  42. MT6620fm_priv_cb_t priv_tbl;
  43. } MT6620fm_priv_t;
  44. /* 6628 */
  45. typedef struct fm_priv_cb {
  46. /* De-sense functions. */
  47. fm_s32 (*is_dese_chan)(fm_u16 freq); /* check if this is a de-sense channel */
  48. fm_s32 (*hl_dese)(fm_u16 freq, void *arg); /* return value: 0, low side; 1, high side; else error no */
  49. fm_s32 (*fa_dese)(fm_u16 freq, void *arg); /* return value: 0, fa off; 1, fa on; else error no */
  50. fm_s32 (*mcu_dese)(fm_u16 freq, void *arg); /* return value: 0, mcu dese disable; 1, enable; else error no */
  51. fm_s32 (*gps_dese)(fm_u16 freq, void *arg); /* return value: 0,mcu dese disable; 1, enable; else error no */
  52. fm_u16 (*chan_para_get)(fm_u16 freq); /* get channel parameter, HL side/ FA / ATJ */
  53. } fm_priv_cb_t;
  54. typedef struct fm_priv {
  55. fm_s32 state;
  56. fm_priv_cb_t priv_tbl;
  57. void *data;
  58. } fm_priv_t;
  59. typedef struct fm_pub_cb {
  60. /* Basic functions. */
  61. fm_s32 (*read)(fm_u8 addr, fm_u16 *val);
  62. fm_s32 (*write)(fm_u8 addr, fm_u16 val);
  63. fm_s32 (*setbits)(fm_u8 addr, fm_u16 bits, fm_u16 mask);
  64. fm_s32 (*rampdown)(void);
  65. fm_s32 (*msdelay)(fm_u32 val);
  66. fm_s32 (*usdelay)(fm_u32 val);
  67. fm_s32 (*log)(const fm_s8 *arg1, ...);
  68. } fm_pub_cb_t;
  69. typedef struct fm_pub {
  70. fm_s32 state;
  71. void *data;
  72. struct fm_pub_cb pub_tbl;
  73. } fm_pub_t;
  74. #if 0 /* (!defined(MT6620_FM)&&!defined(MT6628_FM)) */
  75. extern fm_s32 fm_priv_register(struct fm_priv *pri, struct fm_pub *pub);
  76. extern fm_s32 fm_priv_unregister(struct fm_priv *pri, struct fm_pub *pub);
  77. #endif
  78. #endif /* __FM_PRIVATE_H__ */