tuner-driver.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. extern unsigned const int tuner_count;
  22. struct tuner_operations {
  23. void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
  24. void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
  25. int (*has_signal)(struct i2c_client *c);
  26. int (*is_stereo)(struct i2c_client *c);
  27. int (*get_afc)(struct i2c_client *c);
  28. void (*tuner_status)(struct i2c_client *c);
  29. void (*standby)(struct i2c_client *c);
  30. void (*release)(struct i2c_client *c);
  31. };
  32. struct tuner {
  33. /* device */
  34. struct i2c_client i2c;
  35. unsigned int type; /* chip type */
  36. unsigned int mode;
  37. unsigned int mode_mask; /* Combination of allowable modes */
  38. unsigned int tv_freq; /* keep track of the current settings */
  39. unsigned int radio_freq;
  40. unsigned int audmode;
  41. v4l2_std_id std;
  42. int using_v4l2;
  43. void *priv;
  44. /* used by tda9887 */
  45. unsigned int tda9887_config;
  46. unsigned int config;
  47. int (*tuner_callback) (void *dev, int command,int arg);
  48. struct tuner_operations ops;
  49. };
  50. /* ------------------------------------------------------------------------ */
  51. extern int default_tuner_init(struct i2c_client *c);
  52. extern int tda9887_tuner_init(struct i2c_client *c);
  53. extern int microtune_init(struct i2c_client *c);
  54. extern int tda8290_init(struct i2c_client *c);
  55. extern int tda8290_probe(struct i2c_client *c);
  56. extern int tea5761_tuner_init(struct i2c_client *c);
  57. extern int tea5761_autodetection(struct i2c_client *c);
  58. extern int tea5767_autodetection(struct i2c_client *c);
  59. extern int tea5767_tuner_init(struct i2c_client *c);
  60. /* ------------------------------------------------------------------------ */
  61. #define tuner_warn(fmt, arg...) do {\
  62. printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
  63. i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
  64. #define tuner_info(fmt, arg...) do {\
  65. printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
  66. i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
  67. #define tuner_dbg(fmt, arg...) do {\
  68. extern int tuner_debug; \
  69. if (tuner_debug) \
  70. printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
  71. i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
  72. #endif /* __TUNER_DRIVER_H__ */
  73. /*
  74. * Overrides for Emacs so that we follow Linus's tabbing style.
  75. * ---------------------------------------------------------------------------
  76. * Local variables:
  77. * c-basic-offset: 8
  78. * End:
  79. */