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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * device driver for Conexant 2388x based TV cards
 * driver core
 *
 * (c) 2003 Gerd Knorr <[email protected]> [SuSE Labs]
 *
 * (c) 2005-2006 Mauro Carvalho Chehab <[email protected]>
 *     - Multituner support
 *     - video_ioctl2 conversion
 *     - PAL/M fixes
 */

#include "cx88.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/pci.h>
#include <linux/delay.h>
#include <linux/videodev2.h>
#include <linux/mutex.h>

#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>

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

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

unsigned int cx88_core_debug;
module_param_named(core_debug, cx88_core_debug, int, 0644);
MODULE_PARM_DESC();

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

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

#define dprintk0(fmt, arg...)			\

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

static unsigned int cx88_devcount;
static LIST_HEAD(cx88_devlist);
static DEFINE_MUTEX(devlist);

#define NO_SYNC_LINE

/*
 * @lpi: lines per IRQ, or 0 to not generate irqs. Note: IRQ to be
 * generated _after_ lpi lines are transferred.
 */
static __le32 *cx88_risc_field(__le32 *rp, struct scatterlist *sglist,
			       unsigned int offset, u32 sync_line,
			       unsigned int bpl, unsigned int padding,
			       unsigned int lines, unsigned int lpi, bool jump)
{}

int cx88_risc_buffer(struct pci_dev *pci, struct cx88_riscmem *risc,
		     struct scatterlist *sglist,
		     unsigned int top_offset, unsigned int bottom_offset,
		     unsigned int bpl, unsigned int padding, unsigned int lines)
{}
EXPORT_SYMBOL();

int cx88_risc_databuffer(struct pci_dev *pci, struct cx88_riscmem *risc,
			 struct scatterlist *sglist, unsigned int bpl,
			 unsigned int lines, unsigned int lpi)
{}
EXPORT_SYMBOL();

/*
 * our SRAM memory layout
 */

/*
 * we are going to put all thr risc programs into host memory, so we
 * can use the whole SDRAM for the DMA fifos.  To simplify things, we
 * use a static memory layout.  That surely will waste memory in case
 * we don't use all DMA channels at the same time (which will be the
 * case most of the time).  But that still gives us enough FIFO space
 * to be able to deal with insane long pci latencies ...
 *
 * FIFO space allocations:
 *    channel  21    (y video)  - 10.0k
 *    channel  22    (u video)  -  2.0k
 *    channel  23    (v video)  -  2.0k
 *    channel  24    (vbi)      -  4.0k
 *    channels 25+26 (audio)    -  4.0k
 *    channel  28    (mpeg)     -  4.0k
 *    channel  27    (audio rds)-  3.0k
 *    TOTAL                     = 29.0k
 *
 * Every channel has 160 bytes control data (64 bytes instruction
 * queue and 6 CDT entries), which is close to 2k total.
 *
 * Address layout:
 *    0x0000 - 0x03ff    CMDs / reserved
 *    0x0400 - 0x0bff    instruction queues + CDs
 *    0x0c00 -           FIFOs
 */

const struct sram_channel cx88_sram_channels[] =;
EXPORT_SYMBOL();

int cx88_sram_channel_setup(struct cx88_core *core,
			    const struct sram_channel *ch,
			    unsigned int bpl, u32 risc)
{}
EXPORT_SYMBOL();

/* ------------------------------------------------------------------ */
/* debug helper code                                                  */

static int cx88_risc_decode(u32 risc)
{}

void cx88_sram_channel_dump(struct cx88_core *core,
			    const struct sram_channel *ch)
{}
EXPORT_SYMBOL();

static const char *cx88_pci_irqs[32] =;

void cx88_print_irqbits(const char *tag, const char *strings[],
			int len, u32 bits, u32 mask)
{}
EXPORT_SYMBOL();

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

int cx88_core_irq(struct cx88_core *core, u32 status)
{}
EXPORT_SYMBOL();

void cx88_wakeup(struct cx88_core *core,
		 struct cx88_dmaqueue *q, u32 count)
{}
EXPORT_SYMBOL();

void cx88_shutdown(struct cx88_core *core)
{}
EXPORT_SYMBOL();

int cx88_reset(struct cx88_core *core)
{}
EXPORT_SYMBOL();

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

static inline unsigned int norm_swidth(v4l2_std_id norm)
{}

static inline unsigned int norm_hdelay(v4l2_std_id norm)
{}

static inline unsigned int norm_vdelay(v4l2_std_id norm)
{}

static inline unsigned int norm_fsc8(v4l2_std_id norm)
{}

static inline unsigned int norm_htotal(v4l2_std_id norm)
{}

static inline unsigned int norm_vbipack(v4l2_std_id norm)
{}

int cx88_set_scale(struct cx88_core *core, unsigned int width,
		   unsigned int height, enum v4l2_field field)
{}
EXPORT_SYMBOL();

static const u32 xtal =;

static int set_pll(struct cx88_core *core, int prescale, u32 ofreq)
{}

int cx88_start_audio_dma(struct cx88_core *core)
{}

int cx88_stop_audio_dma(struct cx88_core *core)
{}

static int set_tvaudio(struct cx88_core *core)
{}

int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm)
{}
EXPORT_SYMBOL();

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

void cx88_vdev_init(struct cx88_core *core,
		    struct pci_dev *pci,
		    struct video_device *vfd,
		    const struct video_device *template_,
		    const char *type)
{}
EXPORT_SYMBOL();

struct cx88_core *cx88_core_get(struct pci_dev *pci)
{}
EXPORT_SYMBOL();

void cx88_core_put(struct cx88_core *core, struct pci_dev *pci)
{}
EXPORT_SYMBOL();