Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
pcxhr_core.c File Reference
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
#include <asm/io.h>
#include <sound/core.h>
#include "pcxhr.h"
#include "pcxhr_mixer.h"
#include "pcxhr_hwdep.h"
#include "pcxhr_core.h"

Go to the source code of this file.

Data Structures

struct  pcxhr_cmd_info
 

Macros

#define PCXHR_PLX_OFFSET_MIN   0x40
 
#define PCXHR_PLX_MBOX0   0x40
 
#define PCXHR_PLX_MBOX1   0x44
 
#define PCXHR_PLX_MBOX2   0x48
 
#define PCXHR_PLX_MBOX3   0x4C
 
#define PCXHR_PLX_MBOX4   0x50
 
#define PCXHR_PLX_MBOX5   0x54
 
#define PCXHR_PLX_MBOX6   0x58
 
#define PCXHR_PLX_MBOX7   0x5C
 
#define PCXHR_PLX_L2PCIDB   0x64
 
#define PCXHR_PLX_IRQCS   0x68
 
#define PCXHR_PLX_CHIPSC   0x6C
 
#define PCXHR_DSP_ICR   0x00
 
#define PCXHR_DSP_CVR   0x04
 
#define PCXHR_DSP_ISR   0x08
 
#define PCXHR_DSP_IVR   0x0C
 
#define PCXHR_DSP_RXH   0x14
 
#define PCXHR_DSP_TXH   0x14
 
#define PCXHR_DSP_RXM   0x18
 
#define PCXHR_DSP_TXM   0x18
 
#define PCXHR_DSP_RXL   0x1C
 
#define PCXHR_DSP_TXL   0x1C
 
#define PCXHR_DSP_RESET   0x20
 
#define PCXHR_DSP_OFFSET_MAX   0x20
 
#define PCXHR_PLX   1
 
#define PCXHR_DSP   2
 
#define PCXHR_REG_TO_PORT(x)   ((x)>PCXHR_DSP_OFFSET_MAX ? PCXHR_PLX : PCXHR_DSP)
 
#define PCXHR_INPB(mgr, x)   inb((mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))
 
#define PCXHR_INPL(mgr, x)   inl((mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))
 
#define PCXHR_OUTPB(mgr, x, data)   outb((data), (mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))
 
#define PCXHR_OUTPL(mgr, x, data)   outl((data), (mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))
 
#define PCXHR_MBOX0_HF5   (1 << 0)
 
#define PCXHR_MBOX0_HF4   (1 << 1)
 
#define PCXHR_MBOX0_BOOT_HERE   (1 << 23)
 
#define PCXHR_IRQCS_ENABLE_PCIIRQ   (1 << 8)
 
#define PCXHR_IRQCS_ENABLE_PCIDB   (1 << 9)
 
#define PCXHR_IRQCS_ACTIVE_PCIDB   (1 << 13)
 
#define PCXHR_CHIPSC_INIT_VALUE   0x100D767E
 
#define PCXHR_CHIPSC_RESET_XILINX   (1 << 16)
 
#define PCXHR_CHIPSC_GPI_USERI   (1 << 17)
 
#define PCXHR_CHIPSC_DATA_CLK   (1 << 24)
 
#define PCXHR_CHIPSC_DATA_IN   (1 << 26)
 
#define PCXHR_ICR_HI08_RREQ   0x01
 
#define PCXHR_ICR_HI08_TREQ   0x02
 
#define PCXHR_ICR_HI08_HDRQ   0x04
 
#define PCXHR_ICR_HI08_HF0   0x08
 
#define PCXHR_ICR_HI08_HF1   0x10
 
#define PCXHR_ICR_HI08_HLEND   0x20
 
#define PCXHR_ICR_HI08_INIT   0x80
 
#define PCXHR_CVR_HI08_HC   0x80
 
#define PCXHR_ISR_HI08_RXDF   0x01
 
#define PCXHR_ISR_HI08_TXDE   0x02
 
#define PCXHR_ISR_HI08_TRDY   0x04
 
#define PCXHR_ISR_HI08_ERR   0x08
 
#define PCXHR_ISR_HI08_CHK   0x10
 
#define PCXHR_ISR_HI08_HREQ   0x80
 
#define PCXHR_WAIT_DEFAULT   2
 
#define PCXHR_WAIT_IT   25
 
#define PCXHR_WAIT_IT_EXTRA   65
 
#define PCXHR_TIMEOUT_DSP   200
 
#define PCXHR_MASK_EXTRA_INFO   0x0000FE
 
#define PCXHR_MASK_IT_HF0   0x000100
 
#define PCXHR_MASK_IT_HF1   0x000200
 
#define PCXHR_MASK_IT_NO_HF0_HF1   0x000400
 
#define PCXHR_MASK_IT_MANAGE_HF5   0x000800
 
#define PCXHR_MASK_IT_WAIT   0x010000
 
#define PCXHR_MASK_IT_WAIT_EXTRA   0x020000
 
#define PCXHR_IT_SEND_BYTE_XILINX   (0x0000003C | PCXHR_MASK_IT_HF0)
 
#define PCXHR_IT_TEST_XILINX
 
#define PCXHR_IT_DOWNLOAD_BOOT
 
#define PCXHR_IT_RESET_BOARD_FUNC
 
#define PCXHR_IT_DOWNLOAD_DSP
 
#define PCXHR_IT_DEBUG   (0x0000005A | PCXHR_MASK_IT_NO_HF0_HF1)
 
#define PCXHR_IT_RESET_SEMAPHORE   (0x0000005C | PCXHR_MASK_IT_NO_HF0_HF1)
 
#define PCXHR_IT_MESSAGE   (0x00000074 | PCXHR_MASK_IT_NO_HF0_HF1)
 
#define PCXHR_IT_RESET_CHK   (0x00000076 | PCXHR_MASK_IT_NO_HF0_HF1)
 
#define PCXHR_IT_UPDATE_RBUFFER   (0x00000078 | PCXHR_MASK_IT_NO_HF0_HF1)
 
#define PCXHR_PIPE_STATE_CAPTURE_OFFSET   12
 
#define MAX_WAIT_FOR_DSP   20
 
#define PCXHR_IRQ_TIMER   0x000300
 
#define PCXHR_IRQ_FREQ_CHANGE   0x000800
 
#define PCXHR_IRQ_TIME_CODE   0x001000
 
#define PCXHR_IRQ_NOTIFY   0x002000
 
#define PCXHR_IRQ_ASYNC   0x008000
 
#define PCXHR_IRQ_MASK   0x00bb00
 
#define PCXHR_FATAL_DSP_ERR   0xff0000
 

Enumerations

enum  { RMH_SSIZE_FIXED = 0, RMH_SSIZE_ARG = 1, RMH_SSIZE_MASK = 2 }
 
enum  pcxhr_async_err_src { PCXHR_ERR_PIPE, PCXHR_ERR_STREAM, PCXHR_ERR_AUDIO }
 

Functions

void pcxhr_reset_xilinx_com (struct pcxhr_mgr *mgr)
 
void pcxhr_reset_dsp (struct pcxhr_mgr *mgr)
 
void pcxhr_enable_dsp (struct pcxhr_mgr *mgr)
 
int pcxhr_load_xilinx_binary (struct pcxhr_mgr *mgr, const struct firmware *xilinx, int second)
 
int pcxhr_load_eeprom_binary (struct pcxhr_mgr *mgr, const struct firmware *eeprom)
 
int pcxhr_load_boot_binary (struct pcxhr_mgr *mgr, const struct firmware *boot)
 
int pcxhr_load_dsp_binary (struct pcxhr_mgr *mgr, const struct firmware *dsp)
 
void pcxhr_init_rmh (struct pcxhr_rmh *rmh, int cmd)
 
void pcxhr_set_pipe_cmd_params (struct pcxhr_rmh *rmh, int capture, unsigned int param1, unsigned int param2, unsigned int param3)
 
int pcxhr_send_msg (struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
 
int pcxhr_set_pipe_state (struct pcxhr_mgr *mgr, int playback_mask, int capture_mask, int start)
 
int pcxhr_write_io_num_reg_cont (struct pcxhr_mgr *mgr, unsigned int mask, unsigned int value, int *changed)
 
void pcxhr_msg_tasklet (unsigned long arg)
 
irqreturn_t pcxhr_interrupt (int irq, void *dev_id)
 

Macro Definition Documentation

#define MAX_WAIT_FOR_DSP   20

Definition at line 788 of file pcxhr_core.c.

#define PCXHR_CHIPSC_DATA_CLK   (1 << 24)

Definition at line 89 of file pcxhr_core.c.

#define PCXHR_CHIPSC_DATA_IN   (1 << 26)

Definition at line 90 of file pcxhr_core.c.

#define PCXHR_CHIPSC_GPI_USERI   (1 << 17)

Definition at line 88 of file pcxhr_core.c.

#define PCXHR_CHIPSC_INIT_VALUE   0x100D767E

Definition at line 86 of file pcxhr_core.c.

#define PCXHR_CHIPSC_RESET_XILINX   (1 << 16)

Definition at line 87 of file pcxhr_core.c.

#define PCXHR_CVR_HI08_HC   0x80

Definition at line 101 of file pcxhr_core.c.

#define PCXHR_DSP   2

Definition at line 64 of file pcxhr_core.c.

#define PCXHR_DSP_CVR   0x04

Definition at line 50 of file pcxhr_core.c.

#define PCXHR_DSP_ICR   0x00

Definition at line 49 of file pcxhr_core.c.

#define PCXHR_DSP_ISR   0x08

Definition at line 51 of file pcxhr_core.c.

#define PCXHR_DSP_IVR   0x0C

Definition at line 52 of file pcxhr_core.c.

#define PCXHR_DSP_OFFSET_MAX   0x20

Definition at line 60 of file pcxhr_core.c.

#define PCXHR_DSP_RESET   0x20

Definition at line 59 of file pcxhr_core.c.

#define PCXHR_DSP_RXH   0x14

Definition at line 53 of file pcxhr_core.c.

#define PCXHR_DSP_RXL   0x1C

Definition at line 57 of file pcxhr_core.c.

#define PCXHR_DSP_RXM   0x18

Definition at line 55 of file pcxhr_core.c.

#define PCXHR_DSP_TXH   0x14

Definition at line 54 of file pcxhr_core.c.

#define PCXHR_DSP_TXL   0x1C

Definition at line 58 of file pcxhr_core.c.

#define PCXHR_DSP_TXM   0x18

Definition at line 56 of file pcxhr_core.c.

#define PCXHR_FATAL_DSP_ERR   0xff0000

Definition at line 1003 of file pcxhr_core.c.

#define PCXHR_ICR_HI08_HDRQ   0x04

Definition at line 95 of file pcxhr_core.c.

#define PCXHR_ICR_HI08_HF0   0x08

Definition at line 96 of file pcxhr_core.c.

#define PCXHR_ICR_HI08_HF1   0x10

Definition at line 97 of file pcxhr_core.c.

#define PCXHR_ICR_HI08_HLEND   0x20

Definition at line 98 of file pcxhr_core.c.

#define PCXHR_ICR_HI08_INIT   0x80

Definition at line 99 of file pcxhr_core.c.

#define PCXHR_ICR_HI08_RREQ   0x01

Definition at line 93 of file pcxhr_core.c.

#define PCXHR_ICR_HI08_TREQ   0x02

Definition at line 94 of file pcxhr_core.c.

#define PCXHR_INPB (   mgr,
  x 
)    inb((mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))

Definition at line 71 of file pcxhr_core.c.

#define PCXHR_INPL (   mgr,
  x 
)    inl((mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))

Definition at line 72 of file pcxhr_core.c.

#define PCXHR_IRQ_ASYNC   0x008000

Definition at line 1001 of file pcxhr_core.c.

#define PCXHR_IRQ_FREQ_CHANGE   0x000800

Definition at line 998 of file pcxhr_core.c.

#define PCXHR_IRQ_MASK   0x00bb00

Definition at line 1002 of file pcxhr_core.c.

#define PCXHR_IRQ_NOTIFY   0x002000

Definition at line 1000 of file pcxhr_core.c.

#define PCXHR_IRQ_TIME_CODE   0x001000

Definition at line 999 of file pcxhr_core.c.

#define PCXHR_IRQ_TIMER   0x000300

Definition at line 997 of file pcxhr_core.c.

#define PCXHR_IRQCS_ACTIVE_PCIDB   (1 << 13)

Definition at line 84 of file pcxhr_core.c.

#define PCXHR_IRQCS_ENABLE_PCIDB   (1 << 9)

Definition at line 83 of file pcxhr_core.c.

#define PCXHR_IRQCS_ENABLE_PCIIRQ   (1 << 8)

Definition at line 82 of file pcxhr_core.c.

#define PCXHR_ISR_HI08_CHK   0x10

Definition at line 107 of file pcxhr_core.c.

#define PCXHR_ISR_HI08_ERR   0x08

Definition at line 106 of file pcxhr_core.c.

#define PCXHR_ISR_HI08_HREQ   0x80

Definition at line 108 of file pcxhr_core.c.

#define PCXHR_ISR_HI08_RXDF   0x01

Definition at line 103 of file pcxhr_core.c.

#define PCXHR_ISR_HI08_TRDY   0x04

Definition at line 105 of file pcxhr_core.c.

#define PCXHR_ISR_HI08_TXDE   0x02

Definition at line 104 of file pcxhr_core.c.

#define PCXHR_IT_DEBUG   (0x0000005A | PCXHR_MASK_IT_NO_HF0_HF1)

Definition at line 172 of file pcxhr_core.c.

#define PCXHR_IT_DOWNLOAD_BOOT
Value:
(0x0000000C | PCXHR_MASK_IT_HF1 | \
PCXHR_MASK_IT_MANAGE_HF5 | \
PCXHR_MASK_IT_WAIT)

Definition at line 163 of file pcxhr_core.c.

#define PCXHR_IT_DOWNLOAD_DSP
Value:
(0x0000000C | \
PCXHR_MASK_IT_MANAGE_HF5 | \
PCXHR_MASK_IT_WAIT)

Definition at line 169 of file pcxhr_core.c.

#define PCXHR_IT_MESSAGE   (0x00000074 | PCXHR_MASK_IT_NO_HF0_HF1)

Definition at line 174 of file pcxhr_core.c.

#define PCXHR_IT_RESET_BOARD_FUNC
Value:
(0x0000000C | PCXHR_MASK_IT_HF0 | \
PCXHR_MASK_IT_MANAGE_HF5 | \
PCXHR_MASK_IT_WAIT_EXTRA)

Definition at line 166 of file pcxhr_core.c.

#define PCXHR_IT_RESET_CHK   (0x00000076 | PCXHR_MASK_IT_NO_HF0_HF1)

Definition at line 175 of file pcxhr_core.c.

#define PCXHR_IT_RESET_SEMAPHORE   (0x0000005C | PCXHR_MASK_IT_NO_HF0_HF1)

Definition at line 173 of file pcxhr_core.c.

#define PCXHR_IT_SEND_BYTE_XILINX   (0x0000003C | PCXHR_MASK_IT_HF0)

Definition at line 160 of file pcxhr_core.c.

#define PCXHR_IT_TEST_XILINX
Value:
(0x0000003C | PCXHR_MASK_IT_HF1 | \
PCXHR_MASK_IT_MANAGE_HF5)

Definition at line 161 of file pcxhr_core.c.

#define PCXHR_IT_UPDATE_RBUFFER   (0x00000078 | PCXHR_MASK_IT_NO_HF0_HF1)

Definition at line 176 of file pcxhr_core.c.

#define PCXHR_MASK_EXTRA_INFO   0x0000FE

Definition at line 152 of file pcxhr_core.c.

#define PCXHR_MASK_IT_HF0   0x000100

Definition at line 153 of file pcxhr_core.c.

#define PCXHR_MASK_IT_HF1   0x000200

Definition at line 154 of file pcxhr_core.c.

#define PCXHR_MASK_IT_MANAGE_HF5   0x000800

Definition at line 156 of file pcxhr_core.c.

#define PCXHR_MASK_IT_NO_HF0_HF1   0x000400

Definition at line 155 of file pcxhr_core.c.

#define PCXHR_MASK_IT_WAIT   0x010000

Definition at line 157 of file pcxhr_core.c.

#define PCXHR_MASK_IT_WAIT_EXTRA   0x020000

Definition at line 158 of file pcxhr_core.c.

#define PCXHR_MBOX0_BOOT_HERE   (1 << 23)

Definition at line 80 of file pcxhr_core.c.

#define PCXHR_MBOX0_HF4   (1 << 1)

Definition at line 79 of file pcxhr_core.c.

#define PCXHR_MBOX0_HF5   (1 << 0)

Definition at line 78 of file pcxhr_core.c.

#define PCXHR_OUTPB (   mgr,
  x,
  data 
)    outb((data), (mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))

Definition at line 73 of file pcxhr_core.c.

#define PCXHR_OUTPL (   mgr,
  x,
  data 
)    outl((data), (mgr)->port[PCXHR_REG_TO_PORT(x)] + (x))

Definition at line 74 of file pcxhr_core.c.

#define PCXHR_PIPE_STATE_CAPTURE_OFFSET   12

Definition at line 787 of file pcxhr_core.c.

#define PCXHR_PLX   1

Definition at line 63 of file pcxhr_core.c.

#define PCXHR_PLX_CHIPSC   0x6C

Definition at line 46 of file pcxhr_core.c.

#define PCXHR_PLX_IRQCS   0x68

Definition at line 45 of file pcxhr_core.c.

#define PCXHR_PLX_L2PCIDB   0x64

Definition at line 44 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX0   0x40

Definition at line 36 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX1   0x44

Definition at line 37 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX2   0x48

Definition at line 38 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX3   0x4C

Definition at line 39 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX4   0x50

Definition at line 40 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX5   0x54

Definition at line 41 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX6   0x58

Definition at line 42 of file pcxhr_core.c.

#define PCXHR_PLX_MBOX7   0x5C

Definition at line 43 of file pcxhr_core.c.

#define PCXHR_PLX_OFFSET_MIN   0x40

Definition at line 35 of file pcxhr_core.c.

#define PCXHR_REG_TO_PORT (   x)    ((x)>PCXHR_DSP_OFFSET_MAX ? PCXHR_PLX : PCXHR_DSP)

Definition at line 69 of file pcxhr_core.c.

#define PCXHR_TIMEOUT_DSP   200

Definition at line 149 of file pcxhr_core.c.

#define PCXHR_WAIT_DEFAULT   2

Definition at line 112 of file pcxhr_core.c.

#define PCXHR_WAIT_IT   25

Definition at line 113 of file pcxhr_core.c.

#define PCXHR_WAIT_IT_EXTRA   65

Definition at line 114 of file pcxhr_core.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
RMH_SSIZE_FIXED 
RMH_SSIZE_ARG 
RMH_SSIZE_MASK 

Definition at line 472 of file pcxhr_core.c.

Enumerator:
PCXHR_ERR_PIPE 
PCXHR_ERR_STREAM 
PCXHR_ERR_AUDIO 

Definition at line 1005 of file pcxhr_core.c.

Function Documentation

void pcxhr_enable_dsp ( struct pcxhr_mgr mgr)

Definition at line 271 of file pcxhr_core.c.

void pcxhr_init_rmh ( struct pcxhr_rmh rmh,
int  cmd 
)

pcxhr_init_rmh - initialize the RMH instance : the rmh pointer to be initialized : the rmh command to be set

Definition at line 726 of file pcxhr_core.c.

irqreturn_t pcxhr_interrupt ( int  irq,
void dev_id 
)

Definition at line 1219 of file pcxhr_core.c.

int pcxhr_load_boot_binary ( struct pcxhr_mgr mgr,
const struct firmware boot 
)

Definition at line 415 of file pcxhr_core.c.

int pcxhr_load_dsp_binary ( struct pcxhr_mgr mgr,
const struct firmware dsp 
)

Definition at line 444 of file pcxhr_core.c.

int pcxhr_load_eeprom_binary ( struct pcxhr_mgr mgr,
const struct firmware eeprom 
)

Definition at line 383 of file pcxhr_core.c.

int pcxhr_load_xilinx_binary ( struct pcxhr_mgr mgr,
const struct firmware xilinx,
int  second 
)

Definition at line 280 of file pcxhr_core.c.

void pcxhr_msg_tasklet ( unsigned long  arg)

Definition at line 1041 of file pcxhr_core.c.

void pcxhr_reset_dsp ( struct pcxhr_mgr mgr)

Definition at line 256 of file pcxhr_core.c.

void pcxhr_reset_xilinx_com ( struct pcxhr_mgr mgr)

Definition at line 238 of file pcxhr_core.c.

int pcxhr_send_msg ( struct pcxhr_mgr mgr,
struct pcxhr_rmh rmh 
)

Definition at line 764 of file pcxhr_core.c.

void pcxhr_set_pipe_cmd_params ( struct pcxhr_rmh rmh,
int  capture,
unsigned int  param1,
unsigned int  param2,
unsigned int  param3 
)

Definition at line 738 of file pcxhr_core.c.

int pcxhr_set_pipe_state ( struct pcxhr_mgr mgr,
int  playback_mask,
int  capture_mask,
int  start 
)

Definition at line 902 of file pcxhr_core.c.

int pcxhr_write_io_num_reg_cont ( struct pcxhr_mgr mgr,
unsigned int  mask,
unsigned int  value,
int changed 
)

Definition at line 965 of file pcxhr_core.c.