tea575x-tuner.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #include <media/v4l2-device.h>
  27. #define TEA575X_FMIF 10700
  28. #define TEA575X_DATA (1 << 0)
  29. #define TEA575X_CLK (1 << 1)
  30. #define TEA575X_WREN (1 << 2)
  31. #define TEA575X_MOST (1 << 3)
  32. struct snd_tea575x;
  33. struct snd_tea575x_ops {
  34. void (*set_pins)(struct snd_tea575x *tea, u8 pins);
  35. u8 (*get_pins)(struct snd_tea575x *tea);
  36. void (*set_direction)(struct snd_tea575x *tea, bool output);
  37. };
  38. struct snd_tea575x {
  39. struct v4l2_device *v4l2_dev;
  40. struct video_device vd; /* video device */
  41. int radio_nr; /* radio_nr */
  42. bool tea5759; /* 5759 chip is present */
  43. bool cannot_read_data; /* Device cannot read the data pin */
  44. bool mute; /* Device is muted? */
  45. bool stereo; /* receiving stereo */
  46. bool tuned; /* tuned to a station */
  47. unsigned int val; /* hw value */
  48. u32 freq; /* frequency */
  49. struct mutex mutex;
  50. struct snd_tea575x_ops *ops;
  51. void *private_data;
  52. u8 card[32];
  53. u8 bus_info[32];
  54. struct v4l2_ctrl_handler ctrl_handler;
  55. int (*ext_init)(struct snd_tea575x *tea);
  56. };
  57. int snd_tea575x_init(struct snd_tea575x *tea);
  58. void snd_tea575x_exit(struct snd_tea575x *tea);
  59. #endif /* __SOUND_TEA575X_TUNER_H */