tuner-core: fix s_std and s_tuner
commitf0c8bfe6f4a207816d0e0537b99d44924100dad5
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 14 Jun 2011 06:56:09 +0000 (14 03:56 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 3 Aug 2011 19:42:30 +0000 (3 12:42 -0700)
treea7756b057af6312fc10d832cf2c75109470e6303
parent4f378612389839ed7fa00ad1dad4533bb4008395
tuner-core: fix s_std and s_tuner

commit 4e4a31fb95d88518180517bae3098a23ebde9f9c upstream.

Both s_std and s_tuner are broken because set_mode_freq is called before the
new std (for s_std) and audmode (for s_tuner) are set.

This patch splits set_mode_freq in a set_mode and a set_freq and in s_std/s_tuner
first calls set_mode, and if that returns 0 (i.e. the mode is supported)
then they set t->std/t->audmode and call set_freq.

This fixes a bug where changing std or audmode would actually change it to
the previous value.

Discovered while testing analog TV standards for cx18 with a tda18271 tuner.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/tuner-core.c