From a0fb6e86d35f038eb07b347f6ba2bdb004215ed8 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 28 Sep 2012 08:18:07 -0300 Subject: [PATCH] --- yaml --- r: 357415 b: refs/heads/master c: ba1066d2e9686a5c96c5c0dfcbda7f874fa7b88d h: refs/heads/master i: 357413: 1286216257ffacd9d57ae09c6bbebfd59164198e 357411: 6245baa267ac728661b053f1d7ff13fce1f25322 357407: cc9db118dd65f19c1db1336b061ac9084708e19f v: v3 --- [refs] | 2 +- trunk/drivers/media/v4l2-core/tuner-core.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 456c68a3f4ad..537754a95130 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 84a15ded76ec8ec23d84974238b7864813143655 +refs/heads/master: ba1066d2e9686a5c96c5c0dfcbda7f874fa7b88d diff --git a/trunk/drivers/media/v4l2-core/tuner-core.c b/trunk/drivers/media/v4l2-core/tuner-core.c index b5a819af2b8c..b5a8aac2e126 100644 --- a/trunk/drivers/media/v4l2-core/tuner-core.c +++ b/trunk/drivers/media/v4l2-core/tuner-core.c @@ -1013,6 +1013,11 @@ static void set_radio_freq(struct i2c_client *c, unsigned int freq) t->standby = false; analog_ops->set_params(&t->fe, ¶ms); + /* + * The tuner driver might decide to change the audmode if it only + * supports stereo, so update t->audmode. + */ + t->audmode = params.audmode; } /* @@ -1235,8 +1240,18 @@ static int tuner_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) if (set_mode(t, vt->type)) return 0; - if (t->mode == V4L2_TUNER_RADIO) + if (t->mode == V4L2_TUNER_RADIO) { t->audmode = vt->audmode; + /* + * For radio audmode can only be mono or stereo. Map any + * other values to stereo. The actual tuner driver that is + * called in set_radio_freq can decide to limit the audmode to + * mono if only mono is supported. + */ + if (t->audmode != V4L2_TUNER_MODE_MONO && + t->audmode != V4L2_TUNER_MODE_STEREO) + t->audmode = V4L2_TUNER_MODE_STEREO; + } set_freq(t, 0); return 0;