ix2505v.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * Driver for Sharp IX2505V (marked B0017) DVB-S silicon tuner
  3. *
  4. * Copyright (C) 2010 Malcolm Priestley
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License Version 2, as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef DVB_IX2505V_H
  16. #define DVB_IX2505V_H
  17. #include <linux/i2c.h>
  18. #include <media/dvb_frontend.h>
  19. /**
  20. * struct ix2505v_config - ix2505 attachment configuration
  21. *
  22. * @tuner_address: tuner address
  23. * @tuner_gain: Baseband AMP gain control 0/1=0dB(default) 2=-2bB 3=-4dB
  24. * @tuner_chargepump: Charge pump output +/- 0=120 1=260 2=555 3=1200(default)
  25. * @min_delay_ms: delay after tune
  26. * @tuner_write_only: disables reads
  27. */
  28. struct ix2505v_config {
  29. u8 tuner_address;
  30. u8 tuner_gain;
  31. u8 tuner_chargepump;
  32. int min_delay_ms;
  33. u8 tuner_write_only;
  34. };
  35. #if IS_REACHABLE(CONFIG_DVB_IX2505V)
  36. /**
  37. * Attach a ix2505v tuner to the supplied frontend structure.
  38. *
  39. * @fe: Frontend to attach to.
  40. * @config: pointer to &struct ix2505v_config
  41. * @i2c: pointer to &struct i2c_adapter.
  42. *
  43. * return: FE pointer on success, NULL on failure.
  44. */
  45. extern struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
  46. const struct ix2505v_config *config, struct i2c_adapter *i2c);
  47. #else
  48. static inline struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
  49. const struct ix2505v_config *config, struct i2c_adapter *i2c)
  50. {
  51. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  52. return NULL;
  53. }
  54. #endif
  55. #endif /* DVB_IX2505V_H */