diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-01-17 10:17:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:22 -0400 |
commit | fac6986c4777ae85fa2108ea25fee98de2c1f7b2 (patch) | |
tree | 477119cf15d50bcc548ddd6e6ba15eb69e311d23 /drivers/media/video/saa7134/saa7134-empress.c | |
parent | 5b73e98c83fc5087f591c9b12ee546b97e9283d4 (diff) |
V4L/DVB (10247): saa7134: convert to the new v4l2 framework.
Register v4l2_device and switch to v4l2_subdev to access the i2c modules.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-empress.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index c9d8beb87a60..d9d9607044a7 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
@@ -76,7 +76,7 @@ static int ts_init_encoder(struct saa7134_dev* dev) | |||
76 | break; | 76 | break; |
77 | } | 77 | } |
78 | ts_reset_encoder(dev); | 78 | ts_reset_encoder(dev); |
79 | saa7134_i2c_call_clients(dev, VIDIOC_INT_INIT, &leading_null_bytes); | 79 | saa_call_all(dev, core, init, leading_null_bytes); |
80 | dev->empress_started = 1; | 80 | dev->empress_started = 1; |
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
@@ -234,7 +234,7 @@ static int empress_g_fmt_vid_cap(struct file *file, void *priv, | |||
234 | { | 234 | { |
235 | struct saa7134_dev *dev = file->private_data; | 235 | struct saa7134_dev *dev = file->private_data; |
236 | 236 | ||
237 | saa7134_i2c_call_clients(dev, VIDIOC_G_FMT, f); | 237 | saa_call_all(dev, video, g_fmt, f); |
238 | 238 | ||
239 | f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; | 239 | f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; |
240 | f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; | 240 | f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; |
@@ -247,7 +247,7 @@ static int empress_s_fmt_vid_cap(struct file *file, void *priv, | |||
247 | { | 247 | { |
248 | struct saa7134_dev *dev = file->private_data; | 248 | struct saa7134_dev *dev = file->private_data; |
249 | 249 | ||
250 | saa7134_i2c_call_clients(dev, VIDIOC_S_FMT, f); | 250 | saa_call_all(dev, video, s_fmt, f); |
251 | 251 | ||
252 | f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; | 252 | f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; |
253 | f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; | 253 | f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; |
@@ -317,7 +317,7 @@ static int empress_s_ext_ctrls(struct file *file, void *priv, | |||
317 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) | 317 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) |
318 | return -EINVAL; | 318 | return -EINVAL; |
319 | 319 | ||
320 | err = saa7134_i2c_call_saa6752(dev, VIDIOC_S_EXT_CTRLS, ctrls); | 320 | err = saa_call_empress(dev, core, s_ext_ctrls, ctrls); |
321 | ts_init_encoder(dev); | 321 | ts_init_encoder(dev); |
322 | 322 | ||
323 | return err; | 323 | return err; |
@@ -330,7 +330,7 @@ static int empress_g_ext_ctrls(struct file *file, void *priv, | |||
330 | 330 | ||
331 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) | 331 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) |
332 | return -EINVAL; | 332 | return -EINVAL; |
333 | return saa7134_i2c_call_saa6752(dev, VIDIOC_G_EXT_CTRLS, ctrls); | 333 | return saa_call_empress(dev, core, g_ext_ctrls, ctrls); |
334 | } | 334 | } |
335 | 335 | ||
336 | static int empress_g_ctrl(struct file *file, void *priv, | 336 | static int empress_g_ctrl(struct file *file, void *priv, |
@@ -391,7 +391,7 @@ static int empress_queryctrl(struct file *file, void *priv, | |||
391 | return v4l2_ctrl_query_fill_std(c); | 391 | return v4l2_ctrl_query_fill_std(c); |
392 | if (V4L2_CTRL_ID2CLASS(c->id) != V4L2_CTRL_CLASS_MPEG) | 392 | if (V4L2_CTRL_ID2CLASS(c->id) != V4L2_CTRL_CLASS_MPEG) |
393 | return saa7134_queryctrl(file, priv, c); | 393 | return saa7134_queryctrl(file, priv, c); |
394 | return saa7134_i2c_call_saa6752(dev, VIDIOC_QUERYCTRL, c); | 394 | return saa_call_empress(dev, core, queryctrl, c); |
395 | } | 395 | } |
396 | 396 | ||
397 | static int empress_querymenu(struct file *file, void *priv, | 397 | static int empress_querymenu(struct file *file, void *priv, |
@@ -401,7 +401,7 @@ static int empress_querymenu(struct file *file, void *priv, | |||
401 | 401 | ||
402 | if (V4L2_CTRL_ID2CLASS(c->id) != V4L2_CTRL_CLASS_MPEG) | 402 | if (V4L2_CTRL_ID2CLASS(c->id) != V4L2_CTRL_CLASS_MPEG) |
403 | return -EINVAL; | 403 | return -EINVAL; |
404 | return saa7134_i2c_call_saa6752(dev, VIDIOC_QUERYMENU, c); | 404 | return saa_call_empress(dev, core, querymenu, c); |
405 | } | 405 | } |
406 | 406 | ||
407 | static int empress_g_chip_ident(struct file *file, void *fh, | 407 | static int empress_g_chip_ident(struct file *file, void *fh, |
@@ -411,14 +411,12 @@ static int empress_g_chip_ident(struct file *file, void *fh, | |||
411 | 411 | ||
412 | chip->ident = V4L2_IDENT_NONE; | 412 | chip->ident = V4L2_IDENT_NONE; |
413 | chip->revision = 0; | 413 | chip->revision = 0; |
414 | if (dev->mpeg_i2c_client == NULL) | ||
415 | return -EINVAL; | ||
416 | if (chip->match.type == V4L2_CHIP_MATCH_I2C_DRIVER && | 414 | if (chip->match.type == V4L2_CHIP_MATCH_I2C_DRIVER && |
417 | !strcmp(chip->match.name, "saa6752hs")) | 415 | !strcmp(chip->match.name, "saa6752hs")) |
418 | return saa7134_i2c_call_saa6752(dev, VIDIOC_DBG_G_CHIP_IDENT, chip); | 416 | return saa_call_empress(dev, core, g_chip_ident, chip); |
419 | if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR && | 417 | if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR && |
420 | chip->match.addr == dev->mpeg_i2c_client->addr) | 418 | chip->match.addr == 0x20) |
421 | return saa7134_i2c_call_saa6752(dev, VIDIOC_DBG_G_CHIP_IDENT, chip); | 419 | return saa_call_empress(dev, core, g_chip_ident, chip); |
422 | return -EINVAL; | 420 | return -EINVAL; |
423 | } | 421 | } |
424 | 422 | ||