linux/drivers/media/pci/cx25821/cx25821-alsa.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  Driver for the Conexant CX25821 PCIe bridge
 *
 *  Copyright (C) 2009 Conexant Systems Inc.
 *  Authors  <[email protected]>, <[email protected]>
 *	Based on SAA713x ALSA driver and CX88 driver
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/vmalloc.h>
#include <linux/dma-mapping.h>
#include <linux/pci.h>
#include <linux/slab.h>

#include <linux/delay.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/control.h>
#include <sound/initval.h>
#include <sound/tlv.h>

#include "cx25821.h"
#include "cx25821-reg.h"

#define AUDIO_SRAM_CHANNEL

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

/****************************************************************************
	Data type declarations - Can be moded to a header file later
 ****************************************************************************/

static int devno;

struct cx25821_audio_buffer {};

struct cx25821_audio_dev {};


/****************************************************************************
			Module global static vars
 ****************************************************************************/

static int index[SNDRV_CARDS] =;	/* Index 0-MAX */
static char *id[SNDRV_CARDS] =;	/* ID for this card */
static bool enable[SNDRV_CARDS] =;

module_param_array();
MODULE_PARM_DESC();

module_param_array();
MODULE_PARM_DESC();

/****************************************************************************
				Module macros
 ****************************************************************************/

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

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

/****************************************************************************
			Module specific functions
 ****************************************************************************/
/* Constants taken from cx88-reg.h */
#define AUD_INT_DN_RISCI1
#define AUD_INT_UP_RISCI1
#define AUD_INT_RDS_DN_RISCI1
#define AUD_INT_DN_RISCI2
#define AUD_INT_UP_RISCI2
#define AUD_INT_RDS_DN_RISCI2
#define AUD_INT_DN_SYNC
#define AUD_INT_UP_SYNC
#define AUD_INT_RDS_DN_SYNC
#define AUD_INT_OPC_ERR
#define AUD_INT_BER_IRQ
#define AUD_INT_MCHG_IRQ
#define GP_COUNT_CONTROL_RESET

#define PCI_MSK_AUD_EXT
#define PCI_MSK_AUD_INT

static int cx25821_alsa_dma_init(struct cx25821_audio_dev *chip,
				 unsigned long nr_pages)
{}

static int cx25821_alsa_dma_map(struct cx25821_audio_dev *dev)
{}

static int cx25821_alsa_dma_unmap(struct cx25821_audio_dev *dev)
{}

static int cx25821_alsa_dma_free(struct cx25821_audio_buffer *buf)
{}

/*
 * BOARD Specific: Sets audio DMA
 */

static int _cx25821_start_audio_dma(struct cx25821_audio_dev *chip)
{}

/*
 * BOARD Specific: Resets audio DMA
 */
static int _cx25821_stop_audio_dma(struct cx25821_audio_dev *chip)
{}

#define MAX_IRQ_LOOP

/*
 * BOARD Specific: IRQ dma bits
 */
static char *cx25821_aud_irqs[32] =;

/*
 * BOARD Specific: Threats IRQ audio specific calls
 */
static void cx25821_aud_irq(struct cx25821_audio_dev *chip, u32 status,
			    u32 mask)
{}

/*
 * BOARD Specific: Handles IRQ calls
 */
static irqreturn_t cx25821_irq(int irq, void *dev_id)
{}

static int dsp_buffer_free(struct cx25821_audio_dev *chip)
{}

/****************************************************************************
				ALSA PCM Interface
 ****************************************************************************/

/*
 * Digital hardware definition
 */
#define DEFAULT_FIFO_SIZE
static const struct snd_pcm_hardware snd_cx25821_digital_hw =;

/*
 * audio pcm capture open callback
 */
static int snd_cx25821_pcm_open(struct snd_pcm_substream *substream)
{}

/*
 * audio close callback
 */
static int snd_cx25821_close(struct snd_pcm_substream *substream)
{}

/*
 * hw_params callback
 */
static int snd_cx25821_hw_params(struct snd_pcm_substream *substream,
				 struct snd_pcm_hw_params *hw_params)
{}

/*
 * hw free callback
 */
static int snd_cx25821_hw_free(struct snd_pcm_substream *substream)
{}

/*
 * prepare callback
 */
static int snd_cx25821_prepare(struct snd_pcm_substream *substream)
{}

/*
 * trigger callback
 */
static int snd_cx25821_card_trigger(struct snd_pcm_substream *substream,
				    int cmd)
{}

/*
 * pointer callback
 */
static snd_pcm_uframes_t snd_cx25821_pointer(struct snd_pcm_substream
					     *substream)
{}

/*
 * page callback (needed for mmap)
 */
static struct page *snd_cx25821_page(struct snd_pcm_substream *substream,
				     unsigned long offset)
{}

/*
 * operators
 */
static const struct snd_pcm_ops snd_cx25821_pcm_ops =;

/*
 * ALSA create a PCM device:  Called when initializing the board.
 * Sets up the name and hooks up the callbacks
 */
static int snd_cx25821_pcm(struct cx25821_audio_dev *chip, int device,
			   char *name)
{}

/****************************************************************************
			Basic Flow for Sound Devices
 ****************************************************************************/

/*
 * PCI ID Table - 14f1:8801 and 14f1:8811 means function 1: Audio
 * Only boards with eeprom and byte 1 at eeprom=1 have it
 */

static const struct pci_device_id __maybe_unused cx25821_audio_pci_tbl[] =;

MODULE_DEVICE_TABLE(pci, cx25821_audio_pci_tbl);

/*
 * Alsa Constructor - Component probe
 */
static int cx25821_audio_initdev(struct cx25821_dev *dev)
{}

/****************************************************************************
				LINUX MODULE INIT
 ****************************************************************************/

static int cx25821_alsa_exit_callback(struct device *dev, void *data)
{}

static void cx25821_audio_fini(void)
{}

static int cx25821_alsa_init_callback(struct device *dev, void *data)
{}

/*
 * Module initializer
 *
 * Loops through present saa7134 cards, and assigns an ALSA device
 * to each one
 *
 */
static int cx25821_alsa_init(void)
{}

late_initcall(cx25821_alsa_init);
module_exit(cx25821_audio_fini);