Commit 28cafc38 authored by Frank Schaefer's avatar Frank Schaefer Committed by Mauro Carvalho Chehab

[media] bttv: audio_mux(): use a local variable "gpio_mute" instead of...

[media] bttv: audio_mux(): use a local variable "gpio_mute" instead of modifying the function parameter "mute"

Function audio_mux() actually deals with two types of mute: gpio mute and
subdevice muting.
This patch claryfies the meaning of these values, but mainly prepares the code for
the next patch.
Signed-off-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b279265c
...@@ -992,7 +992,7 @@ static char *audio_modes[] = { ...@@ -992,7 +992,7 @@ static char *audio_modes[] = {
static int static int
audio_mux(struct bttv *btv, int input, int mute) audio_mux(struct bttv *btv, int input, int mute)
{ {
int gpio_val, signal; int gpio_val, signal, mute_gpio;
struct v4l2_ctrl *ctrl; struct v4l2_ctrl *ctrl;
gpio_inout(bttv_tvcards[btv->c.type].gpiomask, gpio_inout(bttv_tvcards[btv->c.type].gpiomask,
...@@ -1003,10 +1003,10 @@ audio_mux(struct bttv *btv, int input, int mute) ...@@ -1003,10 +1003,10 @@ audio_mux(struct bttv *btv, int input, int mute)
btv->audio = input; btv->audio = input;
/* automute */ /* automute */
mute = mute || (btv->opt_automute && (!signal || !btv->users) mute_gpio = mute || (btv->opt_automute && (!signal || !btv->users)
&& !btv->has_radio_tuner); && !btv->has_radio_tuner);
if (mute) if (mute_gpio)
gpio_val = bttv_tvcards[btv->c.type].gpiomute; gpio_val = bttv_tvcards[btv->c.type].gpiomute;
else else
gpio_val = bttv_tvcards[btv->c.type].gpiomux[input]; gpio_val = bttv_tvcards[btv->c.type].gpiomux[input];
...@@ -1022,7 +1022,7 @@ audio_mux(struct bttv *btv, int input, int mute) ...@@ -1022,7 +1022,7 @@ audio_mux(struct bttv *btv, int input, int mute)
} }
if (bttv_gpio) if (bttv_gpio)
bttv_gpio_tracking(btv, audio_modes[mute ? 4 : input]); bttv_gpio_tracking(btv, audio_modes[mute_gpio ? 4 : input]);
if (in_interrupt()) if (in_interrupt())
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment