#include <linux/bitops.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include "lx6464es.h"
#include "lx_core.h"
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)
{ … }
#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 { … };
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
#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)
{ … }
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) …
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)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
#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)
{ … }