linux/drivers/media/pci/cx18/cx18-driver.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  cx18 driver initialization and card probing
 *
 *  Derived from ivtv-driver.c
 *
 *  Copyright (C) 2007  Hans Verkuil <[email protected]>
 *  Copyright (C) 2008  Andy Walls <[email protected]>
 */

#include "cx18-driver.h"
#include "cx18-io.h"
#include "cx18-version.h"
#include "cx18-cards.h"
#include "cx18-i2c.h"
#include "cx18-irq.h"
#include "cx18-gpio.h"
#include "cx18-firmware.h"
#include "cx18-queue.h"
#include "cx18-streams.h"
#include "cx18-av-core.h"
#include "cx18-scb.h"
#include "cx18-mailbox.h"
#include "cx18-ioctl.h"
#include "cx18-controls.h"
#include "xc2028.h"
#include <linux/dma-mapping.h>
#include <media/tveeprom.h>

/* If you have already X v4l cards, then set this to X. This way
   the device numbers stay matched. Example: you have a WinTV card
   without radio and a Compro H900 with. Normally this would give a
   video1 device together with a radio0 device for the Compro. By
   setting this to 1 you ensure that radio0 is now also radio1. */
int cx18_first_minor;

/* Callback for registering extensions */
int (*cx18_ext_init)(struct cx18 *);
EXPORT_SYMBOL();

/* add your revision and whatnot here */
static const struct pci_device_id cx18_pci_tbl[] =;

MODULE_DEVICE_TABLE(pci, cx18_pci_tbl);

static atomic_t cx18_instance =;

/* Parameter declarations */
static int cardtype[CX18_MAX_CARDS];
static int tuner[CX18_MAX_CARDS] =;
static int radio[CX18_MAX_CARDS] =;
static unsigned cardtype_c =;
static unsigned tuner_c =;
static unsigned radio_c =;
static char pal[] =;
static char secam[] =;
static char ntsc[] =;

/* Buffers */
static int enc_ts_buffers =;
static int enc_mpg_buffers =;
static int enc_idx_buffers =;
static int enc_yuv_buffers =;
static int enc_vbi_buffers =;
static int enc_pcm_buffers =;

static int enc_ts_bufsize =;
static int enc_mpg_bufsize =;
static int enc_idx_bufsize =;
static int enc_yuv_bufsize =;
static int enc_pcm_bufsize =;

static int enc_ts_bufs =;
static int enc_mpg_bufs =;
static int enc_idx_bufs =;
static int enc_yuv_bufs =;
static int enc_vbi_bufs =;
static int enc_pcm_bufs =;


static int cx18_pci_latency =;

static int mmio_ndelay;
static int retry_mmio =;

int cx18_debug;

module_param_array();
module_param_array();
module_param_array();
module_param_string();
module_param_string();
module_param_string();
module_param_named(debug, cx18_debug, int, 0644);
module_param(mmio_ndelay, int, 0644);
module_param(retry_mmio, int, 0644);
module_param(cx18_pci_latency, int, 0644);
module_param(cx18_first_minor, int, 0644);

module_param(enc_ts_buffers, int, 0644);
module_param(enc_mpg_buffers, int, 0644);
module_param(enc_idx_buffers, int, 0644);
module_param(enc_yuv_buffers, int, 0644);
module_param(enc_vbi_buffers, int, 0644);
module_param(enc_pcm_buffers, int, 0644);

module_param(enc_ts_bufsize, int, 0644);
module_param(enc_mpg_bufsize, int, 0644);
module_param(enc_idx_bufsize, int, 0644);
module_param(enc_yuv_bufsize, int, 0644);
module_param(enc_pcm_bufsize, int, 0644);

module_param(enc_ts_bufs, int, 0644);
module_param(enc_mpg_bufs, int, 0644);
module_param(enc_idx_bufs, int, 0644);
module_param(enc_yuv_bufs, int, 0644);
module_param(enc_vbi_bufs, int, 0644);
module_param(enc_pcm_bufs, int, 0644);

MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();

MODULE_PARM_DESC();

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

MODULE_VERSION();

#if defined(CONFIG_MODULES) && defined(MODULE)
static void request_module_async(struct work_struct *work)
{
	struct cx18 *dev = container_of(work, struct cx18, request_module_wk);

	/* Make sure cx18-alsa module is loaded */
	request_module("cx18-alsa");

	/* Initialize cx18-alsa for this instance of the cx18 device */
	if (cx18_ext_init)
		cx18_ext_init(dev);
}

static void request_modules(struct cx18 *dev)
{
	INIT_WORK(&dev->request_module_wk, request_module_async);
	schedule_work(&dev->request_module_wk);
}

static void flush_request_modules(struct cx18 *dev)
{
	flush_work(&dev->request_module_wk);
}
#else
#define request_modules(dev)
#define flush_request_modules(dev)
#endif /* CONFIG_MODULES */

/* Generic utility functions */
int cx18_msleep_timeout(unsigned int msecs, int intr)
{}

/* Release ioremapped memory */
static void cx18_iounmap(struct cx18 *cx)
{}

static void cx18_eeprom_dump(struct cx18 *cx, unsigned char *eedata, int len)
{}

/* Hauppauge card? get values from tveeprom */
void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv)
{}

static void cx18_process_eeprom(struct cx18 *cx)
{}

static v4l2_std_id cx18_parse_std(struct cx18 *cx)
{}

static void cx18_process_options(struct cx18 *cx)
{}

static int cx18_create_in_workq(struct cx18 *cx)
{}

static void cx18_init_in_work_orders(struct cx18 *cx)
{}

/* Precondition: the cx18 structure has been memset to 0. Only
   the dev and instance fields have been filled in.
   No assumptions on the card type may be made here (see cx18_init_struct2
   for that).
 */
static int cx18_init_struct1(struct cx18 *cx)
{}

/* Second initialization part. Here the card type has been
   autodetected. */
static void cx18_init_struct2(struct cx18 *cx)
{}

static int cx18_setup_pci(struct cx18 *cx, struct pci_dev *pci_dev,
			  const struct pci_device_id *pci_id)
{}

static void cx18_init_subdevs(struct cx18 *cx)
{}

static int cx18_probe(struct pci_dev *pci_dev,
		      const struct pci_device_id *pci_id)
{}

int cx18_init_on_first_open(struct cx18 *cx)
{}

static void cx18_cancel_in_work_orders(struct cx18 *cx)
{}

static void cx18_cancel_out_work_orders(struct cx18 *cx)
{}

static void cx18_remove(struct pci_dev *pci_dev)
{}


/* define a pci_driver for card detection */
static struct pci_driver cx18_pci_driver =;

static int __init module_start(void)
{}

static void __exit module_cleanup(void)
{}

module_init();
module_exit(module_cleanup);
MODULE_FIRMWARE();