diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-30 15:38:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-30 15:38:57 -0400 |
commit | 3a3485be68c3b44dd7e3790472976fdc2467bb40 (patch) | |
tree | d66cbd2406ee68c500c5a6b5b2c1f07e9568b0bf /drivers/media/video/ivtv/ivtv-mailbox.c | |
parent | 80ba80a9bf25d251237694c3fcee850a73324532 (diff) | |
parent | 0a0f2c87cd689857f2b0b82c5322650f7d9b5923 (diff) |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
V4L/DVB (5939): dvb-pll: make struct dvb_pll_fcv1236d static
V4L/DVB (5933): Dvb-usb/af9005-fe.c: error check fixes
V4L/DVB (5932): Af9005 fix tuner module unload
V4L/DVB (5920): ivtv: fix incorrect fw size report.
V4L/DVB (5918): ivtv: fix TV-out VBI handling, only reset on last close.
V4L/DVB (5917): ivtv: improve mailbox responsiveness.
V4L/DVB (5916): ivtv: fix pause/continue/play handling
V4L/DVB (5900): usbvision: fix bugs [sg]_register functions
V4L/DVB (5899): bttv: Fix Viewcast Osprey 440 support
V4L/DVB (5893): DVB: fix includes of video.h when __KERNEL__ is undefined
V4L/DVB (5891): zr36067: Turn off raw capture properly
V4L/DVB (5890): zr36067: Add UYVY, RGB555X, RGB565X, and RGB32 formats
V4L/DVB (5888): zr36067: Driver was not returning correct image size
V4L/DVB (5887): zr36067: Fix poll() operation
V4L/DVB (5886): zr36067: Fix problem setting norms
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-mailbox.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-mailbox.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/video/ivtv/ivtv-mailbox.c b/drivers/media/video/ivtv/ivtv-mailbox.c index 814a673712b3..5e3b679202ae 100644 --- a/drivers/media/video/ivtv/ivtv-mailbox.c +++ b/drivers/media/video/ivtv/ivtv-mailbox.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #define API_HIGH_VOL (1 << 5) /* High volume command (i.e. called during encoding or decoding) */ | 40 | #define API_HIGH_VOL (1 << 5) /* High volume command (i.e. called during encoding or decoding) */ |
41 | #define API_NO_WAIT_MB (1 << 4) /* Command may not wait for a free mailbox */ | 41 | #define API_NO_WAIT_MB (1 << 4) /* Command may not wait for a free mailbox */ |
42 | #define API_NO_WAIT_RES (1 << 5) /* Command may not wait for the result */ | 42 | #define API_NO_WAIT_RES (1 << 5) /* Command may not wait for the result */ |
43 | #define API_NO_POLL (1 << 6) /* Avoid pointless polling */ | ||
43 | 44 | ||
44 | struct ivtv_api_info { | 45 | struct ivtv_api_info { |
45 | int flags; /* Flags, see above */ | 46 | int flags; /* Flags, see above */ |
@@ -51,7 +52,7 @@ struct ivtv_api_info { | |||
51 | static const struct ivtv_api_info api_info[256] = { | 52 | static const struct ivtv_api_info api_info[256] = { |
52 | /* MPEG encoder API */ | 53 | /* MPEG encoder API */ |
53 | API_ENTRY(CX2341X_ENC_PING_FW, API_FAST_RESULT), | 54 | API_ENTRY(CX2341X_ENC_PING_FW, API_FAST_RESULT), |
54 | API_ENTRY(CX2341X_ENC_START_CAPTURE, API_RESULT), | 55 | API_ENTRY(CX2341X_ENC_START_CAPTURE, API_RESULT | API_NO_POLL), |
55 | API_ENTRY(CX2341X_ENC_STOP_CAPTURE, API_RESULT), | 56 | API_ENTRY(CX2341X_ENC_STOP_CAPTURE, API_RESULT), |
56 | API_ENTRY(CX2341X_ENC_SET_AUDIO_ID, API_CACHE), | 57 | API_ENTRY(CX2341X_ENC_SET_AUDIO_ID, API_CACHE), |
57 | API_ENTRY(CX2341X_ENC_SET_VIDEO_ID, API_CACHE), | 58 | API_ENTRY(CX2341X_ENC_SET_VIDEO_ID, API_CACHE), |
@@ -96,7 +97,7 @@ static const struct ivtv_api_info api_info[256] = { | |||
96 | 97 | ||
97 | /* MPEG decoder API */ | 98 | /* MPEG decoder API */ |
98 | API_ENTRY(CX2341X_DEC_PING_FW, API_FAST_RESULT), | 99 | API_ENTRY(CX2341X_DEC_PING_FW, API_FAST_RESULT), |
99 | API_ENTRY(CX2341X_DEC_START_PLAYBACK, API_RESULT), | 100 | API_ENTRY(CX2341X_DEC_START_PLAYBACK, API_RESULT | API_NO_POLL), |
100 | API_ENTRY(CX2341X_DEC_STOP_PLAYBACK, API_RESULT), | 101 | API_ENTRY(CX2341X_DEC_STOP_PLAYBACK, API_RESULT), |
101 | API_ENTRY(CX2341X_DEC_SET_PLAYBACK_SPEED, API_RESULT), | 102 | API_ENTRY(CX2341X_DEC_SET_PLAYBACK_SPEED, API_RESULT), |
102 | API_ENTRY(CX2341X_DEC_STEP_VIDEO, API_RESULT), | 103 | API_ENTRY(CX2341X_DEC_STEP_VIDEO, API_RESULT), |
@@ -290,6 +291,13 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[]) | |||
290 | /* Get results */ | 291 | /* Get results */ |
291 | then = jiffies; | 292 | then = jiffies; |
292 | 293 | ||
294 | if (!(flags & API_NO_POLL)) { | ||
295 | /* First try to poll, then switch to delays */ | ||
296 | for (i = 0; i < 100; i++) { | ||
297 | if (readl(&mbox->flags) & IVTV_MBOX_FIRMWARE_DONE) | ||
298 | break; | ||
299 | } | ||
300 | } | ||
293 | while (!(readl(&mbox->flags) & IVTV_MBOX_FIRMWARE_DONE)) { | 301 | while (!(readl(&mbox->flags) & IVTV_MBOX_FIRMWARE_DONE)) { |
294 | if (jiffies - then > api_timeout) { | 302 | if (jiffies - then > api_timeout) { |
295 | IVTV_DEBUG_WARN("Could not get result (%s)\n", api_info[cmd].name); | 303 | IVTV_DEBUG_WARN("Could not get result (%s)\n", api_info[cmd].name); |
@@ -301,7 +309,7 @@ static int ivtv_api_call(struct ivtv *itv, int cmd, int args, u32 data[]) | |||
301 | if (flags & API_NO_WAIT_RES) | 309 | if (flags & API_NO_WAIT_RES) |
302 | mdelay(1); | 310 | mdelay(1); |
303 | else | 311 | else |
304 | ivtv_msleep_timeout(10, 0); | 312 | ivtv_msleep_timeout(1, 0); |
305 | } | 313 | } |
306 | if (jiffies - then > msecs_to_jiffies(100)) | 314 | if (jiffies - then > msecs_to_jiffies(100)) |
307 | IVTV_DEBUG_WARN("%s took %u jiffies\n", | 315 | IVTV_DEBUG_WARN("%s took %u jiffies\n", |