Lines Matching refs:state

353 	struct saa7127_state *state = to_state(sd);  in saa7127_set_vps()  local
358 if (state->vps_enable != enable) { in saa7127_set_vps()
361 state->vps_enable = enable; in saa7127_set_vps()
366 state->vps_data[0] = data->data[2]; in saa7127_set_vps()
367 state->vps_data[1] = data->data[8]; in saa7127_set_vps()
368 state->vps_data[2] = data->data[9]; in saa7127_set_vps()
369 state->vps_data[3] = data->data[10]; in saa7127_set_vps()
370 state->vps_data[4] = data->data[11]; in saa7127_set_vps()
371 v4l2_dbg(1, debug, sd, "Set VPS data %*ph\n", 5, state->vps_data); in saa7127_set_vps()
372 saa7127_write(sd, 0x55, state->vps_data[0]); in saa7127_set_vps()
373 saa7127_write(sd, 0x56, state->vps_data[1]); in saa7127_set_vps()
374 saa7127_write(sd, 0x57, state->vps_data[2]); in saa7127_set_vps()
375 saa7127_write(sd, 0x58, state->vps_data[3]); in saa7127_set_vps()
376 saa7127_write(sd, 0x59, state->vps_data[4]); in saa7127_set_vps()
384 struct saa7127_state *state = to_state(sd); in saa7127_set_cc() local
390 if (state->cc_enable != enable) { in saa7127_set_cc()
394 (state->xds_enable << 7) | (enable << 6) | 0x11); in saa7127_set_cc()
395 state->cc_enable = enable; in saa7127_set_cc()
403 state->cc_data = cc; in saa7127_set_cc()
411 struct saa7127_state *state = to_state(sd); in saa7127_set_xds() local
417 if (state->xds_enable != enable) { in saa7127_set_xds()
420 (enable << 7) | (state->cc_enable << 6) | 0x11); in saa7127_set_xds()
421 state->xds_enable = enable; in saa7127_set_xds()
429 state->xds_data = xds; in saa7127_set_xds()
437 struct saa7127_state *state = to_state(sd); in saa7127_set_wss() local
442 if (state->wss_enable != enable) { in saa7127_set_wss()
445 state->wss_enable = enable; in saa7127_set_wss()
454 state->wss_mode = (data->data[1] & 0x3f) << 8 | data->data[0]; in saa7127_set_wss()
462 struct saa7127_state *state = to_state(sd); in saa7127_set_video_enable() local
466 saa7127_write(sd, 0x2d, state->reg_2d); in saa7127_set_video_enable()
467 saa7127_write(sd, 0x61, state->reg_61); in saa7127_set_video_enable()
470 saa7127_write(sd, 0x2d, (state->reg_2d & 0xf0)); in saa7127_set_video_enable()
471 saa7127_write(sd, 0x61, (state->reg_61 | 0xc0)); in saa7127_set_video_enable()
473 state->video_enable = enable; in saa7127_set_video_enable()
481 struct saa7127_state *state = to_state(sd); in saa7127_set_std() local
487 state->reg_61 = SAA7127_60HZ_DAC_CONTROL; in saa7127_set_std()
489 } else if (state->ident == SAA7129 && in saa7127_set_std()
497 state->reg_61 = SAA7127_50HZ_SECAM_DAC_CONTROL; in saa7127_set_std()
502 state->reg_61 = SAA7127_50HZ_PAL_DAC_CONTROL; in saa7127_set_std()
507 state->std = std; in saa7127_set_std()
515 struct saa7127_state *state = to_state(sd); in saa7127_set_output_type() local
519 state->reg_2d = 0x0f; /* RGB + CVBS (for sync) */ in saa7127_set_output_type()
520 state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ in saa7127_set_output_type()
524 if (state->ident == SAA7129) in saa7127_set_output_type()
525 state->reg_2d = 0x20; /* CVBS only */ in saa7127_set_output_type()
527 state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */ in saa7127_set_output_type()
528 state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ in saa7127_set_output_type()
532 if (state->ident == SAA7129) in saa7127_set_output_type()
533 state->reg_2d = 0x18; /* Y + C */ in saa7127_set_output_type()
535 state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */ in saa7127_set_output_type()
536 state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ in saa7127_set_output_type()
540 state->reg_2d = 0x4f; /* reg 2D = 01001111, all DAC's on, RGB + VBS */ in saa7127_set_output_type()
541 state->reg_3a = 0x0b; /* reg 3A = 00001011, bypass RGB-matrix */ in saa7127_set_output_type()
545 state->reg_2d = 0x0f; /* reg 2D = 00001111, all DAC's on, RGB + CVBS */ in saa7127_set_output_type()
546 state->reg_3a = 0x0b; /* reg 3A = 00001011, bypass RGB-matrix */ in saa7127_set_output_type()
550 if (state->ident == SAA7129) in saa7127_set_output_type()
551 state->reg_2d = 0x38; in saa7127_set_output_type()
553 state->reg_2d = 0xbf; in saa7127_set_output_type()
554 state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */ in saa7127_set_output_type()
564 saa7127_write(sd, 0x2d, state->reg_2d); in saa7127_set_output_type()
565 saa7127_write(sd, 0x3a, state->reg_3a | state->reg_3a_cb); in saa7127_set_output_type()
566 state->output_type = output; in saa7127_set_output_type()
574 struct saa7127_state *state = to_state(sd); in saa7127_set_input_type() local
579 state->reg_3a_cb = 0; in saa7127_set_input_type()
584 state->reg_3a_cb = 0x80; in saa7127_set_input_type()
590 saa7127_write(sd, 0x3a, state->reg_3a | state->reg_3a_cb); in saa7127_set_input_type()
591 state->input_type = input; in saa7127_set_input_type()
599 struct saa7127_state *state = to_state(sd); in saa7127_s_std_output() local
601 if (state->std == std) in saa7127_s_std_output()
609 struct saa7127_state *state = to_state(sd); in saa7127_s_routing() local
612 if (state->input_type != input) in saa7127_s_routing()
614 if (rc == 0 && state->output_type != output) in saa7127_s_routing()
621 struct saa7127_state *state = to_state(sd); in saa7127_s_stream() local
623 if (state->video_enable == enable) in saa7127_s_stream()
630 struct saa7127_state *state = to_state(sd); in saa7127_g_sliced_fmt() local
633 if (state->vps_enable) in saa7127_g_sliced_fmt()
635 if (state->wss_enable) in saa7127_g_sliced_fmt()
637 if (state->cc_enable) { in saa7127_g_sliced_fmt()
642 (state->vps_enable ? V4L2_SLICED_VPS : 0) | in saa7127_g_sliced_fmt()
643 (state->wss_enable ? V4L2_SLICED_WSS_625 : 0) | in saa7127_g_sliced_fmt()
644 (state->cc_enable ? V4L2_SLICED_CAPTION_525 : 0); in saa7127_g_sliced_fmt()
682 struct saa7127_state *state = to_state(sd); in saa7127_log_status() local
684 v4l2_info(sd, "Standard: %s\n", (state->std & V4L2_STD_525_60) ? "60 Hz" : "50 Hz"); in saa7127_log_status()
685 v4l2_info(sd, "Input: %s\n", state->input_type ? "color bars" : "normal"); in saa7127_log_status()
686 v4l2_info(sd, "Output: %s\n", state->video_enable ? in saa7127_log_status()
687 output_strs[state->output_type] : "disabled"); in saa7127_log_status()
688 v4l2_info(sd, "WSS: %s\n", state->wss_enable ? in saa7127_log_status()
689 wss_strs[state->wss_mode] : "disabled"); in saa7127_log_status()
690 v4l2_info(sd, "VPS: %s\n", state->vps_enable ? "enabled" : "disabled"); in saa7127_log_status()
691 v4l2_info(sd, "CC: %s\n", state->cc_enable ? "enabled" : "disabled"); in saa7127_log_status()
727 struct saa7127_state *state; in saa7127_probe() local
738 state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); in saa7127_probe()
739 if (state == NULL) in saa7127_probe()
742 sd = &state->sd; in saa7127_probe()
757 state->ident = id->driver_data; in saa7127_probe()
767 state->ident = SAA7129; in saa7127_probe()
770 state->ident = SAA7127; in saa7127_probe()
794 if (state->ident == SAA7129) in saa7127_probe()