0001
0002 #ifndef __SOUND_TEA575X_TUNER_H
0003 #define __SOUND_TEA575X_TUNER_H
0004
0005
0006
0007
0008
0009
0010
0011 #include <linux/videodev2.h>
0012 #include <media/v4l2-ctrls.h>
0013 #include <media/v4l2-dev.h>
0014 #include <media/v4l2-device.h>
0015
0016 #define TEA575X_FMIF 10700
0017 #define TEA575X_AMIF 450
0018
0019 #define TEA575X_DATA (1 << 0)
0020 #define TEA575X_CLK (1 << 1)
0021 #define TEA575X_WREN (1 << 2)
0022 #define TEA575X_MOST (1 << 3)
0023
0024 struct snd_tea575x;
0025
0026 struct snd_tea575x_ops {
0027
0028 void (*write_val)(struct snd_tea575x *tea, u32 val);
0029 u32 (*read_val)(struct snd_tea575x *tea);
0030
0031 void (*set_pins)(struct snd_tea575x *tea, u8 pins);
0032 u8 (*get_pins)(struct snd_tea575x *tea);
0033 void (*set_direction)(struct snd_tea575x *tea, bool output);
0034 };
0035
0036 struct snd_tea575x {
0037 struct v4l2_device *v4l2_dev;
0038 struct v4l2_file_operations fops;
0039 struct video_device vd;
0040 int radio_nr;
0041 bool tea5759;
0042 bool has_am;
0043 bool cannot_read_data;
0044 bool cannot_mute;
0045 bool mute;
0046 bool stereo;
0047 bool tuned;
0048 unsigned int val;
0049 u32 band;
0050 u32 freq;
0051 struct mutex mutex;
0052 const struct snd_tea575x_ops *ops;
0053 void *private_data;
0054 u8 card[32];
0055 u8 bus_info[32];
0056 struct v4l2_ctrl_handler ctrl_handler;
0057 int (*ext_init)(struct snd_tea575x *tea);
0058 };
0059
0060 int snd_tea575x_enum_freq_bands(struct snd_tea575x *tea,
0061 struct v4l2_frequency_band *band);
0062 int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v);
0063 int snd_tea575x_s_hw_freq_seek(struct file *file, struct snd_tea575x *tea,
0064 const struct v4l2_hw_freq_seek *a);
0065 int snd_tea575x_hw_init(struct snd_tea575x *tea);
0066 int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
0067 void snd_tea575x_exit(struct snd_tea575x *tea);
0068 void snd_tea575x_set_freq(struct snd_tea575x *tea);
0069
0070 #endif