1 /* SPDX-License-Identifier: GPL-2.0-or-later * 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 #ifndef __SOUND_TEA575X_TUNER_H 2 #ifndef __SOUND_TEA575X_TUNER_H 3 #define __SOUND_TEA575X_TUNER_H 3 #define __SOUND_TEA575X_TUNER_H 4 4 5 /* 5 /* 6 * ALSA driver for TEA5757/5759 Philips AM/F 6 * ALSA driver for TEA5757/5759 Philips AM/FM tuner chips 7 * 7 * 8 * Copyright (c) 2004 Jaroslav Kysela <pe 8 * Copyright (c) 2004 Jaroslav Kysela <perex@perex.cz> 9 */ 9 */ 10 10 11 #include <linux/videodev2.h> 11 #include <linux/videodev2.h> 12 #include <media/v4l2-ctrls.h> 12 #include <media/v4l2-ctrls.h> 13 #include <media/v4l2-dev.h> 13 #include <media/v4l2-dev.h> 14 #include <media/v4l2-device.h> 14 #include <media/v4l2-device.h> 15 15 16 #define TEA575X_FMIF 10700 16 #define TEA575X_FMIF 10700 17 #define TEA575X_AMIF 450 17 #define TEA575X_AMIF 450 18 18 19 #define TEA575X_DATA (1 << 0) 19 #define TEA575X_DATA (1 << 0) 20 #define TEA575X_CLK (1 << 1) 20 #define TEA575X_CLK (1 << 1) 21 #define TEA575X_WREN (1 << 2) 21 #define TEA575X_WREN (1 << 2) 22 #define TEA575X_MOST (1 << 3) 22 #define TEA575X_MOST (1 << 3) 23 23 24 struct snd_tea575x; 24 struct snd_tea575x; 25 25 26 struct snd_tea575x_ops { 26 struct snd_tea575x_ops { 27 /* Drivers using snd_tea575x must eith 27 /* Drivers using snd_tea575x must either define read_ and write_val */ 28 void (*write_val)(struct snd_tea575x * 28 void (*write_val)(struct snd_tea575x *tea, u32 val); 29 u32 (*read_val)(struct snd_tea575x *te 29 u32 (*read_val)(struct snd_tea575x *tea); 30 /* Or define the 3 pin functions */ 30 /* Or define the 3 pin functions */ 31 void (*set_pins)(struct snd_tea575x *t 31 void (*set_pins)(struct snd_tea575x *tea, u8 pins); 32 u8 (*get_pins)(struct snd_tea575x *tea 32 u8 (*get_pins)(struct snd_tea575x *tea); 33 void (*set_direction)(struct snd_tea57 33 void (*set_direction)(struct snd_tea575x *tea, bool output); 34 }; 34 }; 35 35 36 struct snd_tea575x { 36 struct snd_tea575x { 37 struct v4l2_device *v4l2_dev; 37 struct v4l2_device *v4l2_dev; 38 struct v4l2_file_operations fops; 38 struct v4l2_file_operations fops; 39 struct video_device vd; /* vid 39 struct video_device vd; /* video device */ 40 int radio_nr; /* rad 40 int radio_nr; /* radio_nr */ 41 bool tea5759; /* 575 41 bool tea5759; /* 5759 chip is present */ 42 bool has_am; /* Dev 42 bool has_am; /* Device can tune to AM freqs */ 43 bool cannot_read_data; /* Dev 43 bool cannot_read_data; /* Device cannot read the data pin */ 44 bool cannot_mute; /* Dev 44 bool cannot_mute; /* Device cannot mute */ 45 bool mute; /* Dev 45 bool mute; /* Device is muted? */ 46 bool stereo; /* rec 46 bool stereo; /* receiving stereo */ 47 bool tuned; /* tun 47 bool tuned; /* tuned to a station */ 48 unsigned int val; /* hw 48 unsigned int val; /* hw value */ 49 u32 band; /* 0: 49 u32 band; /* 0: FM, 1: FM-Japan, 2: AM */ 50 u32 freq; /* fre 50 u32 freq; /* frequency */ 51 struct mutex mutex; 51 struct mutex mutex; 52 const struct snd_tea575x_ops *ops; 52 const struct snd_tea575x_ops *ops; 53 void *private_data; 53 void *private_data; 54 u8 card[32]; 54 u8 card[32]; 55 u8 bus_info[32]; 55 u8 bus_info[32]; 56 struct v4l2_ctrl_handler ctrl_handler; 56 struct v4l2_ctrl_handler ctrl_handler; 57 int (*ext_init)(struct snd_tea575x *te 57 int (*ext_init)(struct snd_tea575x *tea); 58 }; 58 }; 59 59 60 int snd_tea575x_enum_freq_bands(struct snd_tea 60 int snd_tea575x_enum_freq_bands(struct snd_tea575x *tea, 61 struct 61 struct v4l2_frequency_band *band); 62 int snd_tea575x_g_tuner(struct snd_tea575x *te 62 int snd_tea575x_g_tuner(struct snd_tea575x *tea, struct v4l2_tuner *v); 63 int snd_tea575x_s_hw_freq_seek(struct file *fi 63 int snd_tea575x_s_hw_freq_seek(struct file *file, struct snd_tea575x *tea, 64 const struct v 64 const struct v4l2_hw_freq_seek *a); 65 int snd_tea575x_hw_init(struct snd_tea575x *te 65 int snd_tea575x_hw_init(struct snd_tea575x *tea); 66 int snd_tea575x_init(struct snd_tea575x *tea, 66 int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner); 67 void snd_tea575x_exit(struct snd_tea575x *tea) 67 void snd_tea575x_exit(struct snd_tea575x *tea); 68 void snd_tea575x_set_freq(struct snd_tea575x * 68 void snd_tea575x_set_freq(struct snd_tea575x *tea); 69 69 70 #endif /* __SOUND_TEA575X_TUNER_H */ 70 #endif /* __SOUND_TEA575X_TUNER_H */ 71 71
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.