Lines Matching +full:sd +full:- +full:hs
1 // SPDX-License-Identifier: GPL-2.0-only
15 * Karicheri Muralidharan <m-karicheri2@ti.com>
24 #include <linux/v4l2-mediabus.h>
28 #include <media/v4l2-async.h>
29 #include <media/v4l2-device.h>
30 #include <media/v4l2-common.h>
31 #include <media/v4l2-mediabus.h>
32 #include <media/v4l2-fwnode.h>
33 #include <media/v4l2-ctrls.h>
35 #include <media/media-entity.h>
47 MODULE_PARM_DESC(debug, "Debug level (0-1)");
53 /* enum tvp514x_std - enum for supported standards */
61 * struct tvp514x_std_info - Structure to store standard information
76 static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable);
78 * struct tvp514x_decoder - TVP5146/47 decoder object
79 * @sd: Subdevice Slave handle
84 * @streaming: TVP5146/47 decoder streaming - enabled or disabled.
98 struct v4l2_subdev sd; member
192 /* HS, VS active high */
194 /* 10-bit BT.656 */
200 /* Enable VS & HS */
219 .description = "8-bit UYVY 4:2:2 Format",
225 * Supported standards -
261 static inline struct tvp514x_decoder *to_decoder(struct v4l2_subdev *sd) in to_decoder() argument
263 return container_of(sd, struct tvp514x_decoder, sd); in to_decoder()
268 return &container_of(ctrl->handler, struct tvp514x_decoder, hdl)->sd; in to_sd()
273 * tvp514x_read_reg() - Read a value from a register in an TVP5146/47.
274 * @sd: ptr to v4l2_subdev struct
277 * Returns value read if successful, or non-zero (-1) otherwise.
279 static int tvp514x_read_reg(struct v4l2_subdev *sd, u8 reg) in tvp514x_read_reg() argument
282 struct i2c_client *client = v4l2_get_subdevdata(sd); in tvp514x_read_reg()
289 v4l2_warn(sd, "Read: retry ... %d\n", retry); in tvp514x_read_reg()
300 * dump_reg() - dump the register content of TVP5146/47.
301 * @sd: ptr to v4l2_subdev struct
304 static void dump_reg(struct v4l2_subdev *sd, u8 reg) in dump_reg() argument
308 val = tvp514x_read_reg(sd, reg); in dump_reg()
309 v4l2_info(sd, "Reg(0x%.2X): 0x%.2X\n", reg, val); in dump_reg()
313 * tvp514x_write_reg() - Write a value to a register in TVP5146/47
314 * @sd: ptr to v4l2_subdev struct
319 * Returns zero if successful, or non-zero otherwise.
321 static int tvp514x_write_reg(struct v4l2_subdev *sd, u8 reg, u8 val) in tvp514x_write_reg() argument
324 struct i2c_client *client = v4l2_get_subdevdata(sd); in tvp514x_write_reg()
331 v4l2_warn(sd, "Write: retry ... %d\n", retry); in tvp514x_write_reg()
343 * @sd: ptr to v4l2_subdev struct
346 * Initializes a list of TVP5146/47 registers:-
351 * Returns zero if successful, or non-zero otherwise.
353 static int tvp514x_write_regs(struct v4l2_subdev *sd, in tvp514x_write_regs() argument
359 for (; next->token != TOK_TERM; next++) { in tvp514x_write_regs()
360 if (next->token == TOK_DELAY) { in tvp514x_write_regs()
361 msleep(next->val); in tvp514x_write_regs()
365 if (next->token == TOK_SKIP) in tvp514x_write_regs()
368 err = tvp514x_write_reg(sd, next->reg, (u8) next->val); in tvp514x_write_regs()
370 v4l2_err(sd, "Write failed. Err[%d]\n", err); in tvp514x_write_regs()
379 * @sd: ptr to v4l2_subdev struct
384 static enum tvp514x_std tvp514x_query_current_std(struct v4l2_subdev *sd) in tvp514x_query_current_std() argument
388 std = tvp514x_read_reg(sd, REG_VIDEO_STD); in tvp514x_query_current_std()
391 std_status = tvp514x_read_reg(sd, REG_VIDEO_STD_STATUS); in tvp514x_query_current_std()
411 static void tvp514x_reg_dump(struct v4l2_subdev *sd) in tvp514x_reg_dump() argument
413 dump_reg(sd, REG_INPUT_SEL); in tvp514x_reg_dump()
414 dump_reg(sd, REG_AFE_GAIN_CTRL); in tvp514x_reg_dump()
415 dump_reg(sd, REG_VIDEO_STD); in tvp514x_reg_dump()
416 dump_reg(sd, REG_OPERATION_MODE); in tvp514x_reg_dump()
417 dump_reg(sd, REG_COLOR_KILLER); in tvp514x_reg_dump()
418 dump_reg(sd, REG_LUMA_CONTROL1); in tvp514x_reg_dump()
419 dump_reg(sd, REG_LUMA_CONTROL2); in tvp514x_reg_dump()
420 dump_reg(sd, REG_LUMA_CONTROL3); in tvp514x_reg_dump()
421 dump_reg(sd, REG_BRIGHTNESS); in tvp514x_reg_dump()
422 dump_reg(sd, REG_CONTRAST); in tvp514x_reg_dump()
423 dump_reg(sd, REG_SATURATION); in tvp514x_reg_dump()
424 dump_reg(sd, REG_HUE); in tvp514x_reg_dump()
425 dump_reg(sd, REG_CHROMA_CONTROL1); in tvp514x_reg_dump()
426 dump_reg(sd, REG_CHROMA_CONTROL2); in tvp514x_reg_dump()
427 dump_reg(sd, REG_COMP_PR_SATURATION); in tvp514x_reg_dump()
428 dump_reg(sd, REG_COMP_Y_CONTRAST); in tvp514x_reg_dump()
429 dump_reg(sd, REG_COMP_PB_SATURATION); in tvp514x_reg_dump()
430 dump_reg(sd, REG_COMP_Y_BRIGHTNESS); in tvp514x_reg_dump()
431 dump_reg(sd, REG_AVID_START_PIXEL_LSB); in tvp514x_reg_dump()
432 dump_reg(sd, REG_AVID_START_PIXEL_MSB); in tvp514x_reg_dump()
433 dump_reg(sd, REG_AVID_STOP_PIXEL_LSB); in tvp514x_reg_dump()
434 dump_reg(sd, REG_AVID_STOP_PIXEL_MSB); in tvp514x_reg_dump()
435 dump_reg(sd, REG_HSYNC_START_PIXEL_LSB); in tvp514x_reg_dump()
436 dump_reg(sd, REG_HSYNC_START_PIXEL_MSB); in tvp514x_reg_dump()
437 dump_reg(sd, REG_HSYNC_STOP_PIXEL_LSB); in tvp514x_reg_dump()
438 dump_reg(sd, REG_HSYNC_STOP_PIXEL_MSB); in tvp514x_reg_dump()
439 dump_reg(sd, REG_VSYNC_START_LINE_LSB); in tvp514x_reg_dump()
440 dump_reg(sd, REG_VSYNC_START_LINE_MSB); in tvp514x_reg_dump()
441 dump_reg(sd, REG_VSYNC_STOP_LINE_LSB); in tvp514x_reg_dump()
442 dump_reg(sd, REG_VSYNC_STOP_LINE_MSB); in tvp514x_reg_dump()
443 dump_reg(sd, REG_VBLK_START_LINE_LSB); in tvp514x_reg_dump()
444 dump_reg(sd, REG_VBLK_START_LINE_MSB); in tvp514x_reg_dump()
445 dump_reg(sd, REG_VBLK_STOP_LINE_LSB); in tvp514x_reg_dump()
446 dump_reg(sd, REG_VBLK_STOP_LINE_MSB); in tvp514x_reg_dump()
447 dump_reg(sd, REG_SYNC_CONTROL); in tvp514x_reg_dump()
448 dump_reg(sd, REG_OUTPUT_FORMATTER1); in tvp514x_reg_dump()
449 dump_reg(sd, REG_OUTPUT_FORMATTER2); in tvp514x_reg_dump()
450 dump_reg(sd, REG_OUTPUT_FORMATTER3); in tvp514x_reg_dump()
451 dump_reg(sd, REG_OUTPUT_FORMATTER4); in tvp514x_reg_dump()
452 dump_reg(sd, REG_OUTPUT_FORMATTER5); in tvp514x_reg_dump()
453 dump_reg(sd, REG_OUTPUT_FORMATTER6); in tvp514x_reg_dump()
454 dump_reg(sd, REG_CLEAR_LOST_LOCK); in tvp514x_reg_dump()
458 * tvp514x_configure() - Configure the TVP5146/47 registers
459 * @sd: ptr to v4l2_subdev struct
462 * Returns zero if successful, or non-zero otherwise.
464 static int tvp514x_configure(struct v4l2_subdev *sd, in tvp514x_configure() argument
471 tvp514x_write_regs(sd, decoder->tvp514x_regs); in tvp514x_configure()
476 tvp514x_reg_dump(sd); in tvp514x_configure()
482 * tvp514x_detect() - Detect if an tvp514x is present, and if so which revision.
483 * @sd: pointer to standard V4L2 sub-device structure
492 static int tvp514x_detect(struct v4l2_subdev *sd, in tvp514x_detect() argument
496 struct i2c_client *client = v4l2_get_subdevdata(sd); in tvp514x_detect()
498 chip_id_msb = tvp514x_read_reg(sd, REG_CHIP_ID_MSB); in tvp514x_detect()
499 chip_id_lsb = tvp514x_read_reg(sd, REG_CHIP_ID_LSB); in tvp514x_detect()
500 rom_ver = tvp514x_read_reg(sd, REG_ROM_VERSION); in tvp514x_detect()
502 v4l2_dbg(1, debug, sd, in tvp514x_detect()
511 v4l2_err(sd, "chip id mismatch msb:0x%x lsb:0x%x\n", in tvp514x_detect()
513 return -ENODEV; in tvp514x_detect()
516 decoder->ver = rom_ver; in tvp514x_detect()
518 v4l2_info(sd, "%s (Version - 0x%.2x) found at 0x%x (%s)\n", in tvp514x_detect()
519 client->name, decoder->ver, in tvp514x_detect()
520 client->addr << 1, client->adapter->name); in tvp514x_detect()
525 * tvp514x_querystd() - V4L2 decoder interface handler for querystd
526 * @sd: pointer to standard V4L2 sub-device structure
532 static int tvp514x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std_id) in tvp514x_querystd() argument
534 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_querystd()
540 return -EINVAL; in tvp514x_querystd()
543 if (!decoder->streaming) { in tvp514x_querystd()
544 tvp514x_s_stream(sd, 1); in tvp514x_querystd()
549 current_std = tvp514x_query_current_std(sd); in tvp514x_querystd()
555 input_sel = decoder->input; in tvp514x_querystd()
590 return -EINVAL; in tvp514x_querystd()
593 sync_lock_status = tvp514x_read_reg(sd, REG_STATUS1); in tvp514x_querystd()
599 *std_id &= decoder->std_list[current_std].standard.id; in tvp514x_querystd()
601 v4l2_dbg(1, debug, sd, "Current STD: %s\n", 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
608 * @sd: pointer to standard V4L2 sub-device structure
612 * -EINVAL
614 static int tvp514x_s_std(struct v4l2_subdev *sd, v4l2_std_id std_id) in tvp514x_s_std() argument
616 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_std()
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()
624 return -EINVAL; in tvp514x_s_std()
626 err = tvp514x_write_reg(sd, REG_VIDEO_STD, 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()
635 v4l2_dbg(1, debug, sd, "Standard set to: %s\n", 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
642 * @sd: pointer to standard V4L2 sub-device structure
647 * If index is valid, selects the requested input. Otherwise, returns -EINVAL if
651 static int tvp514x_s_routing(struct v4l2_subdev *sd, in tvp514x_s_routing() argument
654 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_routing()
662 return -EINVAL; in tvp514x_s_routing()
667 err = tvp514x_write_reg(sd, REG_INPUT_SEL, input_sel); in tvp514x_s_routing()
671 output_sel |= tvp514x_read_reg(sd, in tvp514x_s_routing()
673 err = tvp514x_write_reg(sd, REG_OUTPUT_FORMATTER1, in tvp514x_s_routing()
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()
683 v4l2_dbg(1, debug, sd, "Input set to: %d\n", input_sel); in tvp514x_s_routing()
689 * tvp514x_s_ctrl() - V4L2 decoder interface handler for s_ctrl
693 * value in HW. Otherwise, returns -EINVAL if the control is not supported.
697 struct v4l2_subdev *sd = to_sd(ctrl); in tvp514x_s_ctrl() local
698 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_ctrl()
699 int err = -EINVAL, value; in tvp514x_s_ctrl()
701 value = ctrl->val; in tvp514x_s_ctrl()
703 switch (ctrl->id) { in tvp514x_s_ctrl()
705 err = tvp514x_write_reg(sd, REG_BRIGHTNESS, value); in tvp514x_s_ctrl()
707 decoder->tvp514x_regs[REG_BRIGHTNESS].val = value; in tvp514x_s_ctrl()
710 err = tvp514x_write_reg(sd, REG_CONTRAST, value); in tvp514x_s_ctrl()
712 decoder->tvp514x_regs[REG_CONTRAST].val = value; in tvp514x_s_ctrl()
715 err = tvp514x_write_reg(sd, REG_SATURATION, value); in tvp514x_s_ctrl()
717 decoder->tvp514x_regs[REG_SATURATION].val = value; in tvp514x_s_ctrl()
722 else if (value == -180) in tvp514x_s_ctrl()
724 err = tvp514x_write_reg(sd, REG_HUE, value); in tvp514x_s_ctrl()
726 decoder->tvp514x_regs[REG_HUE].val = value; in tvp514x_s_ctrl()
729 err = tvp514x_write_reg(sd, REG_AFE_GAIN_CTRL, value ? 0x0f : 0x0c); in tvp514x_s_ctrl()
731 decoder->tvp514x_regs[REG_AFE_GAIN_CTRL].val = value; in tvp514x_s_ctrl()
735 v4l2_dbg(1, debug, sd, "Set Control: ID - %d - %d\n", in tvp514x_s_ctrl()
736 ctrl->id, ctrl->val); in tvp514x_s_ctrl()
741 * tvp514x_g_frame_interval() - V4L2 decoder interface handler
742 * @sd: pointer to standard V4L2 sub-device structure
748 tvp514x_g_frame_interval(struct v4l2_subdev *sd, in tvp514x_g_frame_interval() argument
751 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_g_frame_interval()
756 current_std = decoder->current_std; in tvp514x_g_frame_interval()
758 ival->interval = 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
766 * @sd: pointer to standard V4L2 sub-device structure
773 tvp514x_s_frame_interval(struct v4l2_subdev *sd, in tvp514x_s_frame_interval() argument
776 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_frame_interval()
781 timeperframe = &ival->interval; in tvp514x_s_frame_interval()
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
794 * @sd: pointer to standard V4L2 sub-device structure
799 static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable) in tvp514x_s_stream() argument
802 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_s_stream()
804 if (decoder->streaming == enable) in tvp514x_s_stream()
811 err = tvp514x_write_reg(sd, REG_OPERATION_MODE, 0x01); 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()
842 err = -ENODEV; in tvp514x_s_stream()
854 * tvp514x_enum_mbus_code() - V4L2 decoder interface handler for enum_mbus_code
855 * @sd: pointer to standard V4L2 sub-device structure
861 static int tvp514x_enum_mbus_code(struct v4l2_subdev *sd, in tvp514x_enum_mbus_code() argument
865 u32 pad = code->pad; in tvp514x_enum_mbus_code()
866 u32 index = code->index; in tvp514x_enum_mbus_code()
869 code->index = index; in tvp514x_enum_mbus_code()
870 code->pad = pad; in tvp514x_enum_mbus_code()
873 return -EINVAL; in tvp514x_enum_mbus_code()
875 code->code = MEDIA_BUS_FMT_UYVY8_2X8; in tvp514x_enum_mbus_code()
881 * tvp514x_get_pad_format() - V4L2 decoder interface handler for get pad format
882 * @sd: pointer to standard V4L2 sub-device structure
888 static int tvp514x_get_pad_format(struct v4l2_subdev *sd, in tvp514x_get_pad_format() argument
892 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_get_pad_format()
893 __u32 which = format->which; in tvp514x_get_pad_format()
895 if (format->pad) in tvp514x_get_pad_format()
896 return -EINVAL; in tvp514x_get_pad_format()
899 format->format = decoder->format; in tvp514x_get_pad_format()
903 format->format.code = MEDIA_BUS_FMT_UYVY8_2X8; 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()
906 format->format.colorspace = V4L2_COLORSPACE_SMPTE170M; in tvp514x_get_pad_format()
907 format->format.field = V4L2_FIELD_INTERLACED; in tvp514x_get_pad_format()
913 * tvp514x_set_pad_format() - V4L2 decoder interface handler for set pad format
914 * @sd: pointer to standard V4L2 sub-device structure
920 static int tvp514x_set_pad_format(struct v4l2_subdev *sd, in tvp514x_set_pad_format() argument
924 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_set_pad_format()
926 if (fmt->format.field != V4L2_FIELD_INTERLACED || in tvp514x_set_pad_format()
927 fmt->format.code != MEDIA_BUS_FMT_UYVY8_2X8 || in tvp514x_set_pad_format()
928 fmt->format.colorspace != V4L2_COLORSPACE_SMPTE170M || in tvp514x_set_pad_format()
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()
931 return -EINVAL; in tvp514x_set_pad_format()
933 decoder->format = fmt->format; in tvp514x_set_pad_format()
963 /* Default to NTSC 8-bit YUV 422 */
987 if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) in tvp514x_get_pdata()
988 return client->dev.platform_data; in tvp514x_get_pdata()
990 endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); in tvp514x_get_pdata()
997 pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); in tvp514x_get_pdata()
1004 pdata->hs_polarity = 1; in tvp514x_get_pdata()
1007 pdata->vs_polarity = 1; in tvp514x_get_pdata()
1010 pdata->clk_polarity = 1; in tvp514x_get_pdata()
1018 * tvp514x_probe() - decoder driver i2c probe handler
1030 struct v4l2_subdev *sd; in tvp514x_probe() local
1034 dev_err(&client->dev, "No platform data\n"); in tvp514x_probe()
1035 return -EINVAL; in tvp514x_probe()
1039 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in tvp514x_probe()
1040 return -EIO; in tvp514x_probe()
1042 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in tvp514x_probe()
1044 return -ENOMEM; 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()
1073 v4l2_i2c_subdev_init(sd, client, &tvp514x_ops); 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()
1083 sd->name); 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()
1095 V4L2_CID_HUE, -180, 180, 180, 0); 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
1126 struct v4l2_subdev *sd = i2c_get_clientdata(client); in tvp514x_remove() local
1127 struct tvp514x_decoder *decoder = to_decoder(sd); in tvp514x_remove()
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()
1181 * I2C Device Table -
1183 * name - Name of the actual device/chip.
1184 * driver_data - Driver data