summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-05-26 00:51:57 -0500
committerMike Isely <isely@pobox.com>2008-05-26 00:51:57 -0500
commit8d3a9854cde432acac20528f5168f91e877c6318 (patch)
treee4954cd1a11d04338d60da6a2c01489dbd549feb /linux/drivers
parentcb38319055fb26178638480bdec774e1c8220843 (diff)
downloadmediapointer-dvb-s2-8d3a9854cde432acac20528f5168f91e877c6318.tar.gz
mediapointer-dvb-s2-8d3a9854cde432acac20528f5168f91e877c6318.tar.bz2
pvrusb2: Change several embedded timer constants to defined values
From: Mike Isely <isely@pobox.com> This is primarily a cosmetic change to make it easier to change some of the time constants used in the driver. Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 52b182b8d..d7cee1813 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -40,6 +40,21 @@
#define TV_MIN_FREQ 55250000L
#define TV_MAX_FREQ 850000000L
+/* This defines a minimum interval that the decoder must remain quiet
+ before we are allowed to start it running. */
+#define TIME_MSEC_DECODER_WAIT 50
+
+/* This defines a minimum interval that the encoder must remain quiet
+ before we are allowed to configure it. */
+#define TIME_MSEC_ENCODER_WAIT 50
+
+/* This defines the minimum interval that the encoder must successfully run
+ before we consider that the encoder has run at least once since its
+ firmware has been loaded. This measurement is in important for cases
+ where we can't do something until we know that the encoder has been run
+ at least once. */
+#define TIME_MSEC_ENCODER_OK 250
+
static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL};
static DEFINE_MUTEX(pvr2_unit_mtx);
@@ -3706,7 +3721,9 @@ static int state_eval_encoder_config(struct pvr2_hdw *hdw)
the encoder. */
if (!hdw->state_encoder_waitok) {
hdw->encoder_wait_timer.expires =
- jiffies + (HZ*50/1000);
+ jiffies +
+ (HZ * TIME_MSEC_ENCODER_WAIT
+ / 1000);
add_timer(&hdw->encoder_wait_timer);
}
}
@@ -3830,7 +3847,7 @@ static int state_eval_encoder_run(struct pvr2_hdw *hdw)
hdw->state_encoder_run = !0;
if (!hdw->state_encoder_runok) {
hdw->encoder_run_timer.expires =
- jiffies + (HZ*250/1000);
+ jiffies + (HZ * TIME_MSEC_ENCODER_OK / 1000);
add_timer(&hdw->encoder_run_timer);
}
}
@@ -3905,7 +3922,9 @@ static int state_eval_decoder_run(struct pvr2_hdw *hdw)
but before we did the pending check. */
if (!hdw->state_decoder_quiescent) {
hdw->quiescent_timer.expires =
- jiffies + (HZ*50/1000);
+ jiffies +
+ (HZ * TIME_MSEC_DECODER_WAIT
+ / 1000);
add_timer(&hdw->quiescent_timer);
}
}