dib9000.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef DIB9000_H
  2. #define DIB9000_H
  3. #include "dibx000_common.h"
  4. struct dib9000_config {
  5. u8 dvbt_mode;
  6. u8 output_mpeg2_in_188_bytes;
  7. u8 hostbus_diversity;
  8. struct dibx000_bandwidth_config *bw;
  9. u16 if_drives;
  10. u32 timing_frequency;
  11. u32 xtal_clock_khz;
  12. u32 vcxo_timer;
  13. u32 demod_clock_khz;
  14. const u8 *microcode_B_fe_buffer;
  15. u32 microcode_B_fe_size;
  16. struct dibGPIOFunction gpio_function[2];
  17. struct dibSubbandSelection subband;
  18. u8 output_mode;
  19. };
  20. #define DEFAULT_DIB9000_I2C_ADDRESS 18
  21. #if IS_REACHABLE(CONFIG_DVB_DIB9000)
  22. extern struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, const struct dib9000_config *cfg);
  23. extern int dib9000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, u8 default_addr, u8 first_addr);
  24. extern struct i2c_adapter *dib9000_get_tuner_interface(struct dvb_frontend *fe);
  25. extern struct i2c_adapter *dib9000_get_i2c_master(struct dvb_frontend *fe, enum dibx000_i2c_interface intf, int gating);
  26. extern int dib9000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val);
  27. extern int dib9000_fw_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff);
  28. extern int dib9000_fw_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff);
  29. extern int dib9000_firmware_post_pll_init(struct dvb_frontend *fe);
  30. extern int dib9000_set_slave_frontend(struct dvb_frontend *fe, struct dvb_frontend *fe_slave);
  31. extern int dib9000_remove_slave_frontend(struct dvb_frontend *fe);
  32. extern struct dvb_frontend *dib9000_get_slave_frontend(struct dvb_frontend *fe, int slave_index);
  33. extern struct i2c_adapter *dib9000_get_component_bus_interface(struct dvb_frontend *fe);
  34. extern int dib9000_set_i2c_adapter(struct dvb_frontend *fe, struct i2c_adapter *i2c);
  35. extern int dib9000_fw_set_component_bus_speed(struct dvb_frontend *fe, u16 speed);
  36. #else
  37. static inline struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib9000_config *cfg)
  38. {
  39. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  40. return NULL;
  41. }
  42. static inline struct i2c_adapter *dib9000_get_i2c_master(struct dvb_frontend *fe, enum dibx000_i2c_interface intf, int gating)
  43. {
  44. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  45. return NULL;
  46. }
  47. static inline int dib9000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, u8 default_addr, u8 first_addr)
  48. {
  49. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  50. return -ENODEV;
  51. }
  52. static inline struct i2c_adapter *dib9000_get_tuner_interface(struct dvb_frontend *fe)
  53. {
  54. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  55. return NULL;
  56. }
  57. static inline int dib9000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val)
  58. {
  59. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  60. return -ENODEV;
  61. }
  62. static inline int dib9000_fw_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
  63. {
  64. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  65. return -ENODEV;
  66. }
  67. static inline int dib9000_fw_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
  68. {
  69. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  70. return -ENODEV;
  71. }
  72. static inline int dib9000_firmware_post_pll_init(struct dvb_frontend *fe)
  73. {
  74. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  75. return -ENODEV;
  76. }
  77. static inline int dib9000_set_slave_frontend(struct dvb_frontend *fe, struct dvb_frontend *fe_slave)
  78. {
  79. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  80. return -ENODEV;
  81. }
  82. static inline int dib9000_remove_slave_frontend(struct dvb_frontend *fe)
  83. {
  84. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  85. return -ENODEV;
  86. }
  87. static inline struct dvb_frontend *dib9000_get_slave_frontend(struct dvb_frontend *fe, int slave_index)
  88. {
  89. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  90. return NULL;
  91. }
  92. static inline struct i2c_adapter *dib9000_get_component_bus_interface(struct dvb_frontend *fe)
  93. {
  94. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  95. return NULL;
  96. }
  97. static inline int dib9000_set_i2c_adapter(struct dvb_frontend *fe, struct i2c_adapter *i2c)
  98. {
  99. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  100. return -ENODEV;
  101. }
  102. static inline int dib9000_fw_set_component_bus_speed(struct dvb_frontend *fe, u16 speed)
  103. {
  104. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  105. return -ENODEV;
  106. }
  107. #endif
  108. #endif