tuner-driver.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. tuner-driver.h - interface for different tuners
  3. Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
  4. minor modifications by Ralph Metzler (rjkm@thp.uni-koeln.de)
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef __TUNER_DRIVER_H__
  18. #define __TUNER_DRIVER_H__
  19. #include <linux/videodev2.h>
  20. #include <linux/i2c.h>
  21. #include "tuner-i2c.h"
  22. #include "dvb_frontend.h"
  23. extern unsigned const int tuner_count;
  24. struct tuner;
  25. struct analog_tuner_ops {
  26. void (*set_tv_freq)(struct dvb_frontend *fe, unsigned int freq);
  27. void (*set_radio_freq)(struct dvb_frontend *fe, unsigned int freq);
  28. int (*has_signal)(struct dvb_frontend *fe);
  29. int (*is_stereo)(struct dvb_frontend *fe);
  30. int (*get_afc)(struct dvb_frontend *fe);
  31. void (*tuner_status)(struct dvb_frontend *fe);
  32. void (*standby)(struct dvb_frontend *fe);
  33. void (*release)(struct dvb_frontend *fe);
  34. int (*i2c_gate_ctrl)(struct dvb_frontend *fe, int enable);
  35. };
  36. struct tuner {
  37. /* device */
  38. struct i2c_client *i2c;
  39. struct list_head list; /* list of tuners */
  40. unsigned int type; /* chip type */
  41. unsigned int mode;
  42. unsigned int mode_mask; /* Combination of allowable modes */
  43. unsigned int tv_freq; /* keep track of the current settings */
  44. unsigned int radio_freq;
  45. unsigned int audmode;
  46. v4l2_std_id std;
  47. int using_v4l2;
  48. struct dvb_frontend fe;
  49. /* used by tda9887 */
  50. unsigned int tda9887_config;
  51. unsigned int config;
  52. int (*tuner_callback) (void *dev, int command,int arg);
  53. };
  54. /* ------------------------------------------------------------------------ */
  55. #define tuner_warn(fmt, arg...) do {\
  56. printk(KERN_WARNING PREFIX "%d-%04x: " fmt, \
  57. i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); } while (0)
  58. #define tuner_info(fmt, arg...) do {\
  59. printk(KERN_INFO PREFIX "%d-%04x: " fmt, \
  60. i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); } while (0)
  61. #define tuner_dbg(fmt, arg...) do {\
  62. extern int tuner_debug; \
  63. if (tuner_debug) \
  64. printk(KERN_DEBUG PREFIX "%d-%04x: " fmt, \
  65. i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); } while (0)
  66. #endif /* __TUNER_DRIVER_H__ */
  67. /*
  68. * Overrides for Emacs so that we follow Linus's tabbing style.
  69. * ---------------------------------------------------------------------------
  70. * Local variables:
  71. * c-basic-offset: 8
  72. * End:
  73. */