linux/drivers/media/pci/zoran/zoran_card.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Zoran zr36057/zr36067 PCI controller driver, for the
 * Pinnacle/Miro DC10/DC10+/DC30/DC30+, Iomega Buz, Linux
 * Media Labs LML33/LML33R10.
 *
 * This part handles card-specific data and detection
 *
 * Copyright (C) 2000 Serguei Miridonov <[email protected]>
 */

#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>

#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/videodev2.h>
#include <linux/spinlock.h>

#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <media/v4l2-common.h>
#include <media/i2c/bt819.h>

#include "videocodec.h"
#include "zoran.h"
#include "zoran_card.h"
#include "zoran_device.h"
#include "zr36016.h"
#include "zr36050.h"
#include "zr36060.h"

extern const struct zoran_format zoran_formats[];

static int card[BUZ_MAX] =;
module_param_array();
MODULE_PARM_DESC();

/* Default input and video norm at startup of the driver. */

static unsigned int default_input;	/* default 0 = Composite, 1 = S-Video */
module_param(default_input, uint, 0444);
MODULE_PARM_DESC();

static int default_mux =;	/* 6 Eyes input selection */
module_param(default_mux, int, 0644);
MODULE_PARM_DESC();

static int default_norm;	/* default 0 = PAL, 1 = NTSC 2 = SECAM */
module_param(default_norm, int, 0444);
MODULE_PARM_DESC();

/* /dev/videoN, -1 for autodetect */
static int video_nr[BUZ_MAX] =;
module_param_array();
MODULE_PARM_DESC();

/* 1=Pass through TV signal when device is not used */
/* 0=Show color bar when device is not used (LML33: only if lml33dpath=1) */
int pass_through;
module_param(pass_through, int, 0644);
MODULE_PARM_DESC();

int zr36067_debug =;
module_param_named(debug, zr36067_debug, int, 0644);
MODULE_PARM_DESC();

#define ZORAN_VERSION

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

#define ZR_DEVICE(subven, subdev, data)

static const struct pci_device_id zr36067_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl);

static unsigned int zoran_num;		/* number of cards found */

/* videocodec bus functions ZR36060 */
static u32 zr36060_read(struct videocodec *codec, u16 reg)
{}

static void zr36060_write(struct videocodec *codec, u16 reg, u32 val)
{}

/* videocodec bus functions ZR36050 */
static u32 zr36050_read(struct videocodec *codec, u16 reg)
{}

static void zr36050_write(struct videocodec *codec, u16 reg, u32 val)
{}

/* videocodec bus functions ZR36016 */
static u32 zr36016_read(struct videocodec *codec, u16 reg)
{}

/* hack for in zoran_device.c */
void zr36016_write(struct videocodec *codec, u16 reg, u32 val)
{}

/*
 * Board specific information
 */

static void dc10_init(struct zoran *zr)
{}

static void dc10plus_init(struct zoran *zr)
{}

static void buz_init(struct zoran *zr)
{}

static void lml33_init(struct zoran *zr)
{}

static void avs6eyes_init(struct zoran *zr)
{}

static const char *codecid_to_modulename(u16 codecid)
{}

static int codec_init(struct zoran *zr, u16 codecid)
{}

static void codec_exit(struct zoran *zr, u16 codecid)
{}

static int videocodec_init(struct zoran *zr)
{}

static void videocodec_exit(struct zoran *zr)
{}

static const struct tvnorm f50sqpixel =;
static const struct tvnorm f60sqpixel =;
static const struct tvnorm f50ccir601 =;
static const struct tvnorm f60ccir601 =;

static const struct tvnorm f50ccir601_lml33 =;
static const struct tvnorm f60ccir601_lml33 =;

/* The DC10 (57/16/50) uses VActive as HSync, so h_start must be 0 */
static const struct tvnorm f50sqpixel_dc10 =;
static const struct tvnorm f60sqpixel_dc10 =;

/*
 * FIXME: I cannot swap U and V in saa7114, so i do one pixel left shift in zoran (75 -> 74)
 * (Maxim Yevtyushkin <[email protected]>)
 */
static const struct tvnorm f50ccir601_lm33r10 =;
static const struct tvnorm f60ccir601_lm33r10 =;

/*
 * FIXME: The ks0127 seem incapable of swapping U and V, too, which is why I copy Maxim's left
 * shift hack for the 6 Eyes.
 *
 * Christer's driver used the unshifted norms, though...
 * /Sam
 */
static const struct tvnorm f50ccir601_avs6eyes =;
static const struct tvnorm f60ccir601_avs6eyes =;

static const unsigned short vpx3220_addrs[] =;
static const unsigned short saa7110_addrs[] =;
static const unsigned short saa7111_addrs[] =;
static const unsigned short saa7114_addrs[] =;
static const unsigned short adv717x_addrs[] =;
static const unsigned short ks0127_addrs[] =;
static const unsigned short saa7185_addrs[] =;
static const unsigned short bt819_addrs[] =;
static const unsigned short bt856_addrs[] =;
static const unsigned short bt866_addrs[] =;

static struct card_info zoran_cards[NUM_CARDS] =;

/*
 * I2C functions
 */
/* software I2C functions */
static int zoran_i2c_getsda(void *data)
{}

static int zoran_i2c_getscl(void *data)
{}

static void zoran_i2c_setsda(void *data, int state)
{}

static void zoran_i2c_setscl(void *data, int state)
{}

static const struct i2c_algo_bit_data zoran_i2c_bit_data_template =;

static int zoran_register_i2c(struct zoran *zr)
{}

static void zoran_unregister_i2c(struct zoran *zr)
{}

/* Check a zoran_params struct for correctness, insert default params */
int zoran_check_jpg_settings(struct zoran *zr,
			     struct zoran_jpg_settings *settings, int try)
{}

static int zoran_init_video_device(struct zoran *zr, struct video_device *video_dev, int dir)
{}

static void zoran_exit_video_devices(struct zoran *zr)
{}

static int zoran_init_video_devices(struct zoran *zr)
{}

/*
 * v4l2_device_unregister() will care about removing zr->encoder/zr->decoder
 * via v4l2_i2c_subdev_unregister()
 */
static int zoran_i2c_init(struct zoran *zr)
{}

static void zoran_i2c_exit(struct zoran *zr)
{}

void zoran_open_init_params(struct zoran *zr)
{}

static int zr36057_init(struct zoran *zr)
{}

static void zoran_remove(struct pci_dev *pdev)
{}

void zoran_vdev_release(struct video_device *vdev)
{}

static struct videocodec_master *zoran_setup_videocodec(struct zoran *zr,
							int type)
{}

static void zoran_subdev_notify(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
{}

static int zoran_video_set_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops zoran_video_ctrl_ops =;

static int zoran_debugfs_show(struct seq_file *seq, void *v)
{}

DEFINE_SHOW_ATTRIBUTE();

/*
 *   Scan for a Buz card (actually for the PCI controller ZR36057),
 *   request the irq and map the io memory
 */
static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static struct pci_driver zoran_driver =;

module_pci_driver();