diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-06-14 08:43:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 17:03:14 -0400 |
commit | 86ef3f78b8bae808f41f74c506762ac345fdf893 (patch) | |
tree | 2cb97408c5e5c4df6250eba529623186e3acab8e /drivers/media/radio/si470x/radio-si470x-common.c | |
parent | 8e2ce73e932b629c3e12546e5fffac7ee54d0093 (diff) |
[media] radio-si470x: Don't unnecesarily read registers on G_TUNER
Reading registers from the pcear USB dongles with the si470x causes a
loud pop (and an alsa buffer overrun). Since most radio apps periodically
call G_TUNER to update mono/stereo, signal and afc status this leads
to the music . pop . music . pop . music -> not good.
On the internet there is an howto for flashing the pcear with a newer
firmware from the silabs reference boardto fix this, but:
1) This howto relies on a special version of the driver which allows
firmware flashing
2) We should try to avoid the answer to a bug report being upgrade your
firmware, if at all possible
3) Windows does not suffer from the pop sounds
After a quick look at the driver I found at that the register reads are
not necessary at all, as the device gives us the necessary status through
usb interrupt packets, and the driver already uses these!
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/si470x/radio-si470x-common.c')
-rw-r--r-- | drivers/media/radio/si470x/radio-si470x-common.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c index d485b79222fd..5dbb897e14de 100644 --- a/drivers/media/radio/si470x/radio-si470x-common.c +++ b/drivers/media/radio/si470x/radio-si470x-common.c | |||
@@ -583,14 +583,16 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, | |||
583 | struct v4l2_tuner *tuner) | 583 | struct v4l2_tuner *tuner) |
584 | { | 584 | { |
585 | struct si470x_device *radio = video_drvdata(file); | 585 | struct si470x_device *radio = video_drvdata(file); |
586 | int retval; | 586 | int retval = 0; |
587 | 587 | ||
588 | if (tuner->index != 0) | 588 | if (tuner->index != 0) |
589 | return -EINVAL; | 589 | return -EINVAL; |
590 | 590 | ||
591 | retval = si470x_get_register(radio, STATUSRSSI); | 591 | if (!radio->status_rssi_auto_update) { |
592 | if (retval < 0) | 592 | retval = si470x_get_register(radio, STATUSRSSI); |
593 | return retval; | 593 | if (retval < 0) |
594 | return retval; | ||
595 | } | ||
594 | 596 | ||
595 | /* driver constants */ | 597 | /* driver constants */ |
596 | strcpy(tuner->name, "FM"); | 598 | strcpy(tuner->name, "FM"); |