Lines Matching refs:hdw

26 static int pvr2_encoder_write_words(struct pvr2_hdw *hdw,  in pvr2_encoder_write_words()  argument
48 memset(hdw->cmd_buffer,0,sizeof(hdw->cmd_buffer)); in pvr2_encoder_write_words()
50 hdw->cmd_buffer[bAddr++] = FX2CMD_MEM_WRITE_DWORD; in pvr2_encoder_write_words()
53 hdw->cmd_buffer[bAddr+6] = (addr & 0xffu); in pvr2_encoder_write_words()
54 hdw->cmd_buffer[bAddr+5] = ((addr>>8) & 0xffu); in pvr2_encoder_write_words()
55 hdw->cmd_buffer[bAddr+4] = ((addr>>16) & 0xffu); in pvr2_encoder_write_words()
56 PVR2_DECOMPOSE_LE(hdw->cmd_buffer, bAddr,data[idx]); in pvr2_encoder_write_words()
59 ret = pvr2_send_request(hdw, in pvr2_encoder_write_words()
60 hdw->cmd_buffer,1+(chunkCnt*7), in pvr2_encoder_write_words()
72 static int pvr2_encoder_read_words(struct pvr2_hdw *hdw, in pvr2_encoder_read_words() argument
94 hdw->cmd_buffer[0] = in pvr2_encoder_read_words()
97 hdw->cmd_buffer[1] = 0; in pvr2_encoder_read_words()
98 hdw->cmd_buffer[2] = 0; in pvr2_encoder_read_words()
99 hdw->cmd_buffer[3] = 0; in pvr2_encoder_read_words()
100 hdw->cmd_buffer[4] = 0; in pvr2_encoder_read_words()
101 hdw->cmd_buffer[5] = ((offs>>16) & 0xffu); in pvr2_encoder_read_words()
102 hdw->cmd_buffer[6] = ((offs>>8) & 0xffu); in pvr2_encoder_read_words()
103 hdw->cmd_buffer[7] = (offs & 0xffu); in pvr2_encoder_read_words()
104 ret = pvr2_send_request(hdw, in pvr2_encoder_read_words()
105 hdw->cmd_buffer,8, in pvr2_encoder_read_words()
106 hdw->cmd_buffer, in pvr2_encoder_read_words()
111 data[idx] = PVR2_COMPOSE_LE(hdw->cmd_buffer,idx*4); in pvr2_encoder_read_words()
141 struct pvr2_hdw *hdw = (struct pvr2_hdw *)ctxt; in pvr2_encoder_cmd() local
191 LOCK_TAKE(hdw->ctl_lock); in pvr2_encoder_cmd()
193 if (!hdw->state_encoder_ok) { in pvr2_encoder_cmd()
212 ret = pvr2_encoder_write_words(hdw,MBOX_BASE,wrData,idx); in pvr2_encoder_cmd()
215 ret = pvr2_encoder_write_words(hdw,MBOX_BASE,wrData,1); in pvr2_encoder_cmd()
220 ret = pvr2_encoder_read_words(hdw,MBOX_BASE,rdData, in pvr2_encoder_cmd()
260 del_timer_sync(&hdw->encoder_run_timer); in pvr2_encoder_cmd()
261 hdw->state_encoder_ok = 0; in pvr2_encoder_cmd()
265 (hdw->state_encoder_ok ? "true" : "false")); in pvr2_encoder_cmd()
266 if (hdw->state_encoder_runok) { in pvr2_encoder_cmd()
267 hdw->state_encoder_runok = 0; in pvr2_encoder_cmd()
271 (hdw->state_encoder_runok ? in pvr2_encoder_cmd()
285 ret = pvr2_encoder_write_words(hdw,MBOX_BASE,wrData,1); in pvr2_encoder_cmd()
288 LOCK_GIVE(hdw->ctl_lock); in pvr2_encoder_cmd()
294 static int pvr2_encoder_vcmd(struct pvr2_hdw *hdw, int cmd, in pvr2_encoder_vcmd() argument
315 return pvr2_encoder_cmd(hdw,cmd,args,0,data); in pvr2_encoder_vcmd()
321 static int pvr2_encoder_prep_config(struct pvr2_hdw *hdw) in pvr2_encoder_prep_config() argument
332 LOCK_TAKE(hdw->ctl_lock); do { in pvr2_encoder_prep_config()
335 pvr2_encoder_write_words(hdw,0x01fe,dat,1); in pvr2_encoder_prep_config()
336 pvr2_encoder_write_words(hdw,0x023e,dat,1); in pvr2_encoder_prep_config()
337 } while(0); LOCK_GIVE(hdw->ctl_lock); in pvr2_encoder_prep_config()
352 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 5,0,0,0); in pvr2_encoder_prep_config()
360 if (hdw->hdw_desc->flag_has_cx25840) { in pvr2_encoder_prep_config()
365 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 3, in pvr2_encoder_prep_config()
368 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 8,0,0,0); in pvr2_encoder_prep_config()
376 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 4,1,0,0); in pvr2_encoder_prep_config()
379 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 0,3,0,0); in pvr2_encoder_prep_config()
380 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4,15,0,0,0); in pvr2_encoder_prep_config()
384 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC, 2, 4, 1); in pvr2_encoder_prep_config()
389 int pvr2_encoder_adjust(struct pvr2_hdw *hdw) in pvr2_encoder_adjust() argument
392 ret = cx2341x_update(hdw,pvr2_encoder_cmd, in pvr2_encoder_adjust()
393 (hdw->enc_cur_valid ? &hdw->enc_cur_state : NULL), in pvr2_encoder_adjust()
394 &hdw->enc_ctl_state); in pvr2_encoder_adjust()
399 hdw->enc_cur_state = hdw->enc_ctl_state; in pvr2_encoder_adjust()
400 hdw->enc_cur_valid = !0; in pvr2_encoder_adjust()
406 int pvr2_encoder_configure(struct pvr2_hdw *hdw) in pvr2_encoder_configure() argument
411 hdw->enc_ctl_state.port = CX2341X_PORT_STREAMING; in pvr2_encoder_configure()
412 hdw->enc_ctl_state.width = hdw->res_hor_val; in pvr2_encoder_configure()
413 hdw->enc_ctl_state.height = hdw->res_ver_val; in pvr2_encoder_configure()
414 hdw->enc_ctl_state.is_50hz = ((hdw->std_mask_cur & V4L2_STD_525_60) ? in pvr2_encoder_configure()
419 ret |= pvr2_encoder_prep_config(hdw); in pvr2_encoder_configure()
423 if (hdw->hdw_desc->flag_has_cx25840) { in pvr2_encoder_configure()
429 hdw,CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, in pvr2_encoder_configure()
434 hdw,CX2341X_ENC_SET_EVENT_NOTIFICATION, 4, in pvr2_encoder_configure()
438 hdw,CX2341X_ENC_SET_VBI_LINE, 5, in pvr2_encoder_configure()
447 ret = pvr2_encoder_adjust(hdw); in pvr2_encoder_configure()
451 hdw, CX2341X_ENC_INITIALIZE_INPUT, 0); in pvr2_encoder_configure()
463 int pvr2_encoder_start(struct pvr2_hdw *hdw) in pvr2_encoder_start() argument
468 pvr2_write_register(hdw, 0x0048, 0xbfffffff); in pvr2_encoder_start()
470 pvr2_encoder_vcmd(hdw,CX2341X_ENC_MUTE_VIDEO,1, in pvr2_encoder_start()
471 hdw->input_val == PVR2_CVAL_INPUT_RADIO ? 1 : 0); in pvr2_encoder_start()
473 switch (hdw->active_stream_type) { in pvr2_encoder_start()
475 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_START_CAPTURE,2, in pvr2_encoder_start()
479 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_START_CAPTURE,2, in pvr2_encoder_start()
483 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_START_CAPTURE,2, in pvr2_encoder_start()
490 int pvr2_encoder_stop(struct pvr2_hdw *hdw) in pvr2_encoder_stop() argument
495 pvr2_write_register(hdw, 0x0048, 0xffffffff); in pvr2_encoder_stop()
497 switch (hdw->active_stream_type) { in pvr2_encoder_stop()
499 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_STOP_CAPTURE,3, in pvr2_encoder_stop()
503 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_STOP_CAPTURE,3, in pvr2_encoder_stop()
507 status = pvr2_encoder_vcmd(hdw,CX2341X_ENC_STOP_CAPTURE,3, in pvr2_encoder_stop()