dib9000.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef DIB9000_H
  3. #define DIB9000_H
  4. #include "dibx000_common.h"
  5. struct dib9000_config {
  6. u8 dvbt_mode;
  7. u8 output_mpeg2_in_188_bytes;
  8. u8 hostbus_diversity;
  9. struct dibx000_bandwidth_config *bw;
  10. u16 if_drives;
  11. u32 timing_frequency;
  12. u32 xtal_clock_khz;
  13. u32 vcxo_timer;
  14. u32 demod_clock_khz;
  15. const u8 *microcode_B_fe_buffer;
  16. u32 microcode_B_fe_size;
  17. struct dibGPIOFunction gpio_function[2];
  18. struct dibSubbandSelection subband;
  19. u8 output_mode;
  20. };
  21. #define DEFAULT_DIB9000_I2C_ADDRESS 18
  22. #if IS_REACHABLE(CONFIG_DVB_DIB9000)
  23. extern struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, const struct dib9000_config *cfg);
  24. extern int dib9000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods, u8 default_addr, u8 first_addr);
  25. extern struct i2c_adapter *dib9000_get_tuner_interface(struct dvb_frontend *fe);
  26. extern struct i2c_adapter *dib9000_get_i2c_master(struct dvb_frontend *fe, enum dibx000_i2c_interface intf, int gating);
  27. extern int dib9000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val);
  28. extern int dib9000_fw_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff);
  29. extern int dib9000_fw_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff);
  30. extern int dib9000_firmware_post_pll_init(struct dvb_frontend *fe);
  31. extern int dib9000_set_slave_frontend(struct dvb_frontend *fe, struct dvb_frontend *fe_slave);
  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 struct dvb_frontend *dib9000_get_slave_frontend(struct dvb_frontend *fe, int slave_index)
  83. {
  84. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  85. return NULL;
  86. }
  87. static inline struct i2c_adapter *dib9000_get_component_bus_interface(struct dvb_frontend *fe)
  88. {
  89. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  90. return NULL;
  91. }
  92. static inline int dib9000_set_i2c_adapter(struct dvb_frontend *fe, struct i2c_adapter *i2c)
  93. {
  94. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  95. return -ENODEV;
  96. }
  97. static inline int dib9000_fw_set_component_bus_speed(struct dvb_frontend *fe, u16 speed)
  98. {
  99. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  100. return -ENODEV;
  101. }
  102. #endif
  103. #endif