Lines Matching full:decoder
5 * TI TVP5146/47 decoder driver
50 MODULE_DESCRIPTION("TVP514X linux decoder driver");
78 * struct tvp514x_decoder - TVP5146/47 decoder object
84 * @streaming: TVP5146/47 decoder streaming - enabled or disabled.
93 * @pad: subdev media pad associated with the decoder
210 * List of image formats supported by TVP5146/47 decoder
318 * Write a value to a register in an TVP5146/47 decoder device.
460 * @decoder: ptr to tvp514x_decoder structure
465 struct tvp514x_decoder *decoder) in tvp514x_configure() argument
471 tvp514x_write_regs(sd, decoder->tvp514x_regs); in tvp514x_configure()
484 * @decoder: pointer to tvp514x_decoder structure
493 struct tvp514x_decoder *decoder) in tvp514x_detect() argument
516 decoder->ver = rom_ver; in tvp514x_detect()
519 client->name, decoder->ver, in tvp514x_detect()
525 * tvp514x_querystd() - V4L2 decoder interface handler for querystd
534 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_querystd() local
543 if (!decoder->streaming) { in tvp514x_querystd()
555 input_sel = decoder->input; in tvp514x_querystd()
599 *std_id &= decoder->std_list[current_std].standard.id; in tvp514x_querystd()
602 decoder->std_list[current_std].standard.name); in tvp514x_querystd()
607 * tvp514x_s_std() - V4L2 decoder interface handler for s_std
616 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_std() local
619 for (i = 0; i < decoder->num_stds; i++) in tvp514x_s_std()
620 if (std_id & decoder->std_list[i].standard.id) in tvp514x_s_std()
623 if ((i == decoder->num_stds) || (i == STD_INVALID)) in tvp514x_s_std()
627 decoder->std_list[i].video_std); in tvp514x_s_std()
631 decoder->current_std = i; in tvp514x_s_std()
632 decoder->tvp514x_regs[REG_VIDEO_STD].val = in tvp514x_s_std()
633 decoder->std_list[i].video_std; in tvp514x_s_std()
636 decoder->std_list[i].standard.name); in tvp514x_s_std()
641 * tvp514x_s_routing() - V4L2 decoder interface handler for s_routing
654 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_routing() local
678 decoder->tvp514x_regs[REG_INPUT_SEL].val = input_sel; in tvp514x_s_routing()
679 decoder->tvp514x_regs[REG_OUTPUT_FORMATTER1].val = output_sel; in tvp514x_s_routing()
680 decoder->input = input; in tvp514x_s_routing()
681 decoder->output = output; in tvp514x_s_routing()
689 * tvp514x_s_ctrl() - V4L2 decoder interface handler for s_ctrl
698 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_ctrl() local
707 decoder->tvp514x_regs[REG_BRIGHTNESS].val = value; in tvp514x_s_ctrl()
712 decoder->tvp514x_regs[REG_CONTRAST].val = value; in tvp514x_s_ctrl()
717 decoder->tvp514x_regs[REG_SATURATION].val = value; in tvp514x_s_ctrl()
726 decoder->tvp514x_regs[REG_HUE].val = value; in tvp514x_s_ctrl()
731 decoder->tvp514x_regs[REG_AFE_GAIN_CTRL].val = value; in tvp514x_s_ctrl()
741 * tvp514x_g_frame_interval() - V4L2 decoder interface handler
745 * Returns the decoder's video CAPTURE parameters.
751 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_g_frame_interval() local
756 current_std = decoder->current_std; in tvp514x_g_frame_interval()
759 decoder->std_list[current_std].standard.frameperiod; in tvp514x_g_frame_interval()
765 * tvp514x_s_frame_interval() - V4L2 decoder interface handler
769 * Configures the decoder to use the input parameters, if possible. If
776 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_frame_interval() local
784 current_std = decoder->current_std; in tvp514x_s_frame_interval()
787 decoder->std_list[current_std].standard.frameperiod; in tvp514x_s_frame_interval()
793 * tvp514x_s_stream() - V4L2 decoder i/f handler for s_stream
802 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_stream() local
804 if (decoder->streaming == enable) in tvp514x_s_stream()
813 v4l2_err(sd, "Unable to turn off decoder\n"); in tvp514x_s_stream()
816 decoder->streaming = enable; in tvp514x_s_stream()
822 err = tvp514x_write_regs(sd, decoder->int_seq); in tvp514x_s_stream()
824 v4l2_err(sd, "Unable to turn on decoder\n"); in tvp514x_s_stream()
828 err = tvp514x_detect(sd, decoder); in tvp514x_s_stream()
830 v4l2_err(sd, "Unable to detect decoder\n"); in tvp514x_s_stream()
833 err = tvp514x_configure(sd, decoder); in tvp514x_s_stream()
835 v4l2_err(sd, "Unable to configure decoder\n"); in tvp514x_s_stream()
838 decoder->streaming = enable; in tvp514x_s_stream()
854 * tvp514x_enum_mbus_code() - V4L2 decoder interface handler for enum_mbus_code
881 * tvp514x_get_pad_format() - V4L2 decoder interface handler for get pad format
892 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_get_pad_format() local
899 format->format = decoder->format; in tvp514x_get_pad_format()
904 format->format.width = tvp514x_std_list[decoder->current_std].width; in tvp514x_get_pad_format()
905 format->format.height = tvp514x_std_list[decoder->current_std].height; in tvp514x_get_pad_format()
913 * tvp514x_set_pad_format() - V4L2 decoder interface handler for set pad format
924 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_set_pad_format() local
929 fmt->format.width != tvp514x_std_list[decoder->current_std].width || in tvp514x_set_pad_format()
930 fmt->format.height != tvp514x_std_list[decoder->current_std].height) in tvp514x_set_pad_format()
933 decoder->format = fmt->format; in tvp514x_set_pad_format()
1018 * tvp514x_probe() - decoder driver i2c probe handler
1021 * Register decoder as an i2c client device and V4L2
1029 struct tvp514x_decoder *decoder; in tvp514x_probe() local
1042 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in tvp514x_probe()
1043 if (!decoder) in tvp514x_probe()
1047 *decoder = tvp514x_dev; in tvp514x_probe()
1049 memcpy(decoder->tvp514x_regs, tvp514x_reg_list_default, in tvp514x_probe()
1052 decoder->int_seq = (struct tvp514x_reg *)id->driver_data; in tvp514x_probe()
1055 decoder->pdata = pdata; in tvp514x_probe()
1062 decoder->tvp514x_regs[REG_OUTPUT_FORMATTER2].val |= in tvp514x_probe()
1063 (decoder->pdata->clk_polarity << 1); in tvp514x_probe()
1064 decoder->tvp514x_regs[REG_SYNC_CONTROL].val |= in tvp514x_probe()
1065 ((decoder->pdata->hs_polarity << 2) | in tvp514x_probe()
1066 (decoder->pdata->vs_polarity << 3)); in tvp514x_probe()
1068 decoder->tvp514x_regs[REG_VIDEO_STD].val = in tvp514x_probe()
1072 sd = &decoder->sd; in tvp514x_probe()
1076 decoder->pad.flags = MEDIA_PAD_FL_SOURCE; in tvp514x_probe()
1077 decoder->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in tvp514x_probe()
1078 decoder->sd.entity.function = MEDIA_ENT_F_ATV_DECODER; in tvp514x_probe()
1080 ret = media_entity_pads_init(&decoder->sd.entity, 1, &decoder->pad); in tvp514x_probe()
1082 v4l2_err(sd, "%s decoder driver failed to register !!\n", in tvp514x_probe()
1087 v4l2_ctrl_handler_init(&decoder->hdl, 5); in tvp514x_probe()
1088 v4l2_ctrl_new_std(&decoder->hdl, &tvp514x_ctrl_ops, in tvp514x_probe()
1090 v4l2_ctrl_new_std(&decoder->hdl, &tvp514x_ctrl_ops, in tvp514x_probe()
1092 v4l2_ctrl_new_std(&decoder->hdl, &tvp514x_ctrl_ops, in tvp514x_probe()
1094 v4l2_ctrl_new_std(&decoder->hdl, &tvp514x_ctrl_ops, in tvp514x_probe()
1096 v4l2_ctrl_new_std(&decoder->hdl, &tvp514x_ctrl_ops, in tvp514x_probe()
1098 sd->ctrl_handler = &decoder->hdl; in tvp514x_probe()
1099 if (decoder->hdl.error) { in tvp514x_probe()
1100 ret = decoder->hdl.error; in tvp514x_probe()
1103 v4l2_ctrl_handler_setup(&decoder->hdl); in tvp514x_probe()
1105 ret = v4l2_async_register_subdev(&decoder->sd); in tvp514x_probe()
1107 v4l2_info(sd, "%s decoder driver registered !!\n", sd->name); in tvp514x_probe()
1111 v4l2_ctrl_handler_free(&decoder->hdl); in tvp514x_probe()
1112 media_entity_cleanup(&decoder->sd.entity); in tvp514x_probe()
1118 * tvp514x_remove() - decoder driver i2c remove handler
1121 * Unregister decoder as an i2c client device and V4L2
1127 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_remove() local
1129 v4l2_async_unregister_subdev(&decoder->sd); in tvp514x_remove()
1130 media_entity_cleanup(&decoder->sd.entity); in tvp514x_remove()
1131 v4l2_ctrl_handler_free(&decoder->hdl); in tvp514x_remove()