Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366857
b: refs/heads/master
c: e1cf658
h: refs/heads/master
i:
  366855: 2211661
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 25, 2013
1 parent 5d4515a commit 6a3a134
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 59e0548453bc24077e32748857e754d4bda2ab73
refs/heads/master: e1cf6587d5ba2085d7e5eae064b1adde5d07f801
12 changes: 7 additions & 5 deletions trunk/drivers/media/usb/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,8 @@ static int vidioc_g_frequency(struct file *file, void *priv,
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;

freq->type = V4L2_TUNER_ANALOG_TV;
if (freq->tuner != 0)
return -EINVAL;
freq->frequency = dev->ctrl_freq;
return 0;
}
Expand All @@ -1552,13 +1553,10 @@ static int vidioc_s_frequency(struct file *file, void *priv,
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
struct v4l2_frequency new_freq = *freq;

if (freq->tuner != 0)
return -EINVAL;
if (freq->type != V4L2_TUNER_ANALOG_TV)
return -EINVAL;

dev->ctrl_freq = freq->frequency;

if (dev->dvb.frontend && dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl)
dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl(dev->dvb.frontend, 1);
Expand All @@ -1573,6 +1571,9 @@ static int vidioc_s_frequency(struct file *file, void *priv,
}

v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, freq);
/* Get the actual set (and possibly clamped) frequency */
v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, g_frequency, &new_freq);
dev->ctrl_freq = new_freq.frequency;

if (dev->dvb.frontend && dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl)
dev->dvb.frontend->ops.analog_ops.i2c_gate_ctrl(dev->dvb.frontend, 0);
Expand Down Expand Up @@ -1976,6 +1977,7 @@ int au0828_analog_register(struct au0828_dev *dev,
dev->frame_size = dev->field_size << 1;
dev->bytesperline = dev->width << 1;
dev->ctrl_ainput = 0;
dev->ctrl_freq = 960;

/* allocate and fill v4l2 video struct */
dev->vdev = video_device_alloc();
Expand Down

0 comments on commit 6a3a134

Please sign in to comment.