tda18271.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. tda18271.h - header for the Philips / NXP TDA18271 silicon tuner
  3. Copyright (C) 2007, 2008 Michael Krufky <mkrufky@linuxtv.org>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef __TDA18271_H__
  17. #define __TDA18271_H__
  18. #include <linux/i2c.h>
  19. #include "dvb_frontend.h"
  20. struct tda18271_std_map_item {
  21. u16 if_freq;
  22. u8 std_bits;
  23. };
  24. struct tda18271_std_map {
  25. struct tda18271_std_map_item fm_radio;
  26. struct tda18271_std_map_item atv_b;
  27. struct tda18271_std_map_item atv_dk;
  28. struct tda18271_std_map_item atv_gh;
  29. struct tda18271_std_map_item atv_i;
  30. struct tda18271_std_map_item atv_l;
  31. struct tda18271_std_map_item atv_lc;
  32. struct tda18271_std_map_item atv_mn;
  33. struct tda18271_std_map_item atsc_6;
  34. struct tda18271_std_map_item dvbt_6;
  35. struct tda18271_std_map_item dvbt_7;
  36. struct tda18271_std_map_item dvbt_8;
  37. struct tda18271_std_map_item qam_6;
  38. struct tda18271_std_map_item qam_8;
  39. };
  40. enum tda18271_i2c_gate {
  41. TDA18271_GATE_AUTO = 0,
  42. TDA18271_GATE_ANALOG,
  43. TDA18271_GATE_DIGITAL,
  44. };
  45. struct tda18271_config {
  46. /* override default if freq / std settings (optional) */
  47. struct tda18271_std_map *std_map;
  48. /* use i2c gate provided by analog or digital demod */
  49. enum tda18271_i2c_gate gate;
  50. };
  51. #if defined(CONFIG_DVB_TDA18271) || (defined(CONFIG_DVB_TDA18271_MODULE) && defined(MODULE))
  52. extern struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
  53. struct i2c_adapter *i2c,
  54. struct tda18271_config *cfg);
  55. #else
  56. static inline struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe,
  57. u8 addr,
  58. struct i2c_adapter *i2c,
  59. struct tda18271_config *cfg)
  60. {
  61. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
  62. return NULL;
  63. }
  64. #endif
  65. #endif /* __TDA18271_H__ */