xtpg 131 drivers/media/platform/xilinx/xilinx-tpg.c static void __xtpg_update_pattern_control(struct xtpg_device *xtpg, xtpg 134 drivers/media/platform/xilinx/xilinx-tpg.c u32 pattern_mask = (1 << (xtpg->pattern->maximum + 1)) - 1; xtpg 140 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->npads == 1 || !xtpg->has_input) xtpg 151 drivers/media/platform/xilinx/xilinx-tpg.c __v4l2_ctrl_modify_range(xtpg->pattern, 0, xtpg->pattern->maximum, xtpg 155 drivers/media/platform/xilinx/xilinx-tpg.c static void xtpg_update_pattern_control(struct xtpg_device *xtpg, xtpg 158 drivers/media/platform/xilinx/xilinx-tpg.c mutex_lock(xtpg->ctrl_handler.lock); xtpg 159 drivers/media/platform/xilinx/xilinx-tpg.c __xtpg_update_pattern_control(xtpg, passthrough, pattern); xtpg 160 drivers/media/platform/xilinx/xilinx-tpg.c mutex_unlock(xtpg->ctrl_handler.lock); xtpg 169 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = to_tpg(subdev); xtpg 170 drivers/media/platform/xilinx/xilinx-tpg.c unsigned int width = xtpg->formats[0].width; xtpg 171 drivers/media/platform/xilinx/xilinx-tpg.c unsigned int height = xtpg->formats[0].height; xtpg 176 drivers/media/platform/xilinx/xilinx-tpg.c xvip_stop(&xtpg->xvip); xtpg 177 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->vtc) xtpg 178 drivers/media/platform/xilinx/xilinx-tpg.c xvtc_generator_stop(xtpg->vtc); xtpg 180 drivers/media/platform/xilinx/xilinx-tpg.c xtpg_update_pattern_control(xtpg, true, true); xtpg 181 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->streaming = false; xtpg 185 drivers/media/platform/xilinx/xilinx-tpg.c xvip_set_frame_size(&xtpg->xvip, &xtpg->formats[0]); xtpg 187 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->vtc) { xtpg 198 drivers/media/platform/xilinx/xilinx-tpg.c v4l2_ctrl_g_ctrl(xtpg->hblank) + width); xtpg 200 drivers/media/platform/xilinx/xilinx-tpg.c v4l2_ctrl_g_ctrl(xtpg->vblank) + height); xtpg 207 drivers/media/platform/xilinx/xilinx-tpg.c xvtc_generator_start(xtpg->vtc, &config); xtpg 216 drivers/media/platform/xilinx/xilinx-tpg.c mutex_lock(xtpg->ctrl_handler.lock); xtpg 218 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 219 drivers/media/platform/xilinx/xilinx-tpg.c XTPG_PATTERN_MASK, xtpg->pattern->cur.val); xtpg 225 drivers/media/platform/xilinx/xilinx-tpg.c passthrough = xtpg->pattern->cur.val == 0; xtpg 226 drivers/media/platform/xilinx/xilinx-tpg.c __xtpg_update_pattern_control(xtpg, passthrough, !passthrough); xtpg 228 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->streaming = true; xtpg 230 drivers/media/platform/xilinx/xilinx-tpg.c mutex_unlock(xtpg->ctrl_handler.lock); xtpg 237 drivers/media/platform/xilinx/xilinx-tpg.c : xtpg_get_bayer_phase(xtpg->formats[0].code); xtpg 238 drivers/media/platform/xilinx/xilinx-tpg.c xvip_write(&xtpg->xvip, XTPG_BAYER_PHASE, bayer_phase); xtpg 240 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->vtmux_gpio) xtpg 241 drivers/media/platform/xilinx/xilinx-tpg.c gpiod_set_value_cansleep(xtpg->vtmux_gpio, !passthrough); xtpg 243 drivers/media/platform/xilinx/xilinx-tpg.c xvip_start(&xtpg->xvip); xtpg 253 drivers/media/platform/xilinx/xilinx-tpg.c __xtpg_get_pad_format(struct xtpg_device *xtpg, xtpg 259 drivers/media/platform/xilinx/xilinx-tpg.c return v4l2_subdev_get_try_format(&xtpg->xvip.subdev, cfg, pad); xtpg 261 drivers/media/platform/xilinx/xilinx-tpg.c return &xtpg->formats[pad]; xtpg 271 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = to_tpg(subdev); xtpg 273 drivers/media/platform/xilinx/xilinx-tpg.c fmt->format = *__xtpg_get_pad_format(xtpg, cfg, fmt->pad, fmt->which); xtpg 282 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = to_tpg(subdev); xtpg 286 drivers/media/platform/xilinx/xilinx-tpg.c __format = __xtpg_get_pad_format(xtpg, cfg, fmt->pad, fmt->which); xtpg 291 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->npads == 2 && fmt->pad == 1) { xtpg 297 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->bayer) { xtpg 308 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->npads == 2) { xtpg 309 drivers/media/platform/xilinx/xilinx-tpg.c __format = __xtpg_get_pad_format(xtpg, cfg, 1, fmt->which); xtpg 351 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = to_tpg(subdev); xtpg 355 drivers/media/platform/xilinx/xilinx-tpg.c *format = xtpg->default_format; xtpg 357 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->npads == 2) { xtpg 359 drivers/media/platform/xilinx/xilinx-tpg.c *format = xtpg->default_format; xtpg 372 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = container_of(ctrl->handler, xtpg 377 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 381 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_or_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 385 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_or_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 389 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 395 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_or_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 399 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_or_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 403 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_or_set(&xtpg->xvip, XTPG_PATTERN_CONTROL, xtpg 407 drivers/media/platform/xilinx/xilinx-tpg.c xvip_write(&xtpg->xvip, XTPG_MOTION_SPEED, ctrl->val); xtpg 410 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_CROSS_HAIRS, xtpg 415 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_CROSS_HAIRS, xtpg 420 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_ZPLATE_HOR_CONTROL, xtpg 425 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_ZPLATE_HOR_CONTROL, xtpg 430 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_ZPLATE_VER_CONTROL, xtpg 435 drivers/media/platform/xilinx/xilinx-tpg.c xvip_clr_and_set(&xtpg->xvip, XTPG_ZPLATE_VER_CONTROL, xtpg 440 drivers/media/platform/xilinx/xilinx-tpg.c xvip_write(&xtpg->xvip, XTPG_BOX_SIZE, ctrl->val); xtpg 443 drivers/media/platform/xilinx/xilinx-tpg.c xvip_write(&xtpg->xvip, XTPG_BOX_COLOR, ctrl->val); xtpg 446 drivers/media/platform/xilinx/xilinx-tpg.c xvip_write(&xtpg->xvip, XTPG_STUCK_PIXEL_THRESH, ctrl->val); xtpg 449 drivers/media/platform/xilinx/xilinx-tpg.c xvip_write(&xtpg->xvip, XTPG_NOISE_GAIN, ctrl->val); xtpg 688 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = dev_get_drvdata(dev); xtpg 690 drivers/media/platform/xilinx/xilinx-tpg.c xvip_suspend(&xtpg->xvip); xtpg 697 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = dev_get_drvdata(dev); xtpg 699 drivers/media/platform/xilinx/xilinx-tpg.c xvip_resume(&xtpg->xvip); xtpg 708 drivers/media/platform/xilinx/xilinx-tpg.c static int xtpg_parse_of(struct xtpg_device *xtpg) xtpg 710 drivers/media/platform/xilinx/xilinx-tpg.c struct device *dev = xtpg->xvip.dev; xtpg 711 drivers/media/platform/xilinx/xilinx-tpg.c struct device_node *node = xtpg->xvip.dev->of_node; xtpg 736 drivers/media/platform/xilinx/xilinx-tpg.c if (!xtpg->vip_format) { xtpg 737 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->vip_format = format; xtpg 738 drivers/media/platform/xilinx/xilinx-tpg.c } else if (xtpg->vip_format != format) { xtpg 760 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->npads = nports; xtpg 762 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->has_input = true; xtpg 770 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg; xtpg 774 drivers/media/platform/xilinx/xilinx-tpg.c xtpg = devm_kzalloc(&pdev->dev, sizeof(*xtpg), GFP_KERNEL); xtpg 775 drivers/media/platform/xilinx/xilinx-tpg.c if (!xtpg) xtpg 778 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->xvip.dev = &pdev->dev; xtpg 780 drivers/media/platform/xilinx/xilinx-tpg.c ret = xtpg_parse_of(xtpg); xtpg 784 drivers/media/platform/xilinx/xilinx-tpg.c ret = xvip_init_resources(&xtpg->xvip); xtpg 788 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->vtmux_gpio = devm_gpiod_get_optional(&pdev->dev, "timing", xtpg 790 drivers/media/platform/xilinx/xilinx-tpg.c if (IS_ERR(xtpg->vtmux_gpio)) { xtpg 791 drivers/media/platform/xilinx/xilinx-tpg.c ret = PTR_ERR(xtpg->vtmux_gpio); xtpg 795 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->vtc = xvtc_of_get(pdev->dev.of_node); xtpg 796 drivers/media/platform/xilinx/xilinx-tpg.c if (IS_ERR(xtpg->vtc)) { xtpg 797 drivers/media/platform/xilinx/xilinx-tpg.c ret = PTR_ERR(xtpg->vtc); xtpg 802 drivers/media/platform/xilinx/xilinx-tpg.c xvip_reset(&xtpg->xvip); xtpg 807 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->npads == 2) { xtpg 808 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->pads[0].flags = MEDIA_PAD_FL_SINK; xtpg 809 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->pads[1].flags = MEDIA_PAD_FL_SOURCE; xtpg 811 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->pads[0].flags = MEDIA_PAD_FL_SOURCE; xtpg 815 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->default_format.code = xtpg->vip_format->code; xtpg 816 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->default_format.field = V4L2_FIELD_NONE; xtpg 817 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->default_format.colorspace = V4L2_COLORSPACE_SRGB; xtpg 818 drivers/media/platform/xilinx/xilinx-tpg.c xvip_get_frame_size(&xtpg->xvip, &xtpg->default_format); xtpg 820 drivers/media/platform/xilinx/xilinx-tpg.c bayer_phase = xtpg_get_bayer_phase(xtpg->vip_format->code); xtpg 822 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->bayer = true; xtpg 824 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->formats[0] = xtpg->default_format; xtpg 825 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->npads == 2) xtpg 826 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->formats[1] = xtpg->default_format; xtpg 829 drivers/media/platform/xilinx/xilinx-tpg.c subdev = &xtpg->xvip.subdev; xtpg 834 drivers/media/platform/xilinx/xilinx-tpg.c v4l2_set_subdevdata(subdev, xtpg); xtpg 838 drivers/media/platform/xilinx/xilinx-tpg.c ret = media_entity_pads_init(&subdev->entity, xtpg->npads, xtpg->pads); xtpg 842 drivers/media/platform/xilinx/xilinx-tpg.c v4l2_ctrl_handler_init(&xtpg->ctrl_handler, 3 + ARRAY_SIZE(xtpg_ctrls)); xtpg 844 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->vblank = v4l2_ctrl_new_std(&xtpg->ctrl_handler, &xtpg_ctrl_ops, xtpg 847 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->hblank = v4l2_ctrl_new_std(&xtpg->ctrl_handler, &xtpg_ctrl_ops, xtpg 850 drivers/media/platform/xilinx/xilinx-tpg.c xtpg->pattern = v4l2_ctrl_new_std_menu_items(&xtpg->ctrl_handler, xtpg 856 drivers/media/platform/xilinx/xilinx-tpg.c v4l2_ctrl_new_custom(&xtpg->ctrl_handler, &xtpg_ctrls[i], NULL); xtpg 858 drivers/media/platform/xilinx/xilinx-tpg.c if (xtpg->ctrl_handler.error) { xtpg 860 drivers/media/platform/xilinx/xilinx-tpg.c ret = xtpg->ctrl_handler.error; xtpg 863 drivers/media/platform/xilinx/xilinx-tpg.c subdev->ctrl_handler = &xtpg->ctrl_handler; xtpg 865 drivers/media/platform/xilinx/xilinx-tpg.c xtpg_update_pattern_control(xtpg, true, true); xtpg 867 drivers/media/platform/xilinx/xilinx-tpg.c ret = v4l2_ctrl_handler_setup(&xtpg->ctrl_handler); xtpg 873 drivers/media/platform/xilinx/xilinx-tpg.c platform_set_drvdata(pdev, xtpg); xtpg 875 drivers/media/platform/xilinx/xilinx-tpg.c xvip_print_version(&xtpg->xvip); xtpg 886 drivers/media/platform/xilinx/xilinx-tpg.c v4l2_ctrl_handler_free(&xtpg->ctrl_handler); xtpg 888 drivers/media/platform/xilinx/xilinx-tpg.c xvtc_put(xtpg->vtc); xtpg 890 drivers/media/platform/xilinx/xilinx-tpg.c xvip_cleanup_resources(&xtpg->xvip); xtpg 896 drivers/media/platform/xilinx/xilinx-tpg.c struct xtpg_device *xtpg = platform_get_drvdata(pdev); xtpg 897 drivers/media/platform/xilinx/xilinx-tpg.c struct v4l2_subdev *subdev = &xtpg->xvip.subdev; xtpg 900 drivers/media/platform/xilinx/xilinx-tpg.c v4l2_ctrl_handler_free(&xtpg->ctrl_handler); xtpg 903 drivers/media/platform/xilinx/xilinx-tpg.c xvip_cleanup_resources(&xtpg->xvip);