linux/sound/pci/pcxhr/pcxhr.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for Digigram pcxhr compatible soundcards
 *
 * main file with alsa callbacks
 *
 * Copyright (c) 2004 by Digigram <[email protected]>
 */


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

#include <sound/core.h>
#include <sound/initval.h>
#include <sound/info.h>
#include <sound/control.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include "pcxhr.h"
#include "pcxhr_mixer.h"
#include "pcxhr_hwdep.h"
#include "pcxhr_core.h"
#include "pcxhr_mix22.h"

#define DRIVER_NAME

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

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

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

enum {};

static const struct pci_device_id pcxhr_ids[] =;

MODULE_DEVICE_TABLE(pci, pcxhr_ids);

struct board_parameters {};
static const struct board_parameters pcxhr_board_params[] =;

/* boards without hw AES1 and SRC onboard are all using fw_file_set==4 */
/* VX222HR, VX222e, PCX22HR and PCX22e */
#define PCXHR_BOARD_HAS_AES1(x)
/* some boards do not support 192kHz on digital AES input plugs */
#define PCXHR_BOARD_AESIN_NO_192K(x)

static int pcxhr_pll_freq_register(unsigned int freq, unsigned int* pllreg,
				   unsigned int* realfreq)
{}


#define PCXHR_FREQ_REG_MASK
#define PCXHR_FREQ_QUARTZ_48000
#define PCXHR_FREQ_QUARTZ_24000
#define PCXHR_FREQ_QUARTZ_12000
#define PCXHR_FREQ_QUARTZ_32000
#define PCXHR_FREQ_QUARTZ_16000
#define PCXHR_FREQ_QUARTZ_8000
#define PCXHR_FREQ_QUARTZ_44100
#define PCXHR_FREQ_QUARTZ_22050
#define PCXHR_FREQ_QUARTZ_11025
#define PCXHR_FREQ_PLL
#define PCXHR_FREQ_QUARTZ_192000
#define PCXHR_FREQ_QUARTZ_96000
#define PCXHR_FREQ_QUARTZ_176400
#define PCXHR_FREQ_QUARTZ_88200
#define PCXHR_FREQ_QUARTZ_128000
#define PCXHR_FREQ_QUARTZ_64000

#define PCXHR_FREQ_WORD_CLOCK
#define PCXHR_FREQ_SYNC_AES
#define PCXHR_FREQ_AES_1
#define PCXHR_FREQ_AES_2
#define PCXHR_FREQ_AES_3
#define PCXHR_FREQ_AES_4

static int pcxhr_get_clock_reg(struct pcxhr_mgr *mgr, unsigned int rate,
			       unsigned int *reg, unsigned int *freq)
{}


static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr,
			       unsigned int rate,
			       int *changed)
{}

#define PCXHR_MODIFY_CLOCK_S_BIT

#define PCXHR_IRQ_TIMER_FREQ
#define PCXHR_IRQ_TIMER_PERIOD

int pcxhr_set_clock(struct pcxhr_mgr *mgr, unsigned int rate)
{}


static int pcxhr_sub_get_external_clock(struct pcxhr_mgr *mgr,
					enum pcxhr_clock_type clock_type,
					int *sample_rate)
{}


int pcxhr_get_external_clock(struct pcxhr_mgr *mgr,
			     enum pcxhr_clock_type clock_type,
			     int *sample_rate)
{}

/*
 *  start or stop playback/capture substream
 */
static int pcxhr_set_stream_state(struct snd_pcxhr *chip,
				  struct pcxhr_stream *stream)
{}

#define HEADER_FMT_BASE_LIN
#define HEADER_FMT_BASE_FLOAT
#define HEADER_FMT_INTEL
#define HEADER_FMT_24BITS
#define HEADER_FMT_16BITS
#define HEADER_FMT_UPTO11
#define HEADER_FMT_UPTO32
#define HEADER_FMT_MONO

static int pcxhr_set_format(struct pcxhr_stream *stream)
{}

static int pcxhr_update_r_buffer(struct pcxhr_stream *stream)
{}


