@@ -77,7 +77,6 @@ typedef struct snd_card_saa7134 {
unsigned long iobase;
s16 irq;
- u16 mute_was_on;
spinlock_t lock;
} snd_card_saa7134_t;
@@ -718,9 +717,10 @@ static int snd_card_saa7134_capture_close(struct snd_pcm_substream * substream)
snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
struct saa7134_dev *dev = saa7134->dev;
- if (saa7134->mute_was_on) {
+ if (dev->mute_was_on) {
dev->ctl_mute = 1;
saa7134_tvaudio_setmute(dev);
+ dev->mute_was_on = false;
}
return 0;
}
@@ -775,7 +775,7 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream)
runtime->hw = snd_card_saa7134_capture;
if (dev->ctl_mute != 0) {
- saa7134->mute_was_on = 1;
+ dev->mute_was_on = true;
dev->ctl_mute = 0;
saa7134_tvaudio_setmute(dev);
}
@@ -190,6 +190,9 @@ static void mute_input_7134(struct saa7134_dev *dev)
struct saa7134_input *in;
int ausel=0, ics=0, ocs=0;
int mask;
+ bool change_analog_mute;
+
+ change_analog_mute = dev->mute_was_on ? false : true;
/* look what is to do ... */
in = dev->input;
@@ -204,7 +207,8 @@ static void mute_input_7134(struct saa7134_dev *dev)
in = &card(dev).mute;
}
- if (dev->hw_mute == mute &&
+
+ if (dev->hw_mute == mute && !dev->mute_was_on &&
dev->hw_input == in && !dev->insuspend) {
dprintk("mute/input: nothing to do [mute=%d,input=%s]\n",
mute,in->name);
@@ -216,13 +220,18 @@ static void mute_input_7134(struct saa7134_dev *dev)
dev->hw_mute = mute;
dev->hw_input = in;
- if (PCI_DEVICE_ID_PHILIPS_SAA7134 == dev->pci->device)
+ if (PCI_DEVICE_ID_PHILIPS_SAA7134 == dev->pci->device) {
+ u32 mask = ~0;
+ u32 mute_val = SAA7134_MUTE_MASK;
+
+ if (!change_analog_mute)
+ mask ^= SAA7134_MUTE_ANALOG;
+ if (mute)
+ mute_val |= SAA7134_MUTE_I2S | SAA7134_MUTE_ANALOG;
+
/* 7134 mute */
- saa_writeb(SAA7134_AUDIO_MUTE_CTRL, mute ?
- SAA7134_MUTE_MASK |
- SAA7134_MUTE_ANALOG |
- SAA7134_MUTE_I2S :
- SAA7134_MUTE_MASK);
+ saa_andorb(SAA7134_AUDIO_MUTE_CTRL, mask, mute_val);
+ }
/* switch internal audio mux */
switch (in->amux) {
@@ -602,6 +602,7 @@ struct saa7134_dev {
int ctl_saturation;
int ctl_freq;
int ctl_mute; /* audio */
+ bool mute_was_on;
int ctl_volume;
int ctl_invert; /* private */
int ctl_mirror;