linux/drivers/media/usb/hdpvr/hdpvr.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Hauppauge HD PVR USB driver
 *
 * Copyright (C) 2008      Janne Grunau ([email protected])
 */

#include <linux/usb.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include <linux/videodev2.h>

#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/i2c/ir-kbd-i2c.h>

#define HDPVR_MAX
#define HDPVR_I2C_MAX_SIZE

/* Define these values to match your devices */
#define HD_PVR_VENDOR_ID
#define HD_PVR_PRODUCT_ID
#define HD_PVR_PRODUCT_ID1
#define HD_PVR_PRODUCT_ID2
#define HD_PVR_PRODUCT_ID4
#define HD_PVR_PRODUCT_ID3

#define UNSET

#define NUM_BUFFERS

#define HDPVR_FIRMWARE_VERSION
#define HDPVR_FIRMWARE_VERSION_AC3
#define HDPVR_FIRMWARE_VERSION_0X12
#define HDPVR_FIRMWARE_VERSION_0X15
#define HDPVR_FIRMWARE_VERSION_0X1E

/* #define HDPVR_DEBUG */

extern int hdpvr_debug;

#define MSG_INFO
#define MSG_BUFFER

struct hdpvr_options {};

/* Structure to hold all of our device specific stuff */
struct hdpvr_device {};

static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)
{}


/* buffer one bulk urb of data */
struct hdpvr_buffer {};

/* */

struct hdpvr_video_info {};

enum {};

enum {};

enum {};

#define CTRL_START_STREAMING_VALUE
#define CTRL_STOP_STREAMING_VALUE
#define CTRL_BITRATE_VALUE
#define CTRL_BITRATE_MODE_VALUE
#define CTRL_GOP_MODE_VALUE
#define CTRL_VIDEO_INPUT_VALUE
#define CTRL_VIDEO_STD_TYPE
#define CTRL_AUDIO_INPUT_VALUE
#define CTRL_BRIGHTNESS
#define CTRL_CONTRAST
#define CTRL_HUE
#define CTRL_SATURATION
#define CTRL_SHARPNESS
#define CTRL_LOW_PASS_FILTER_VALUE

#define CTRL_DEFAULT_INDEX


	/* :0 s 38 01 1000 0003 0004 4 = 0a00ca00
	 * BITRATE SETTING
	 *   1st and 2nd byte (little endian): average bitrate in 100 000 bit/s
	 *                                     min: 1 mbit/s, max: 13.5 mbit/s
	 *   3rd and 4th byte (little endian): peak bitrate in 100 000 bit/s
	 *                                     min: average + 100kbit/s,
	 *                                      max: 20.2 mbit/s
	 */

	/* :0 s 38 01 1200 0003 0001 1 = 02
	 * BIT RATE MODE
	 *  constant = 1, variable (peak) = 2, variable (average) = 3
	 */

	/* :0 s 38 01 1300 0003 0001 1 = 03
	 * GOP MODE (2 bit)
	 *    low bit 0/1: advanced/simple GOP
	 *   high bit 0/1: IDR(4/32/128) / no IDR (4/32/0)
	 */

	/* :0 s 38 01 1700 0003 0001 1 = 00
	 * VIDEO STANDARD or FREQUENCY 0 = 60hz, 1 = 50hz
	 */

	/* :0 s 38 01 3100 0003 0004 4 = 03030000
	 * FILTER CONTROL
	 *   1st byte luma low pass filter strength,
	 *   2nd byte chroma low pass filter strength,
	 *   3rd byte MF enable chroma, min=0, max=1
	 *   4th byte n
	 */


	/* :0 s 38 b9 0001 0000 0000 0 */



/* :0 s 38 d3 0000 0000 0001 1 = 00 */
/*		ret = usb_control_msg(dev->udev, */
/*				      usb_sndctrlpipe(dev->udev, 0), */
/*				      0xd3, 0x38, */
/*				      0, 0, */
/*				      "\0", 1, */
/*				      1000); */

/*		info("control request returned %d", ret); */
/*		msleep(5000); */


	/* :0 s b8 81 1400 0003 0005 5 <
	 * :0 0 5 = d0024002 19
	 * QUERY FRAME SIZE AND RATE
	 *   1st and 2nd byte (little endian): horizontal resolution
	 *   3rd and 4th byte (little endian): vertical resolution
	 *   5th byte: frame rate
	 */

	/* :0 s b8 81 1800 0003 0003 3 <
	 * :0 0 3 = 030104
	 * QUERY SIGNAL AND DETECTED LINES, maybe INPUT
	 */

enum hdpvr_video_std {};

enum hdpvr_video_input {};

enum hdpvr_audio_inputs {};

enum hdpvr_bitrate_mode {};

enum hdpvr_gop_mode {};

void hdpvr_delete(struct hdpvr_device *dev);

/*========================================================================*/
/* hardware control functions */
int hdpvr_set_options(struct hdpvr_device *dev);

int hdpvr_set_bitrate(struct hdpvr_device *dev);

int hdpvr_set_audio(struct hdpvr_device *dev, u8 input,
		    enum v4l2_mpeg_audio_encoding codec);

int hdpvr_config_call(struct hdpvr_device *dev, uint value,
		      unsigned char valbuf);

int get_video_info(struct hdpvr_device *dev, struct hdpvr_video_info *vid_info);

/* :0 s b8 81 1800 0003 0003 3 < */
/* :0 0 3 = 0301ff */
int get_input_lines_info(struct hdpvr_device *dev);


/*========================================================================*/
/* v4l2 registration */
int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent,
			    int devnumber);

int hdpvr_cancel_queue(struct hdpvr_device *dev);

/*========================================================================*/
/* i2c adapter registration */
int hdpvr_register_i2c_adapter(struct hdpvr_device *dev);

struct i2c_client *hdpvr_register_ir_i2c(struct hdpvr_device *dev);

/*========================================================================*/
/* buffer management */
int hdpvr_free_buffers(struct hdpvr_device *dev);
int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count);