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

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ngene.c: nGene PCIe bridge driver
 *
 * Copyright (C) 2005-2007 Micronas
 *
 * Copyright (C) 2008-2009 Ralph Metzler <[email protected]>
 *                         Modifications for new nGene firmware,
 *                         support for EEPROM-copying,
 *                         support for new dual DVB-S2 card prototype
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/poll.h>
#include <linux/io.h>
#include <asm/div64.h>
#include <linux/pci.h>
#include <linux/timer.h>
#include <linux/byteorder/generic.h>
#include <linux/firmware.h>
#include <linux/vmalloc.h>

#include "ngene.h"

static int one_adapter;
module_param(one_adapter, int, 0444);
MODULE_PARM_DESC();

static int shutdown_workaround;
module_param(shutdown_workaround, int, 0644);
MODULE_PARM_DESC();

static int debug;
module_param(debug, int, 0444);
MODULE_PARM_DESC();

DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);

#define ngwriteb(dat, adr)
#define ngwritel(dat, adr)
#define ngwriteb(dat, adr)
#define ngreadl(adr)
#define ngreadb(adr)
#define ngcpyto(adr, src, count)
#define ngcpyfrom(dst, adr, count)

/****************************************************************************/
/* nGene interrupt handler **************************************************/
/****************************************************************************/

static void event_bh_work(struct work_struct *t)
{}

static void demux_bh_work(struct work_struct *t)
{}

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

/****************************************************************************/
/* nGene command interface **************************************************/
/****************************************************************************/

static void dump_command_io(struct ngene *dev)
{}

static int ngene_command_mutex(struct ngene *dev, struct ngene_command *com)
{}

int ngene_command(struct ngene *dev, struct ngene_command *com)
{}


static int ngene_command_load_firmware(struct ngene *dev,
				       u8 *ngene_fw, u32 size)
{}


static int ngene_command_config_buf(struct ngene *dev, u8 config)
{}

static int ngene_command_config_free_buf(struct ngene *dev, u8 *config)
{}

int ngene_command_gpio_set(struct ngene *dev, u8 select, u8 level)
{}


/*
 02000640 is sample on rising edge.
 02000740 is sample on falling edge.
 02000040 is ignore "valid" signal

 0: FD_CTL1 Bit 7,6 must be 0,1
    7   disable(fw controlled)
    6   0-AUX,1-TS
    5   0-par,1-ser
    4   0-lsb/1-msb
    3,2 reserved
    1,0 0-no sync, 1-use ext. start, 2-use 0x47, 3-both
 1: FD_CTL2 has 3-valid must be hi, 2-use valid, 1-edge
 2: FD_STA is read-only. 0-sync
 3: FD_INSYNC is number of 47s to trigger "in sync".
 4: FD_OUTSYNC is number of 47s to trigger "out of sync".
 5: FD_MAXBYTE1 is low-order of bytes per packet.
 6: FD_MAXBYTE2 is high-order of bytes per packet.
 7: Top byte is unused.
*/

/****************************************************************************/

static u8 TSFeatureDecoderSetup[8 * 5] =;

/* Set NGENE I2S Config to 16 bit packed */
static u8 I2SConfiguration[] =;

static u8 SPDIFConfiguration[10] =;

/* Set NGENE I2S Config to transport stream compatible mode */

static u8 TS_I2SConfiguration[4] =;

static u8 TS_I2SOutConfiguration[4] =;

static u8 ITUDecoderSetup[4][16] =;

/*
 * 50 48 60 gleich
 * 27p50 9f 00 22 80 42 69 18 ...
 * 27p60 93 00 22 80 82 69 1c ...
 */

/* Maxbyte to 1144 (for raw data) */
static u8 ITUFeatureDecoderSetup[8] =;

void FillTSBuffer(void *Buffer, int Length, u32 Flags)
{}


static void flush_buffers(struct ngene_channel *chan)
{}

static void clear_buffers(struct ngene_channel *chan)
{}

static int ngene_command_stream_control(struct ngene *dev, u8 stream,
					u8 control, u8 mode, u8 flags)
{}

void set_transfer(struct ngene_channel *chan, int state)
{}


/****************************************************************************/
/* nGene hardware init and release functions ********************************/
/****************************************************************************/

static void free_ringbuffer(struct ngene *dev, struct SRingBufferDescriptor *rb)
{}

static void free_idlebuffer(struct ngene *dev,
		     struct SRingBufferDescriptor *rb,
		     struct SRingBufferDescriptor *tb)
{}

static void free_common_buffers(struct ngene *dev)
{}

/****************************************************************************/
/* Ring buffer handling *****************************************************/
/****************************************************************************/

static int create_ring_buffer(struct pci_dev *pci_dev,
		       struct SRingBufferDescriptor *descr, u32 NumBuffers)
{}

static int AllocateRingBuffers(struct pci_dev *pci_dev,
			       dma_addr_t of,
			       struct SRingBufferDescriptor *pRingBuffer,
			       u32 Buffer1Length, u32 Buffer2Length)
{}

static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer,
			    struct SRingBufferDescriptor *pRingBuffer)
{}

static u32 RingBufferSizes[MAX_STREAM] =;

static u32 Buffer1Sizes[MAX_STREAM] =;

static u32 Buffer2Sizes[MAX_STREAM] =;


static int AllocCommonBuffers(struct ngene *dev)
{}

static void ngene_release_buffers(struct ngene *dev)
{}

static int ngene_get_buffers(struct ngene *dev)
{}

static void ngene_init(struct ngene *dev)
{}

static int ngene_load_firm(struct ngene *dev)
{}

static void ngene_stop(struct ngene *dev)
{}

static int ngene_buffer_config(struct ngene *dev)
{}


static int ngene_start(struct ngene *dev)
{}

/****************************************************************************/
/****************************************************************************/
/****************************************************************************/

static void release_channel(struct ngene_channel *chan)
{}

static int init_channel(struct ngene_channel *chan)
{}

static int init_channels(struct ngene *dev)
{}

static const struct cxd2099_cfg cxd_cfgtmpl =;

static void cxd_attach(struct ngene *dev)
{}

static void cxd_detach(struct ngene *dev)
{}

/***********************************/
/* workaround for shutdown failure */
/***********************************/

static void ngene_unlink(struct ngene *dev)
{}

void ngene_shutdown(struct pci_dev *pdev)
{}

/****************************************************************************/
/* device probe/remove calls ************************************************/
/****************************************************************************/

void ngene_remove(struct pci_dev *pdev)
{}

int ngene_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
{}