linux/drivers/media/platform/xilinx/xilinx-tpg.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Xilinx Test Pattern Generator
 *
 * Copyright (C) 2013-2015 Ideas on Board
 * Copyright (C) 2013-2015 Xilinx, Inc.
 *
 * Contacts: Hyun Kwon <[email protected]>
 *           Laurent Pinchart <[email protected]>
 */

#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/xilinx-v4l2-controls.h>

#include <media/v4l2-async.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>

#include "xilinx-vip.h"
#include "xilinx-vtc.h"

#define XTPG_CTRL_STATUS_SLAVE_ERROR
#define XTPG_CTRL_IRQ_SLAVE_ERROR

#define XTPG_PATTERN_CONTROL
#define XTPG_PATTERN_MASK
#define XTPG_PATTERN_CONTROL_CROSS_HAIRS
#define XTPG_PATTERN_CONTROL_MOVING_BOX
#define XTPG_PATTERN_CONTROL_COLOR_MASK_SHIFT
#define XTPG_PATTERN_CONTROL_COLOR_MASK_MASK
#define XTPG_PATTERN_CONTROL_STUCK_PIXEL
#define XTPG_PATTERN_CONTROL_NOISE
#define XTPG_PATTERN_CONTROL_MOTION
#define XTPG_MOTION_SPEED
#define XTPG_CROSS_HAIRS
#define XTPG_CROSS_HAIRS_ROW_SHIFT
#define XTPG_CROSS_HAIRS_ROW_MASK
#define XTPG_CROSS_HAIRS_COLUMN_SHIFT
#define XTPG_CROSS_HAIRS_COLUMN_MASK
#define XTPG_ZPLATE_HOR_CONTROL
#define XTPG_ZPLATE_VER_CONTROL
#define XTPG_ZPLATE_START_SHIFT
#define XTPG_ZPLATE_START_MASK
#define XTPG_ZPLATE_SPEED_SHIFT
#define XTPG_ZPLATE_SPEED_MASK
#define XTPG_BOX_SIZE
#define XTPG_BOX_COLOR
#define XTPG_STUCK_PIXEL_THRESH
#define XTPG_NOISE_GAIN
#define XTPG_BAYER_PHASE
#define XTPG_BAYER_PHASE_RGGB
#define XTPG_BAYER_PHASE_GRBG
#define XTPG_BAYER_PHASE_GBRG
#define XTPG_BAYER_PHASE_BGGR
#define XTPG_BAYER_PHASE_OFF

/*
 * The minimum blanking value is one clock cycle for the front porch, one clock
 * cycle for the sync pulse and one clock cycle for the back porch.
 */
#define XTPG_MIN_HBLANK
#define XTPG_MAX_HBLANK
#define XTPG_MIN_VBLANK
#define XTPG_MAX_VBLANK

/**
 * struct xtpg_device - Xilinx Test Pattern Generator device structure
 * @xvip: Xilinx Video IP device
 * @pads: media pads
 * @npads: number of pads (1 or 2)
 * @has_input: whether an input is connected to the sink pad
 * @formats: active V4L2 media bus format for each pad
 * @default_format: default V4L2 media bus format
 * @vip_format: format information corresponding to the active format
 * @bayer: boolean flag if TPG is set to any bayer format
 * @ctrl_handler: control handler
 * @hblank: horizontal blanking control
 * @vblank: vertical blanking control
 * @pattern: test pattern control
 * @streaming: is the video stream active
 * @vtc: video timing controller
 * @vtmux_gpio: video timing mux GPIO
 */
struct xtpg_device {};

static inline struct xtpg_device *to_tpg(struct v4l2_subdev *subdev)
{}

static u32 xtpg_get_bayer_phase(unsigned int code)
{}

static void __xtpg_update_pattern_control(struct xtpg_device *xtpg,
					  bool passthrough, bool pattern)
{}

static void xtpg_update_pattern_control(struct xtpg_device *xtpg,
					bool passthrough, bool pattern)
{}

/* -----------------------------------------------------------------------------
 * V4L2 Subdevice Video Operations
 */

static int xtpg_s_stream(struct v4l2_subdev *subdev, int enable)
{}

/* -----------------------------------------------------------------------------
 * V4L2 Subdevice Pad Operations
 */

static struct v4l2_mbus_framefmt *
__xtpg_get_pad_format(struct xtpg_device *xtpg,
		      struct v4l2_subdev_state *sd_state,
		      unsigned int pad, u32 which)
{}

static int xtpg_get_format(struct v4l2_subdev *subdev,
			   struct v4l2_subdev_state *sd_state,
			   struct v4l2_subdev_format *fmt)
{}

static int xtpg_set_format(struct v4l2_subdev *subdev,
			   struct v4l2_subdev_state *sd_state,
			   struct v4l2_subdev_format *fmt)
{}

/* -----------------------------------------------------------------------------
 * V4L2 Subdevice Operations
 */

static int xtpg_enum_frame_size(struct v4l2_subdev *subdev,
				struct v4l2_subdev_state *sd_state,
				struct v4l2_subdev_frame_size_enum *fse)
{}

static int xtpg_open(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
{}

static int xtpg_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
{}

static int xtpg_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops xtpg_ctrl_ops =;

static const struct v4l2_subdev_core_ops xtpg_core_ops =;

static const struct v4l2_subdev_video_ops xtpg_video_ops =;

static const struct v4l2_subdev_pad_ops xtpg_pad_ops =;

static const struct v4l2_subdev_ops xtpg_ops =;

static const struct v4l2_subdev_internal_ops xtpg_internal_ops =;

/*
 * Control Config
 */

static const char *const xtpg_pattern_strings[] =;

static struct v4l2_ctrl_config xtpg_ctrls[] =;

/* -----------------------------------------------------------------------------
 * Media Operations
 */

static const struct media_entity_operations xtpg_media_ops =;

/* -----------------------------------------------------------------------------
 * Power Management
 */

static int __maybe_unused xtpg_pm_suspend(struct device *dev)
{}

static int __maybe_unused xtpg_pm_resume(struct device *dev)
{}

/* -----------------------------------------------------------------------------
 * Platform Device Driver
 */

static int xtpg_parse_of(struct xtpg_device *xtpg)
{}

static int xtpg_probe(struct platform_device *pdev)
{}

static void xtpg_remove(struct platform_device *pdev)
{}

static SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume);

static const struct of_device_id xtpg_of_id_table[] =;
MODULE_DEVICE_TABLE(of, xtpg_of_id_table);

static struct platform_driver xtpg_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();