dib0070.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Linux-DVB Driver for DiBcom's DiB0070 base-band RF Tuner.
  4. *
  5. * Copyright (C) 2005-7 DiBcom (http://www.dibcom.fr/)
  6. */
  7. #ifndef DIB0070_H
  8. #define DIB0070_H
  9. struct dvb_frontend;
  10. struct i2c_adapter;
  11. #define DEFAULT_DIB0070_I2C_ADDRESS 0x60
  12. struct dib0070_wbd_gain_cfg {
  13. u16 freq;
  14. u16 wbd_gain_val;
  15. };
  16. struct dib0070_config {
  17. u8 i2c_address;
  18. /* tuner pins controlled externally */
  19. int (*reset) (struct dvb_frontend *, int);
  20. int (*sleep) (struct dvb_frontend *, int);
  21. /* offset in kHz */
  22. int freq_offset_khz_uhf;
  23. int freq_offset_khz_vhf;
  24. u8 osc_buffer_state; /* 0= normal, 1= tri-state */
  25. u32 clock_khz;
  26. u8 clock_pad_drive; /* (Drive + 1) * 2mA */
  27. u8 invert_iq; /* invert Q - in case I or Q is inverted on the board */
  28. u8 force_crystal_mode; /* if == 0 -> decision is made in the driver default: <24 -> 2, >=24 -> 1 */
  29. u8 flip_chip;
  30. u8 enable_third_order_filter;
  31. u8 charge_pump;
  32. const struct dib0070_wbd_gain_cfg *wbd_gain;
  33. u8 vga_filter;
  34. };
  35. #if IS_REACHABLE(CONFIG_DVB_TUNER_DIB0070)
  36. extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg);
  37. extern u16 dib0070_wbd_offset(struct dvb_frontend *);
  38. extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, u8 open);
  39. extern u8 dib0070_get_rf_output(struct dvb_frontend *fe);
  40. extern int dib0070_set_rf_output(struct dvb_frontend *fe, u8 no);
  41. #else
  42. static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg)
  43. {
  44. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  45. return NULL;
  46. }
  47. static inline u16 dib0070_wbd_offset(struct dvb_frontend *fe)
  48. {
  49. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  50. return 0;
  51. }
  52. static inline void dib0070_ctrl_agc_filter(struct dvb_frontend *fe, u8 open)
  53. {
  54. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  55. }
  56. #endif
  57. #endif