linux/drivers/media/usb/dvb-usb/cxusb.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _DVB_USB_CXUSB_H_
#define _DVB_USB_CXUSB_H_

#include <linux/completion.h>
#include <linux/i2c.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/usb.h>
#include <linux/workqueue.h>
#include <media/v4l2-common.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/videobuf2-core.h>
#include <media/videobuf2-v4l2.h>

#define DVB_USB_LOG_PREFIX
#include "dvb-usb.h"

#define CXUSB_VIDEO_URBS
#define CXUSB_VIDEO_URB_MAX_SIZE

#define CXUSB_VIDEO_PKT_SIZE
#define CXUSB_VIDEO_MAX_FRAME_PKTS
#define CXUSB_VIDEO_MAX_FRAME_SIZE

/* usb commands - some of it are guesses, don't have a reference yet */
#define CMD_BLUEBIRD_GPIO_RW

#define CMD_I2C_WRITE
#define CMD_I2C_READ

#define CMD_GPIO_READ
#define CMD_GPIO_WRITE
#define GPIO_TUNER

#define CMD_POWER_OFF
#define CMD_POWER_ON

#define CMD_STREAMING_ON
#define CMD_STREAMING_OFF

#define CMD_AVER_STREAM_ON
#define CMD_AVER_STREAM_OFF

#define CMD_GET_IR_CODE

#define CMD_ANALOG
#define CMD_DIGITAL

#define CXUSB_BT656_PREAMBLE

#define CXUSB_BT656_FIELD_MASK
#define CXUSB_BT656_FIELD_1
#define CXUSB_BT656_FIELD_2

#define CXUSB_BT656_VBI_MASK
#define CXUSB_BT656_VBI_ON
#define CXUSB_BT656_VBI_OFF

#define CXUSB_BT656_SEAV_MASK
#define CXUSB_BT656_SEAV_EAV
#define CXUSB_BT656_SEAV_SAV

/* Max transfer size done by I2C transfer functions */
#define MAX_XFER_SIZE

struct cxusb_state {};

enum cxusb_open_type {};

struct cxusb_medion_auxbuf {};

enum cxusb_bt656_mode {};

enum cxusb_bt656_fmode {};

struct cxusb_bt656_params {};

struct cxusb_medion_dev {};

struct cxusb_medion_vbuffer {};

/* defines for "debug" module parameter */
#define CXUSB_DBG_RC
#define CXUSB_DBG_I2C
#define CXUSB_DBG_MISC
#define CXUSB_DBG_BT656
#define CXUSB_DBG_URB
#define CXUSB_DBG_OPS
#define CXUSB_DBG_AUXB

extern int dvb_usb_cxusb_debug;

#define cxusb_vprintk(dvbdev, lvl, ...)

int cxusb_ctrl_msg(struct dvb_usb_device *d,
		   u8 cmd, const u8 *wbuf, int wlen, u8 *rbuf, int rlen);

#ifdef CONFIG_DVB_USB_CXUSB_ANALOG
int cxusb_medion_analog_init(struct dvb_usb_device *dvbdev);
int cxusb_medion_register_analog(struct dvb_usb_device *dvbdev);
void cxusb_medion_unregister_analog(struct dvb_usb_device *dvbdev);
#else
static inline int cxusb_medion_analog_init(struct dvb_usb_device *dvbdev)
{
	return -EINVAL;
}

static inline int cxusb_medion_register_analog(struct dvb_usb_device *dvbdev)
{
	return 0;
}

static inline void cxusb_medion_unregister_analog(struct dvb_usb_device *dvbdev)
{
}
#endif

int cxusb_medion_get(struct dvb_usb_device *dvbdev,
		     enum cxusb_open_type open_type);
void cxusb_medion_put(struct dvb_usb_device *dvbdev);

#endif