tda18271.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 atv_b;
  26. struct tda18271_std_map_item atv_dk;
  27. struct tda18271_std_map_item atv_gh;
  28. struct tda18271_std_map_item atv_i;
  29. struct tda18271_std_map_item atv_l;
  30. struct tda18271_std_map_item atv_lc;
  31. struct tda18271_std_map_item atv_mn;
  32. struct tda18271_std_map_item atsc_6;
  33. struct tda18271_std_map_item dvbt_6;
  34. struct tda18271_std_map_item dvbt_7;
  35. struct tda18271_std_map_item dvbt_8;
  36. struct tda18271_std_map_item qam_6;
  37. struct tda18271_std_map_item qam_8;
  38. };
  39. enum tda18271_i2c_gate {
  40. TDA18271_GATE_AUTO = 0,
  41. TDA18271_GATE_ANALOG,
  42. TDA18271_GATE_DIGITAL,
  43. };
  44. struct tda18271_config {
  45. struct tda18271_std_map *std_map;
  46. enum tda18271_i2c_gate gate;
  47. };
  48. #if defined(CONFIG_DVB_TDA18271) || (defined(CONFIG_DVB_TDA18271_MODULE) && defined(MODULE))
  49. extern struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
  50. struct i2c_adapter *i2c,
  51. struct tda18271_config *cfg);
  52. #else
  53. static inline struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe,
  54. u8 addr,
  55. struct i2c_adapter *i2c,
  56. struct tda18271_config *cfg)
  57. {
  58. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
  59. return NULL;
  60. }
  61. #endif
  62. #endif /* __TDA18271_H__ */