#if 0
static int pcxhr_pipe_sample_count(struct pcxhr_stream *stream,
				   snd_pcm_uframes_t *sample_count)
{
	struct pcxhr_rmh rmh;
	int err;
	pcxhr_t *chip = snd_pcm_substream_chip(stream->substream);
	pcxhr_init_rmh(&rmh, CMD_PIPE_SAMPLE_COUNT);
	pcxhr_set_pipe_cmd_params(&rmh, stream->pipe->is_capture, 0, 0,
				  1<<stream->pipe->first_audio);
	err = pcxhr_send_msg(chip->mgr, &rmh);
	if (err == 0) {
		*sample_count = ((snd_pcm_uframes_t)rmh.stat[0]) << 24;
		*sample_count += (snd_pcm_uframes_t)rmh.stat[1];
	}
	dev_dbg(chip->card->dev, "PIPE_SAMPLE_COUNT = %lx\n", *sample_count);
	return err;
}
#endif

static inline int pcxhr_stream_scheduled_get_pipe(struct pcxhr_stream *stream,
						  struct pcxhr_pipe **pipe)
{}

static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr)
{}


/*
 *  trigger callback
 */
static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
{}


static int pcxhr_hardware_timer(struct pcxhr_mgr *mgr, int start)
{}

/*
 *  prepare callback for all pcms
 */
static int pcxhr_prepare(struct snd_pcm_substream *subs)
{}


/*
 *  HW_PARAMS callback for all pcms
 */
static int pcxhr_hw_params(struct snd_pcm_substream *subs,
			   struct snd_pcm_hw_params *hw)
{}


/*
 *  CONFIGURATION SPACE for all pcms, mono pcm must update channels_max
 */
static const struct snd_pcm_hardware pcxhr_caps =;


static int pcxhr_open(struct snd_pcm_substream *subs)
{}


static int pcxhr_close(struct snd_pcm_substream *subs)
{}


static snd_pcm_uframes_t pcxhr_stream_pointer(struct snd_pcm_substream *subs)
{}


static const struct snd_pcm_ops pcxhr_ops =;

/*
 */
int pcxhr_create_pcm(struct snd_pcxhr *chip)
{}

static int pcxhr_chip_free(struct snd_pcxhr *chip)
{}

static int pcxhr_chip_dev_free(struct snd_device *device)
{}


/*
 */
static int pcxhr_create(struct pcxhr_mgr *mgr,
			struct snd_card *card, int idx)
{}

/* proc interface */
static void pcxhr_proc_info(struct snd_info_entry *entry,
			    struct snd_info_buffer *buffer)
{}
static void pcxhr_proc_sync(struct snd_info_entry *entry,
			    struct snd_info_buffer *buffer)
{}

static void pcxhr_proc_gpio_read(struct snd_info_entry *entry,
				 struct snd_info_buffer *buffer)
{}
static void pcxhr_proc_gpo_write(struct snd_info_entry *entry,
				 struct snd_info_buffer *buffer)
{}

/* Access to the results of the CMD_GET_TIME_CODE RMH */
#define TIME_CODE_VALID_MASK
#define TIME_CODE_NEW_MASK
#define TIME_CODE_BACK_MASK
#define TIME_CODE_WAIT_MASK

/* Values for the CMD_MANAGE_SIGNAL RMH */
#define MANAGE_SIGNAL_TIME_CODE
#define MANAGE_SIGNAL_MIDI

/* linear time code read proc*/
static void pcxhr_proc_ltc(struct snd_info_entry *entry,
			   struct snd_info_buffer *buffer)
{}

static void pcxhr_proc_init(struct snd_pcxhr *chip)
{}
/* end of proc interface */

/*
 * release all the cards assigned to a manager instance
 */
static int pcxhr_free(struct pcxhr_mgr *mgr)
{}

/*
 *    probe function - creates the card manager
 */
static int pcxhr_probe(struct pci_dev *pci,
		       const struct pci_device_id *pci_id)
{}

static void pcxhr_remove(struct pci_dev *pci)
{}

static struct pci_driver pcxhr_driver =;

module_pci_driver();