aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/dvb-frontends/au8522_decoder.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-06-08 13:54:53 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-06-19 13:26:28 -0300
commitd289cdf022c5bebf09c73097404aa9faf2211381 (patch)
tree71edde46e4627e1eecd6e5e2241f19fdc9c3b026 /drivers/media/dvb-frontends/au8522_decoder.c
parent[media] au8522: be sure that the setup will happen at streamon time (diff)
downloadwireguard-linux-d289cdf022c5bebf09c73097404aa9faf2211381.tar.xz
wireguard-linux-d289cdf022c5bebf09c73097404aa9faf2211381.zip
[media] au8522: be sure that we'll setup audio routing at the right time
Let's set the the audio routing also at stream start. With this change, we don't risk enabling the analog demux while not streaming, reducing the risk of interfering with a DVB demux that might be happening. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/au8522_decoder.c')
-rw-r--r--drivers/media/dvb-frontends/au8522_decoder.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c
index b2b9f04a1340..53f6dea6b3cb 100644
--- a/drivers/media/dvb-frontends/au8522_decoder.c
+++ b/drivers/media/dvb-frontends/au8522_decoder.c
@@ -429,8 +429,9 @@ static void disable_audio_input(struct au8522_state *state)
}
/* 0=disable, 1=SIF */
-static void set_audio_input(struct au8522_state *state, int aud_input)
+static void set_audio_input(struct au8522_state *state)
{
+ int aud_input = state->aud_input;
int i;
/* Note that this function needs to be used in conjunction with setting
@@ -580,8 +581,6 @@ static int au8522_s_stream(struct v4l2_subdev *sd, int enable)
struct au8522_state *state = to_state(sd);
if (enable) {
- state->operational_mode = AU8522_ANALOG_MODE;
-
/*
* Clear out any state associated with the digital side of the
* chip, so that when it gets powered back up it won't think
@@ -596,6 +595,10 @@ static int au8522_s_stream(struct v4l2_subdev *sd, int enable)
AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H_CVBS);
au8522_video_set(state);
+
+ set_audio_input(state);
+
+ state->operational_mode = AU8522_ANALOG_MODE;
} else {
/* This does not completely power down the device
(it only reduces it from around 140ma to 80ma) */
@@ -632,7 +635,12 @@ static int au8522_s_audio_routing(struct v4l2_subdev *sd,
u32 input, u32 output, u32 config)
{
struct au8522_state *state = to_state(sd);
- set_audio_input(state, input);
+
+ state->aud_input = input;
+
+ if (state->operational_mode == AU8522_ANALOG_MODE)
+ set_audio_input(state);
+
return 0;
}