Skip to content

Commit

Permalink
[media] bttv: audio_mux(): use a local variable "gpio_mute" instead o…
Browse files Browse the repository at this point in the history
…f 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: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Mar 23, 2013
1 parent b279265 commit 28cafc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/media/pci/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ static char *audio_modes[] = {
static int
audio_mux(struct bttv *btv, int input, int mute)
{
int gpio_val, signal;
int gpio_val, signal, mute_gpio;
struct v4l2_ctrl *ctrl;

gpio_inout(bttv_tvcards[btv->c.type].gpiomask,
Expand All @@ -1003,10 +1003,10 @@ audio_mux(struct bttv *btv, int input, int mute)
btv->audio = input;

/* automute */
mute = mute || (btv->opt_automute && (!signal || !btv->users)
mute_gpio = mute || (btv->opt_automute && (!signal || !btv->users)
&& !btv->has_radio_tuner);

if (mute)
if (mute_gpio)
gpio_val = bttv_tvcards[btv->c.type].gpiomute;
else
gpio_val = bttv_tvcards[btv->c.type].gpiomux[input];
Expand All @@ -1022,7 +1022,7 @@ audio_mux(struct bttv *btv, int input, int mute)
}

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())
return 0;

Expand Down

0 comments on commit 28cafc3

Please sign in to comment.