From: Ondrej Zary <linux@rainbow-software.org>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: [PATCH 4/7] saa7134: v4l2-compliance: return real frequency
Date: Sun, 27 Jan 2013 20:45:09 +0100 [thread overview]
Message-ID: <1359315912-1767-5-git-send-email-linux@rainbow-software.org> (raw)
In-Reply-To: <1359315912-1767-1-git-send-email-linux@rainbow-software.org>
Make saa7134 driver more V4L2 compliant: don't cache frequency in
s_frequency/g_frequency but return real one instead
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
drivers/media/pci/saa7134/saa7134-video.c | 6 ++++--
drivers/media/pci/saa7134/saa7134.h | 1 -
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index be745c0..87b2b9e 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2048,8 +2048,11 @@ static int saa7134_g_frequency(struct file *file, void *priv,
struct saa7134_fh *fh = priv;
struct saa7134_dev *dev = fh->dev;
+ if (0 != f->tuner)
+ return -EINVAL;
+
f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
- f->frequency = dev->ctl_freq;
+ saa_call_all(dev, tuner, g_frequency, f);
return 0;
}
@@ -2067,7 +2070,6 @@ static int saa7134_s_frequency(struct file *file, void *priv,
if (1 == fh->radio && V4L2_TUNER_RADIO != f->type)
return -EINVAL;
mutex_lock(&dev->lock);
- dev->ctl_freq = f->frequency;
saa_call_all(dev, tuner, s_frequency, f);
diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h
index 2ffe069..d0ee05e 100644
--- a/drivers/media/pci/saa7134/saa7134.h
+++ b/drivers/media/pci/saa7134/saa7134.h
@@ -604,7 +604,6 @@ struct saa7134_dev {
int ctl_contrast;
int ctl_hue;
int ctl_saturation;
- int ctl_freq;
int ctl_mute; /* audio */
int ctl_volume;
int ctl_invert; /* private */
--
Ondrej Zary
next prev parent reply other threads:[~2013-01-27 19:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-27 19:45 [RFC PATCH 0/7] saa7134: improve v4l2-compliance Ondrej Zary
2013-01-27 19:45 ` [PATCH 1/7] saa7134: v4l2-compliance: implement V4L2_CAP_DEVICE_CAPS Ondrej Zary
2013-01-28 10:07 ` Hans Verkuil
2013-01-27 19:45 ` [PATCH 2/7] saa7134: v4l2-compliance: don't report invalid audio modes for radio Ondrej Zary
2013-01-28 10:08 ` Hans Verkuil
2013-01-27 19:45 ` [PATCH 3/7] saa7134: v4l2-compliance: use v4l2_fh to fix priority handling Ondrej Zary
2013-01-28 10:08 ` Hans Verkuil
2013-01-27 19:45 ` Ondrej Zary [this message]
2013-01-28 10:10 ` [PATCH 4/7] saa7134: v4l2-compliance: return real frequency Hans Verkuil
2013-01-27 19:45 ` [PATCH 5/7] saa7134: v4l2-compliance: fix g_tuner/s_tuner Ondrej Zary
2013-01-28 10:11 ` Hans Verkuil
2013-01-27 19:45 ` [PATCH 6/7] saa7134: v4l2-compliance: remove V4L2_IN_ST_NO_SYNC from enum_input Ondrej Zary
2013-01-28 10:30 ` Mauro Carvalho Chehab
2013-01-28 11:00 ` Hans Verkuil
2013-01-28 10:37 ` Hans Verkuil
2013-01-27 19:45 ` [PATCH 7/7] saa7134: v4l2-compliance: remove bogus audio input support Ondrej Zary
2013-01-28 10:38 ` Hans Verkuil
2013-01-28 10:56 ` [RFC PATCH 0/7] saa7134: improve v4l2-compliance Hans Verkuil
2013-01-28 22:40 ` Ondrej Zary
2013-01-29 7:12 ` Hans Verkuil
2013-01-28 14:11 ` [PATCH 8/7] saa7134: v4l2-compliance: remove bogus g_parm Ondrej Zary
2013-01-28 14:19 ` Hans Verkuil
2013-01-28 14:11 ` [PATCH 9/7] saa7134: v4l2-compliance: initialize VBI structure Ondrej Zary
2013-01-28 14:21 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359315912-1767-5-git-send-email-linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox