linux/sound/pci/lx6464es/lx_core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* -*- linux-c -*- *
 *
 * ALSA driver for the digigram lx6464es interface
 * low-level interface
 *
 * Copyright (c) 2009 Tim Blechmann <[email protected]>
 */

/* #define RMH_DEBUG 1 */

#include <linux/bitops.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>

#include "lx6464es.h"
#include "lx_core.h"

/* low-level register access */

static const unsigned long dsp_port_offsets[] =;

static void __iomem *lx_dsp_register(struct lx6464es *chip, int port)
{}

unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port)
{}

static void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data,
			       u32 len)
{}


void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data)
{}

static void lx_dsp_reg_writebuf(struct lx6464es *chip, int port,
				const u32 *data, u32 len)
{}


static const unsigned long plx_port_offsets[] =;

static void __iomem *lx_plx_register(struct lx6464es *chip, int port)
{}

unsigned long lx_plx_reg_read(struct lx6464es *chip, int port)
{}

void lx_plx_reg_write(struct lx6464es *chip, int port, u32 data)
{}

/* rmh */

#ifdef CONFIG_SND_DEBUG
#define CMD_NAME(a)
#else
#define CMD_NAME
#endif

#define Reg_CSM_MR
#define Reg_CSM_MC

struct dsp_cmd_info {};

/*
  Initialization and control data for the Microblaze interface
  - OpCode:
    the opcode field of the command set at the proper offset
  - CmdLength
    the number of command words
  - StatusType
    offset in the status registers: 0 means that the return value may be
    different from 0, and must be read
  - StatusLength
    the number of status words (in addition to the return value)
*/

static const struct dsp_cmd_info dsp_commands[] =;

static void lx_message_init(struct lx_rmh *rmh, enum cmd_mb_opcodes cmd)
{}

#ifdef RMH_DEBUG
#define LXRMH
static void lx_message_dump(struct lx_rmh *rmh)
{
	u8 idx = rmh->cmd_idx;
	int i;

	snd_printk(LXRMH "command %s\n", dsp_commands[idx].dcOpName);

	for (i = 0; i != rmh->cmd_len; ++i)
		snd_printk(LXRMH "\tcmd[%d] %08x\n", i, rmh->cmd[i]);

	for (i = 0; i != rmh->stat_len; ++i)
		snd_printk(LXRMH "\tstat[%d]: %08x\n", i, rmh->stat[i]);
	snd_printk("\n");
}
#else
static inline void lx_message_dump(struct lx_rmh *rmh)
{}
#endif



/* sleep 500 - 100 = 400 times 100us -> the timeout is >= 40 ms */
#define XILINX_TIMEOUT_MS
#define XILINX_POLL_NO_SLEEP
#define XILINX_POLL_ITERATIONS


static int lx_message_send_atomic(struct lx6464es *chip, struct lx_rmh *rmh)
{}


/* low-level dsp access */
int lx_dsp_get_version(struct lx6464es *chip, u32 *rdsp_version)
{}

int lx_dsp_get_clock_frequency(struct lx6464es *chip, u32 *rfreq)
{}

int lx_dsp_get_mac(struct lx6464es *chip)
{}


int lx_dsp_set_granularity(struct lx6464es *chip, u32 gran)
{}

int lx_dsp_read_async_events(struct lx6464es *chip, u32 *data)
{}

#define PIPE_INFO_TO_CMD(capture, pipe)



/* low-level pipe handling */
int lx_pipe_allocate(struct lx6464es *chip, u32 pipe, int is_capture,
		     int channels)
{}

int lx_pipe_release(struct lx6464es *chip, u32 pipe, int is_capture)
{}

int lx_buffer_ask(struct lx6464es *chip, u32 pipe, int is_capture,
		  u32 *r_needed, u32 *r_freed, u32 *size_array)
{}


int lx_pipe_stop(struct lx6464es *chip, u32 pipe, int is_capture)
{}

static int lx_pipe_toggle_state(struct lx6464es *chip, u32 pipe, int is_capture)
{}


int lx_pipe_start(struct lx6464es *chip, u32 pipe, int is_capture)
{}

int lx_pipe_pause(struct lx6464es *chip, u32 pipe, int is_capture)
{}


int lx_pipe_sample_count(struct lx6464es *chip, u32 pipe, int is_capture,
			 u64 *rsample_count)
{}

int lx_pipe_state(struct lx6464es *chip, u32 pipe, int is_capture, u16 *rstate)
{}

static int lx_pipe_wait_for_state(struct lx6464es *chip, u32 pipe,
				  int is_capture, u16 state)
{}

int lx_pipe_wait_for_start(struct lx6464es *chip, u32 pipe, int is_capture)
{}

int lx_pipe_wait_for_idle(struct lx6464es *chip, u32 pipe, int is_capture)
{}

/* low-level stream handling */
int lx_stream_set_state(struct lx6464es *chip, u32 pipe,
			       int is_capture, enum stream_state_t state)
{}

int lx_stream_set_format(struct lx6464es *chip, struct snd_pcm_runtime *runtime,
			 u32 pipe, int is_capture)
{}

int lx_stream_state(struct lx6464es *chip, u32 pipe, int is_capture,
		    int *rstate)
{}

int lx_stream_sample_position(struct lx6464es *chip, u32 pipe, int is_capture,
			      u64 *r_bytepos)
{}

/* low-level buffer handling */
int lx_buffer_give(struct lx6464es *chip, u32 pipe, int is_capture,
		   u32 buffer_size, u32 buf_address_lo, u32 buf_address_hi,
		   u32 *r_buffer_index)
{}

int lx_buffer_free(struct lx6464es *chip, u32 pipe, int is_capture,
		   u32 *r_buffer_size)
{}

int lx_buffer_cancel(struct lx6464es *chip, u32 pipe, int is_capture,
		     u32 buffer_index)
{}


/* low-level gain/peak handling
 *
 * \todo: can we unmute capture/playback channels independently?
 *
 * */
int lx_level_unmute(struct lx6464es *chip, int is_capture, int unmute)
{}

static const u32 peak_map[] =;

int lx_level_peaks(struct lx6464es *chip, int is_capture, int channels,
		   u32 *r_levels)
{}

/* interrupt handling */
#define PCX_IRQ_NONE
#define IRQCS_ACTIVE_PCIDB
#define IRQCS_ENABLE_PCIIRQ
#define IRQCS_ENABLE_PCIDB

static u32 lx_interrupt_test_ack(struct lx6464es *chip)
{}

static int lx_interrupt_ack(struct lx6464es *chip, u32 *r_irqsrc,
			    int *r_async_pending, int *r_async_escmd)
{}

static int lx_interrupt_handle_async_events(struct lx6464es *chip, u32 irqsrc,
					    int *r_freq_changed,
					    u64 *r_notified_in_pipe_mask,
					    u64 *r_notified_out_pipe_mask)
{}

static int lx_interrupt_request_new_buffer(struct lx6464es *chip,
					   struct lx_stream *lx_stream)
{}

irqreturn_t lx_interrupt(int irq, void *dev_id)
{}

irqreturn_t lx_threaded_irq(int irq, void *dev_id)
{}


static void lx_irq_set(struct lx6464es *chip, int enable)
{}

void lx_irq_enable(struct lx6464es *chip)
{}

void lx_irq_disable(struct lx6464es *chip)
{}