From abc2e09464172bd433f2de2c11dbe5dfd4c73e8d Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Sat, 25 Feb 2006 22:00:38 -0600 Subject: Implement configurable initialization pause in pvrusb2 From: Mike Isely This implements a module option which may be used to pause initialization of the driver right after the point where the hardware is reset. The idea here is to provide a means for the driver to stay out of the way until the hardware has finished initializating itself. The default delay is zero, which disables it (at the moment I don't think the delay is needed but it's worth leaving the logic in place to do it). Signed-off-by: Mike Isely --- v4l_experimental/pvrusb2/pvrusb2-hdw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.c b/v4l_experimental/pvrusb2/pvrusb2-hdw.c index c88da5417..01a1b8f80 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.c +++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.c @@ -43,9 +43,12 @@ static int initusbreset = 1; static int procreload = 0; static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 }; static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 }; +static int init_pause_msec = 0; module_param(ctlchg, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value"); +module_param(init_pause_msec, int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay"); module_param(initusbreset, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe"); module_param(procreload, int, S_IRUGO|S_IWUSR); @@ -2244,6 +2247,13 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failed to lock USB device ret=%d",ret); } + if (init_pause_msec) { + pvr2_trace(PVR2_TRACE_INFO, + "Waiting %u msec for hardware to settle", + init_pause_msec); + msleep(init_pause_msec); + } + } -- cgit v1.2.3