linux/drivers/media/pci/saa7134/saa7134-core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 * device driver for philips saa7134 based TV cards
 * driver core
 *
 * (c) 2001-03 Gerd Knorr <[email protected]> [SuSE Labs]
 */

#include "saa7134.h"
#include "saa7134-reg.h"

#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/kmod.h>
#include <linux/sound.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/dma-mapping.h>
#include <linux/pm.h>

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


/* ------------------------------------------------------------------ */

static unsigned int irq_debug;
module_param(irq_debug, int, 0644);
MODULE_PARM_DESC();

static unsigned int core_debug;
module_param(core_debug, int, 0644);
MODULE_PARM_DESC();

static unsigned int gpio_tracking;
module_param(gpio_tracking, int, 0644);
MODULE_PARM_DESC();

static unsigned int alsa =;
module_param(alsa, int, 0644);
MODULE_PARM_DESC();

static unsigned int latency =;
module_param(latency, int, 0444);
MODULE_PARM_DESC();

bool saa7134_userptr;
module_param(saa7134_userptr, bool, 0644);
MODULE_PARM_DESC();

static unsigned int video_nr[] =;
static unsigned int vbi_nr[]   =;
static unsigned int radio_nr[] =;
static unsigned int tuner[]    =;
static unsigned int card[]     =;


module_param_array();
module_param_array();
module_param_array();
module_param_array();
module_param_array();

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

DEFINE_MUTEX();
EXPORT_SYMBOL();
LIST_HEAD();
EXPORT_SYMBOL();
static LIST_HEAD(mops_list);
static unsigned int saa7134_devcount;

int (*saa7134_dmasound_init)(struct saa7134_dev *dev);
int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);

#define core_dbg(fmt, arg...)

#define irq_dbg(level, fmt, arg...)

void saa7134_track_gpio(struct saa7134_dev *dev, const char *msg)
{}

void saa7134_set_gpio(struct saa7134_dev *dev, int bit_no, int value)
{}

/* ------------------------------------------------------------------ */


/* ----------------------------------------------------------- */
/* delayed request_module                                      */

#if defined(CONFIG_MODULES) && defined(MODULE)

static void request_module_async(struct work_struct *work){
	struct saa7134_dev* dev = container_of(work, struct saa7134_dev, request_module_wk);
	if (card_is_empress(dev))
		request_module("saa7134-empress");
	if (card_is_dvb(dev))
		request_module("saa7134-dvb");
	if (card_is_go7007(dev))
		request_module("saa7134-go7007");
	if (alsa) {
		if (dev->pci->device != PCI_DEVICE_ID_PHILIPS_SAA7130)
			request_module("saa7134-alsa");
	}
}

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

static void flush_request_submodules(struct saa7134_dev *dev)
{
	flush_work(&dev->request_module_wk);
}

#else
#define request_submodules(dev)
#define flush_request_submodules(dev)
#endif /* CONFIG_MODULES */

/* ------------------------------------------------------------------ */

/* nr of (saa7134-)pages for the given buffer size */
static int saa7134_buffer_pages(int size)
{}

/* calc max # of buffers from size (must not exceed the 4MB virtual
 * address space per DMA channel) */
int saa7134_buffer_count(unsigned int size, unsigned int count)
{}

int saa7134_buffer_startpage(struct saa7134_buf *buf)
{}

unsigned long saa7134_buffer_base(struct saa7134_buf *buf)
{}

/* ------------------------------------------------------------------ */

int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt)
{}

int saa7134_pgtable_build(struct pci_dev *pci, struct saa7134_pgtable *pt,
			  struct scatterlist *list, unsigned int length,
			  unsigned int startpage)
{}

void saa7134_pgtable_free(struct pci_dev *pci, struct saa7134_pgtable *pt)
{}

/* ------------------------------------------------------------------ */

int saa7134_buffer_queue(struct saa7134_dev *dev,
			 struct saa7134_dmaqueue *q,
			 struct saa7134_buf *buf)
{}

void saa7134_buffer_finish(struct saa7134_dev *dev,
			   struct saa7134_dmaqueue *q,
			   unsigned int state)
{}

void saa7134_buffer_next(struct saa7134_dev *dev,
			 struct saa7134_dmaqueue *q)
{}

void saa7134_buffer_timeout(struct timer_list *t)
{}

void saa7134_stop_streaming(struct saa7134_dev *dev, struct saa7134_dmaqueue *q)
{}
EXPORT_SYMBOL_GPL();

/* ------------------------------------------------------------------ */

int saa7134_set_dmabits(struct saa7134_dev *dev)
{}

/* ------------------------------------------------------------------ */
/* IRQ handler + helpers                                              */

static char *irqbits[] =;
#define IRQBITS

static void print_irqstatus(struct saa7134_dev *dev, int loop,
			    unsigned long report, unsigned long status)
{}

static irqreturn_t saa7134_irq(int irq, void *dev_id)
{}

/* ------------------------------------------------------------------ */

/* early init (no i2c, no irq) */

static int saa7134_hw_enable1(struct saa7134_dev *dev)
{}

static int saa7134_hwinit1(struct saa7134_dev *dev)
{}

/* late init (with i2c + irq) */
static int saa7134_hw_enable2(struct saa7134_dev *dev)
{}

static int saa7134_hwinit2(struct saa7134_dev *dev)
{}


/* shutdown */
static int saa7134_hwfini(struct saa7134_dev *dev)
{}

static void must_configure_manually(int has_eeprom)
{}

static void saa7134_unregister_media_device(struct saa7134_dev *dev)
{}

static void saa7134_media_release(struct saa7134_dev *dev)
{}

#if defined(CONFIG_MEDIA_CONTROLLER)
static void saa7134_create_entities(struct saa7134_dev *dev)
{}
#endif

static struct video_device *vdev_init(struct saa7134_dev *dev,
				      struct video_device *template,
				      char *type)
{}

static void saa7134_unregister_video(struct saa7134_dev *dev)
{}

static void mpeg_ops_attach(struct saa7134_mpeg_ops *ops,
			    struct saa7134_dev *dev)
{}

static void mpeg_ops_detach(struct saa7134_mpeg_ops *ops,
			    struct saa7134_dev *dev)
{}

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

static void saa7134_finidev(struct pci_dev *pci_dev)
{}

/* resends a current buffer in queue after resume */
static int __maybe_unused saa7134_buffer_requeue(struct saa7134_dev *dev,
						 struct saa7134_dmaqueue *q)
{}

static int __maybe_unused saa7134_suspend(struct device *dev_d)
{}

static int __maybe_unused saa7134_resume(struct device *dev_d)
{}

/* ----------------------------------------------------------- */

int saa7134_ts_register(struct saa7134_mpeg_ops *ops)
{}

void saa7134_ts_unregister(struct saa7134_mpeg_ops *ops)
{}

EXPORT_SYMBOL();
EXPORT_SYMBOL();

/* ----------------------------------------------------------- */

static SIMPLE_DEV_PM_OPS(saa7134_pm_ops, saa7134_suspend, saa7134_resume);

static struct pci_driver saa7134_pci_driver =;

static int __init saa7134_init(void)
{}

static void __exit saa7134_fini(void)
{}

module_init();
module_exit(saa7134_fini);

/* ----------------------------------------------------------- */

EXPORT_SYMBOL();
EXPORT_SYMBOL();

/* ----------------- for the DMA sound modules --------------- */

EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();