tea575x-tuner.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __SOUND_TEA575X_TUNER_H
  2. #define __SOUND_TEA575X_TUNER_H
  3. /*
  4. * ALSA driver for TEA5757/5759 Philips AM/FM tuner chips
  5. *
  6. * Copyright (c) 2004 Jaroslav Kysela <perex@perex.cz>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #include <linux/videodev2.h>
  24. #include <media/v4l2-ctrls.h>
  25. #include <media/v4l2-dev.h>
  26. #define TEA575X_FMIF 10700
  27. #define TEA575X_DATA (1 << 0)
  28. #define TEA575X_CLK (1 << 1)
  29. #define TEA575X_WREN (1 << 2)
  30. #define TEA575X_MOST (1 << 3)
  31. struct snd_tea575x;
  32. struct snd_tea575x_ops {
  33. void (*set_pins)(struct snd_tea575x *tea, u8 pins);
  34. u8 (*get_pins)(struct snd_tea575x *tea);
  35. void (*set_direction)(struct snd_tea575x *tea, bool output);
  36. };
  37. struct snd_tea575x {
  38. struct video_device vd; /* video device */
  39. bool tea5759; /* 5759 chip is present */
  40. bool mute; /* Device is muted? */
  41. bool stereo; /* receiving stereo */
  42. bool tuned; /* tuned to a station */
  43. unsigned int val; /* hw value */
  44. unsigned long freq; /* frequency */
  45. struct mutex mutex;
  46. struct snd_tea575x_ops *ops;
  47. void *private_data;
  48. u8 card[32];
  49. u8 bus_info[32];
  50. struct v4l2_ctrl_handler ctrl_handler;
  51. int (*ext_init)(struct snd_tea575x *tea);
  52. };
  53. int snd_tea575x_init(struct snd_tea575x *tea);
  54. void snd_tea575x_exit(struct snd_tea575x *tea);
  55. #endif /* __SOUND_TEA575X_TUNER_H */