diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-03-08 16:04:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:21 -0400 |
commit | 1cd3c0fa927084549005fc22e54d99684b314f14 (patch) | |
tree | ffec4f2829239216640983e0102f4638493a1140 /drivers/media/video/bt819.c | |
parent | 98ec633972a70cf71d71bc8762804f0af4792d08 (diff) |
V4L/DVB (11022): zoran/bt819: use new notify functionality.
Bt819 needs the parent driver to drive a GPIO pin low and high in order to
reset its fifo. Use the new notify callback for this.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt819.c')
-rw-r--r-- | drivers/media/video/bt819.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index e0d8e2b186d1..217294d56414 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c | |||
@@ -32,13 +32,14 @@ | |||
32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
33 | #include <linux/ioctl.h> | 33 | #include <linux/ioctl.h> |
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <asm/uaccess.h> | 35 | #include <linux/uaccess.h> |
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/i2c-id.h> | 37 | #include <linux/i2c-id.h> |
38 | #include <linux/videodev2.h> | 38 | #include <linux/videodev2.h> |
39 | #include <media/v4l2-device.h> | 39 | #include <media/v4l2-device.h> |
40 | #include <media/v4l2-chip-ident.h> | 40 | #include <media/v4l2-chip-ident.h> |
41 | #include <media/v4l2-i2c-drv.h> | 41 | #include <media/v4l2-i2c-drv.h> |
42 | #include <media/bt819.h> | ||
42 | 43 | ||
43 | MODULE_DESCRIPTION("Brooktree-819 video decoder driver"); | 44 | MODULE_DESCRIPTION("Brooktree-819 video decoder driver"); |
44 | MODULE_AUTHOR("Mike Bernson & Dave Perks"); | 45 | MODULE_AUTHOR("Mike Bernson & Dave Perks"); |
@@ -250,7 +251,11 @@ static int bt819_s_std(struct v4l2_subdev *sd, v4l2_std_id std) | |||
250 | 251 | ||
251 | v4l2_dbg(1, debug, sd, "set norm %llx\n", (unsigned long long)std); | 252 | v4l2_dbg(1, debug, sd, "set norm %llx\n", (unsigned long long)std); |
252 | 253 | ||
254 | if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL) | ||
255 | v4l2_err(sd, "no notify found!\n"); | ||
256 | |||
253 | if (std & V4L2_STD_NTSC) { | 257 | if (std & V4L2_STD_NTSC) { |
258 | v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0); | ||
254 | bt819_setbit(decoder, 0x01, 0, 1); | 259 | bt819_setbit(decoder, 0x01, 0, 1); |
255 | bt819_setbit(decoder, 0x01, 1, 0); | 260 | bt819_setbit(decoder, 0x01, 1, 0); |
256 | bt819_setbit(decoder, 0x01, 5, 0); | 261 | bt819_setbit(decoder, 0x01, 5, 0); |
@@ -259,6 +264,7 @@ static int bt819_s_std(struct v4l2_subdev *sd, v4l2_std_id std) | |||
259 | /* bt819_setbit(decoder, 0x1a, 5, 1); */ | 264 | /* bt819_setbit(decoder, 0x1a, 5, 1); */ |
260 | timing = &timing_data[1]; | 265 | timing = &timing_data[1]; |
261 | } else if (std & V4L2_STD_PAL) { | 266 | } else if (std & V4L2_STD_PAL) { |
267 | v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0); | ||
262 | bt819_setbit(decoder, 0x01, 0, 1); | 268 | bt819_setbit(decoder, 0x01, 0, 1); |
263 | bt819_setbit(decoder, 0x01, 1, 1); | 269 | bt819_setbit(decoder, 0x01, 1, 1); |
264 | bt819_setbit(decoder, 0x01, 5, 1); | 270 | bt819_setbit(decoder, 0x01, 5, 1); |
@@ -283,6 +289,7 @@ static int bt819_s_std(struct v4l2_subdev *sd, v4l2_std_id std) | |||
283 | bt819_write(decoder, 0x08, (timing->hscale >> 8) & 0xff); | 289 | bt819_write(decoder, 0x08, (timing->hscale >> 8) & 0xff); |
284 | bt819_write(decoder, 0x09, timing->hscale & 0xff); | 290 | bt819_write(decoder, 0x09, timing->hscale & 0xff); |
285 | decoder->norm = std; | 291 | decoder->norm = std; |
292 | v4l2_subdev_notify(sd, BT819_FIFO_RESET_HIGH, 0); | ||
286 | return 0; | 293 | return 0; |
287 | } | 294 | } |
288 | 295 | ||
@@ -295,7 +302,11 @@ static int bt819_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *ro | |||
295 | if (route->input < 0 || route->input > 7) | 302 | if (route->input < 0 || route->input > 7) |
296 | return -EINVAL; | 303 | return -EINVAL; |
297 | 304 | ||
305 | if (sd->v4l2_dev == NULL || sd->v4l2_dev->notify == NULL) | ||
306 | v4l2_err(sd, "no notify found!\n"); | ||
307 | |||
298 | if (decoder->input != route->input) { | 308 | if (decoder->input != route->input) { |
309 | v4l2_subdev_notify(sd, BT819_FIFO_RESET_LOW, 0); | ||
299 | decoder->input = route->input; | 310 | decoder->input = route->input; |
300 | /* select mode */ | 311 | /* select mode */ |
301 | if (decoder->input == 0) { | 312 | if (decoder->input == 0) { |
@@ -305,6 +316,7 @@ static int bt819_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *ro | |||
305 | bt819_setbit(decoder, 0x0b, 6, 1); | 316 | bt819_setbit(decoder, 0x0b, 6, 1); |
306 | bt819_setbit(decoder, 0x1a, 1, 0); | 317 | bt819_setbit(decoder, 0x1a, 1, 0); |
307 | } | 318 | } |
319 | v4l2_subdev_notify(sd, BT819_FIFO_RESET_HIGH, 0); | ||
308 | } | 320 | } |
309 | return 0; | 321 | return 0; |
310 | } | 322 | } |