aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-firmware.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-07-19 10:21:04 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-20 16:35:51 -0400
commit201700d3544c653d453716a60976efe1987110af (patch)
tree8052fb09ac170b6de4b28737f89cb2621fac4fe7 /drivers/media/video/ivtv/ivtv-firmware.c
parentfe06fe0a4d0f781f8ae0570e4d7e517a81878c1d (diff)
V4L/DVB (5865): Remove usage of HZ on ivtv driver, replacing by msecs_to_jiffies
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-firmware.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-firmware.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/media/video/ivtv/ivtv-firmware.c b/drivers/media/video/ivtv/ivtv-firmware.c
index 5bc45c9f0df2..d0feabf93080 100644
--- a/drivers/media/video/ivtv/ivtv-firmware.c
+++ b/drivers/media/video/ivtv/ivtv-firmware.c
@@ -36,7 +36,7 @@
36#define IVTV_CMD_SPU_STOP 0x00000001 36#define IVTV_CMD_SPU_STOP 0x00000001
37#define IVTV_CMD_SDRAM_PRECHARGE_INIT 0x0000001A 37#define IVTV_CMD_SDRAM_PRECHARGE_INIT 0x0000001A
38#define IVTV_CMD_SDRAM_REFRESH_INIT 0x80000640 38#define IVTV_CMD_SDRAM_REFRESH_INIT 0x80000640
39#define IVTV_SDRAM_SLEEPTIME (60 * HZ / 100) /* 600 ms */ 39#define IVTV_SDRAM_SLEEPTIME 600
40 40
41#define IVTV_DECODE_INIT_MPEG_FILENAME "v4l-cx2341x-init.mpg" 41#define IVTV_DECODE_INIT_MPEG_FILENAME "v4l-cx2341x-init.mpg"
42#define IVTV_DECODE_INIT_MPEG_SIZE (152*1024) 42#define IVTV_DECODE_INIT_MPEG_SIZE (152*1024)
@@ -89,7 +89,7 @@ void ivtv_halt_firmware(struct ivtv *itv)
89 if (itv->enc_mbox.mbox) 89 if (itv->enc_mbox.mbox)
90 ivtv_vapi(itv, CX2341X_ENC_HALT_FW, 0); 90 ivtv_vapi(itv, CX2341X_ENC_HALT_FW, 0);
91 91
92 ivtv_sleep_timeout(HZ / 100, 0); 92 ivtv_msleep_timeout(10, 0);
93 itv->enc_mbox.mbox = itv->dec_mbox.mbox = NULL; 93 itv->enc_mbox.mbox = itv->dec_mbox.mbox = NULL;
94 94
95 IVTV_DEBUG_INFO("Stopping VDM\n"); 95 IVTV_DEBUG_INFO("Stopping VDM\n");
@@ -113,7 +113,7 @@ void ivtv_halt_firmware(struct ivtv *itv)
113 IVTV_DEBUG_INFO("Stopping SPU\n"); 113 IVTV_DEBUG_INFO("Stopping SPU\n");
114 write_reg(IVTV_CMD_SPU_STOP, IVTV_REG_SPU); 114 write_reg(IVTV_CMD_SPU_STOP, IVTV_REG_SPU);
115 115
116 ivtv_sleep_timeout(HZ / 100, 0); 116 ivtv_msleep_timeout(10, 0);
117 117
118 IVTV_DEBUG_INFO("init Encoder SDRAM pre-charge\n"); 118 IVTV_DEBUG_INFO("init Encoder SDRAM pre-charge\n");
119 write_reg(IVTV_CMD_SDRAM_PRECHARGE_INIT, IVTV_REG_ENC_SDRAM_PRECHARGE); 119 write_reg(IVTV_CMD_SDRAM_PRECHARGE_INIT, IVTV_REG_ENC_SDRAM_PRECHARGE);
@@ -129,9 +129,8 @@ void ivtv_halt_firmware(struct ivtv *itv)
129 write_reg(IVTV_CMD_SDRAM_REFRESH_INIT, IVTV_REG_DEC_SDRAM_REFRESH); 129 write_reg(IVTV_CMD_SDRAM_REFRESH_INIT, IVTV_REG_DEC_SDRAM_REFRESH);
130 } 130 }
131 131
132 IVTV_DEBUG_INFO("Sleeping for %dms (600 recommended)\n", 132 IVTV_DEBUG_INFO("Sleeping for %dms\n", IVTV_SDRAM_SLEEPTIME);
133 (int)(IVTV_SDRAM_SLEEPTIME * 1000 / HZ)); 133 ivtv_msleep_timeout(IVTV_SDRAM_SLEEPTIME, 0);
134 ivtv_sleep_timeout(IVTV_SDRAM_SLEEPTIME, 0);
135} 134}
136 135
137void ivtv_firmware_versions(struct ivtv *itv) 136void ivtv_firmware_versions(struct ivtv *itv)
@@ -204,12 +203,12 @@ int ivtv_firmware_init(struct ivtv *itv)
204 203
205 /* start firmware */ 204 /* start firmware */
206 write_reg(read_reg(IVTV_REG_SPU) & IVTV_MASK_SPU_ENABLE, IVTV_REG_SPU); 205 write_reg(read_reg(IVTV_REG_SPU) & IVTV_MASK_SPU_ENABLE, IVTV_REG_SPU);
207 ivtv_sleep_timeout(HZ / 10, 0); 206 ivtv_msleep_timeout(100, 0);
208 if (itv->has_cx23415) 207 if (itv->has_cx23415)
209 write_reg(read_reg(IVTV_REG_VPU) & IVTV_MASK_VPU_ENABLE15, IVTV_REG_VPU); 208 write_reg(read_reg(IVTV_REG_VPU) & IVTV_MASK_VPU_ENABLE15, IVTV_REG_VPU);
210 else 209 else
211 write_reg(read_reg(IVTV_REG_VPU) & IVTV_MASK_VPU_ENABLE16, IVTV_REG_VPU); 210 write_reg(read_reg(IVTV_REG_VPU) & IVTV_MASK_VPU_ENABLE16, IVTV_REG_VPU);
212 ivtv_sleep_timeout(HZ / 10, 0); 211 ivtv_msleep_timeout(100, 0);
213 212
214 /* find mailboxes and ping firmware */ 213 /* find mailboxes and ping firmware */
215 itv->enc_mbox.mbox = ivtv_search_mailbox(itv->enc_mem, IVTV_ENCODER_SIZE); 214 itv->enc_mbox.mbox = ivtv_search_mailbox(itv->enc_mem, IVTV_ENCODER_SIZE);
@@ -264,7 +263,7 @@ void ivtv_init_mpeg_decoder(struct ivtv *itv)
264 IVTV_DECODE_INIT_MPEG_FILENAME); 263 IVTV_DECODE_INIT_MPEG_FILENAME);
265 } else { 264 } else {
266 ivtv_vapi(itv, CX2341X_DEC_SCHED_DMA_FROM_HOST, 3, 0, readbytes, 0); 265 ivtv_vapi(itv, CX2341X_DEC_SCHED_DMA_FROM_HOST, 3, 0, readbytes, 0);
267 ivtv_sleep_timeout(HZ / 10, 0); 266 ivtv_msleep_timeout(100, 0);
268 } 267 }
269 ivtv_vapi(itv, CX2341X_DEC_STOP_PLAYBACK, 4, 0, 0, 0, 1); 268 ivtv_vapi(itv, CX2341X_DEC_STOP_PLAYBACK, 4, 0, 0, 0, 1);
270} 269}