diff options
author | Andy Shevchenko <andy@smile.org.ua> | 2008-01-24 12:11:53 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:30:14 -0500 |
commit | 69252128ec628e9d19739db0101e1826d993aecb (patch) | |
tree | 449a9fd1ec343a57a7ad7626e69c7b4bad37e11b | |
parent | 29a52c242d76deee155cb94756bcf7ebf58de4fe (diff) |
[ALSA] fm801 - Add mute support for FM-only card with FM801 PCI to tuner bridge
This is improvement of the early support of the FM-only cards where the
fm801 chip represents the PCI to tuner bridge.
The tuner initialization isn't included the mute on as well as mute support
via V4L request. Proposed patch should fix this at least for 64-PCR model.
Signed-off-by: Andy Shevchenko <andy@smile.org.ua>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | include/sound/tea575x-tuner.h | 1 | ||||
-rw-r--r-- | sound/i2c/other/tea575x-tuner.c | 8 | ||||
-rw-r--r-- | sound/pci/fm801.c | 22 |
3 files changed, 31 insertions, 0 deletions
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index e8eeb3a1ed29..b62ce3e077f9 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
@@ -30,6 +30,7 @@ struct snd_tea575x; | |||
30 | struct snd_tea575x_ops { | 30 | struct snd_tea575x_ops { |
31 | void (*write)(struct snd_tea575x *tea, unsigned int val); | 31 | void (*write)(struct snd_tea575x *tea, unsigned int val); |
32 | unsigned int (*read)(struct snd_tea575x *tea); | 32 | unsigned int (*read)(struct snd_tea575x *tea); |
33 | void (*mute)(struct snd_tea575x *tea, unsigned int mute); | ||
33 | }; | 34 | }; |
34 | 35 | ||
35 | struct snd_tea575x { | 36 | struct snd_tea575x { |
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index 28a4af782f5e..87e3aefeddc3 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c | |||
@@ -158,6 +158,10 @@ static int snd_tea575x_ioctl(struct inode *inode, struct file *file, | |||
158 | struct video_audio v; | 158 | struct video_audio v; |
159 | if(copy_from_user(&v, arg, sizeof(v))) | 159 | if(copy_from_user(&v, arg, sizeof(v))) |
160 | return -EFAULT; | 160 | return -EFAULT; |
161 | if (tea->ops->mute) | ||
162 | tea->ops->mute(tea, | ||
163 | (v.flags & | ||
164 | VIDEO_AUDIO_MUTE) ? 1 : 0); | ||
161 | if(v.audio) | 165 | if(v.audio) |
162 | return -EINVAL; | 166 | return -EINVAL; |
163 | return 0; | 167 | return 0; |
@@ -205,6 +209,10 @@ void snd_tea575x_init(struct snd_tea575x *tea) | |||
205 | tea->freq = 90500 * 16; /* 90.5Mhz default */ | 209 | tea->freq = 90500 * 16; /* 90.5Mhz default */ |
206 | 210 | ||
207 | snd_tea575x_set_freq(tea); | 211 | snd_tea575x_set_freq(tea); |
212 | |||
213 | /* mute on init */ | ||
214 | if (tea->ops->mute) | ||
215 | tea->ops->mute(tea, 1); | ||
208 | } | 216 | } |
209 | 217 | ||
210 | void snd_tea575x_exit(struct snd_tea575x *tea) | 218 | void snd_tea575x_exit(struct snd_tea575x *tea) |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 25c1087d2c00..4c300e6149fc 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -978,6 +978,27 @@ static unsigned int snd_fm801_tea575x_64pcr_read(struct snd_tea575x *tea) | |||
978 | return val; | 978 | return val; |
979 | } | 979 | } |
980 | 980 | ||
981 | static void snd_fm801_tea575x_64pcr_mute(struct snd_tea575x *tea, | ||
982 | unsigned int mute) | ||
983 | { | ||
984 | struct fm801 *chip = tea->private_data; | ||
985 | unsigned short reg; | ||
986 | |||
987 | spin_lock_irq(&chip->reg_lock); | ||
988 | |||
989 | reg = inw(FM801_REG(chip, GPIO_CTRL)); | ||
990 | if (mute) | ||
991 | /* 0xf800 (mute) */ | ||
992 | reg &= ~FM801_GPIO_GP(TEA_64PCR_WRITE_ENABLE); | ||
993 | else | ||
994 | /* 0xf802 (unmute) */ | ||
995 | reg |= FM801_GPIO_GP(TEA_64PCR_WRITE_ENABLE); | ||
996 | outw(reg, FM801_REG(chip, GPIO_CTRL)); | ||
997 | udelay(1); | ||
998 | |||
999 | spin_unlock_irq(&chip->reg_lock); | ||
1000 | } | ||
1001 | |||
981 | static struct snd_tea575x_ops snd_fm801_tea_ops[3] = { | 1002 | static struct snd_tea575x_ops snd_fm801_tea_ops[3] = { |
982 | { | 1003 | { |
983 | /* 1 = MediaForte 256-PCS */ | 1004 | /* 1 = MediaForte 256-PCS */ |
@@ -993,6 +1014,7 @@ static struct snd_tea575x_ops snd_fm801_tea_ops[3] = { | |||
993 | /* 3 = MediaForte 64-PCR */ | 1014 | /* 3 = MediaForte 64-PCR */ |
994 | .write = snd_fm801_tea575x_64pcr_write, | 1015 | .write = snd_fm801_tea575x_64pcr_write, |
995 | .read = snd_fm801_tea575x_64pcr_read, | 1016 | .read = snd_fm801_tea575x_64pcr_read, |
1017 | .mute = snd_fm801_tea575x_64pcr_mute, | ||
996 | } | 1018 | } |
997 | }; | 1019 | }; |
998 | #endif | 1020 | #endif |