Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
es1938.c File Reference
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/gameport.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
#include <sound/opl3.h>
#include <sound/mpu401.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <asm/io.h>

Go to the source code of this file.

Data Structures

struct  es1938
 

Macros

#define SLIO_REG(chip, x)   ((chip)->io_port + ESSIO_REG_##x)
 
#define SLDM_REG(chip, x)   ((chip)->ddma_port + ESSDM_REG_##x)
 
#define SLSB_REG(chip, x)   ((chip)->sb_port + ESSSB_REG_##x)
 
#define SL_PCI_LEGACYCONTROL   0x40
 
#define SL_PCI_CONFIG   0x50
 
#define SL_PCI_DDMACONTROL   0x60
 
#define ESSIO_REG_AUDIO2DMAADDR   0
 
#define ESSIO_REG_AUDIO2DMACOUNT   4
 
#define ESSIO_REG_AUDIO2MODE   6
 
#define ESSIO_REG_IRQCONTROL   7
 
#define ESSDM_REG_DMAADDR   0x00
 
#define ESSDM_REG_DMACOUNT   0x04
 
#define ESSDM_REG_DMACOMMAND   0x08
 
#define ESSDM_REG_DMASTATUS   0x08
 
#define ESSDM_REG_DMAMODE   0x0b
 
#define ESSDM_REG_DMACLEAR   0x0d
 
#define ESSDM_REG_DMAMASK   0x0f
 
#define ESSSB_REG_FMLOWADDR   0x00
 
#define ESSSB_REG_FMHIGHADDR   0x02
 
#define ESSSB_REG_MIXERADDR   0x04
 
#define ESSSB_REG_MIXERDATA   0x05
 
#define ESSSB_IREG_AUDIO1   0x14
 
#define ESSSB_IREG_MICMIX   0x1a
 
#define ESSSB_IREG_RECSRC   0x1c
 
#define ESSSB_IREG_MASTER   0x32
 
#define ESSSB_IREG_FM   0x36
 
#define ESSSB_IREG_AUXACD   0x38
 
#define ESSSB_IREG_AUXB   0x3a
 
#define ESSSB_IREG_PCSPEAKER   0x3c
 
#define ESSSB_IREG_LINE   0x3e
 
#define ESSSB_IREG_SPATCONTROL   0x50
 
#define ESSSB_IREG_SPATLEVEL   0x52
 
#define ESSSB_IREG_MASTER_LEFT   0x60
 
#define ESSSB_IREG_MASTER_RIGHT   0x62
 
#define ESSSB_IREG_MPU401CONTROL   0x64
 
#define ESSSB_IREG_MICMIXRECORD   0x68
 
#define ESSSB_IREG_AUDIO2RECORD   0x69
 
#define ESSSB_IREG_AUXACDRECORD   0x6a
 
#define ESSSB_IREG_FMRECORD   0x6b
 
#define ESSSB_IREG_AUXBRECORD   0x6c
 
#define ESSSB_IREG_MONO   0x6d
 
#define ESSSB_IREG_LINERECORD   0x6e
 
#define ESSSB_IREG_MONORECORD   0x6f
 
#define ESSSB_IREG_AUDIO2SAMPLE   0x70
 
#define ESSSB_IREG_AUDIO2MODE   0x71
 
#define ESSSB_IREG_AUDIO2FILTER   0x72
 
#define ESSSB_IREG_AUDIO2TCOUNTL   0x74
 
#define ESSSB_IREG_AUDIO2TCOUNTH   0x76
 
#define ESSSB_IREG_AUDIO2CONTROL1   0x78
 
#define ESSSB_IREG_AUDIO2CONTROL2   0x7a
 
#define ESSSB_IREG_AUDIO2   0x7c
 
#define ESSSB_REG_RESET   0x06
 
#define ESSSB_REG_READDATA   0x0a
 
#define ESSSB_REG_WRITEDATA   0x0c
 
#define ESSSB_REG_READSTATUS   0x0c
 
#define ESSSB_REG_STATUS   0x0e
 
#define ESS_CMD_EXTSAMPLERATE   0xa1
 
#define ESS_CMD_FILTERDIV   0xa2
 
#define ESS_CMD_DMACNTRELOADL   0xa4
 
#define ESS_CMD_DMACNTRELOADH   0xa5
 
#define ESS_CMD_ANALOGCONTROL   0xa8
 
#define ESS_CMD_IRQCONTROL   0xb1
 
#define ESS_CMD_DRQCONTROL   0xb2
 
#define ESS_CMD_RECLEVEL   0xb4
 
#define ESS_CMD_SETFORMAT   0xb6
 
#define ESS_CMD_SETFORMAT2   0xb7
 
#define ESS_CMD_DMACONTROL   0xb8
 
#define ESS_CMD_DMATYPE   0xb9
 
#define ESS_CMD_OFFSETLEFT   0xba
 
#define ESS_CMD_OFFSETRIGHT   0xbb
 
#define ESS_CMD_READREG   0xc0
 
#define ESS_CMD_ENABLEEXT   0xc6
 
#define ESS_CMD_PAUSEDMA   0xd0
 
#define ESS_CMD_ENABLEAUDIO1   0xd1
 
#define ESS_CMD_STOPAUDIO1   0xd3
 
#define ESS_CMD_AUDIO1STATUS   0xd8
 
#define ESS_CMD_CONTDMA   0xd4
 
#define ESS_CMD_TESTIRQ   0xf2
 
#define ESS_RECSRC_MIC   0
 
#define ESS_RECSRC_AUXACD   2
 
#define ESS_RECSRC_AUXB   5
 
#define ESS_RECSRC_LINE   6
 
#define ESS_RECSRC_NONE   7
 
#define DAC1   0x01
 
#define ADC1   0x02
 
#define DAC2   0x04
 
#define SAVED_REG_SIZE   32 /* max. number of registers to save */
 
#define RESET_LOOP_TIMEOUT   0x10000
 
#define WRITE_LOOP_TIMEOUT   0x10000
 
#define GET_LOOP_TIMEOUT   0x01000
 
#define snd_es1938_info_spatializer_enable   snd_ctl_boolean_mono_info
 
#define snd_es1938_info_hw_switch   snd_ctl_boolean_stereo_info
 
#define ES1938_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv)
 
#define ES1938_SINGLE(xname, xindex, reg, shift, mask, invert)
 
#define ES1938_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert, xtlv)
 
#define ES1938_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert)
 
#define ES1938_PM_OPS   NULL
 
#define ES1938_DMA_SIZE   64
 

Functions

 MODULE_AUTHOR ("Jaromir Koutek <[email protected]>")
 
 MODULE_DESCRIPTION ("ESS Solo-1")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("{{ESS,ES1938},""{ESS,ES1946},""{ESS,ES1969},""{TerraTec,128i PCI}}")
 
 module_param_array (index, int, NULL, 0444)
 
 MODULE_PARM_DESC (index,"Index value for ESS Solo-1 soundcard.")
 
 module_param_array (id, charp, NULL, 0444)
 
 MODULE_PARM_DESC (id,"ID string for ESS Solo-1 soundcard.")
 
 module_param_array (enable, bool, NULL, 0444)
 
 MODULE_PARM_DESC (enable,"Enable ESS Solo-1 soundcard.")
 
 MODULE_DEVICE_TABLE (pci, snd_es1938_ids)
 
 module_pci_driver (es1938_driver)
 

Macro Definition Documentation

#define ADC1   0x02

Definition at line 188 of file es1938.c.

#define DAC1   0x01

Definition at line 187 of file es1938.c.

#define DAC2   0x04

Definition at line 189 of file es1938.c.

#define ES1938_DMA_SIZE   64

Definition at line 1755 of file es1938.c.

#define ES1938_DOUBLE (   xname,
  xindex,
  left_reg,
  right_reg,
  shift_left,
  shift_right,
  mask,
  invert 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_es1938_info_double, \
.get = snd_es1938_get_double, .put = snd_es1938_put_double, \
.private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }

Definition at line 1244 of file es1938.c.

#define ES1938_DOUBLE_TLV (   xname,
  xindex,
  left_reg,
  right_reg,
  shift_left,
  shift_right,
  mask,
  invert,
  xtlv 
)
Value:
.name = xname, .index = xindex, \
.info = snd_es1938_info_double, \
.get = snd_es1938_get_double, .put = snd_es1938_put_double, \
.private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22), \
.tlv = { .p = xtlv } }

Definition at line 1236 of file es1938.c.

#define ES1938_PM_OPS   NULL

Definition at line 1538 of file es1938.c.

#define ES1938_SINGLE (   xname,
  xindex,
  reg,
  shift,
  mask,
  invert 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_es1938_info_single, \
.get = snd_es1938_get_single, .put = snd_es1938_put_single, \
.private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }

Definition at line 1183 of file es1938.c.

#define ES1938_SINGLE_TLV (   xname,
  xindex,
  reg,
  shift,
  mask,
  invert,
  xtlv 
)
Value:
.name = xname, .index = xindex, \
.info = snd_es1938_info_single, \
.get = snd_es1938_get_single, .put = snd_es1938_put_single, \
.private_value = reg | (shift << 8) | (mask << 16) | (invert << 24), \
.tlv = { .p = xtlv } }

Definition at line 1175 of file es1938.c.

#define ESS_CMD_ANALOGCONTROL   0xa8

Definition at line 162 of file es1938.c.

#define ESS_CMD_AUDIO1STATUS   0xd8

Definition at line 177 of file es1938.c.

#define ESS_CMD_CONTDMA   0xd4

Definition at line 178 of file es1938.c.

#define ESS_CMD_DMACNTRELOADH   0xa5

Definition at line 161 of file es1938.c.

#define ESS_CMD_DMACNTRELOADL   0xa4

Definition at line 160 of file es1938.c.

#define ESS_CMD_DMACONTROL   0xb8

Definition at line 168 of file es1938.c.

#define ESS_CMD_DMATYPE   0xb9

Definition at line 169 of file es1938.c.

#define ESS_CMD_DRQCONTROL   0xb2

Definition at line 164 of file es1938.c.

#define ESS_CMD_ENABLEAUDIO1   0xd1

Definition at line 175 of file es1938.c.

#define ESS_CMD_ENABLEEXT   0xc6

Definition at line 173 of file es1938.c.

#define ESS_CMD_EXTSAMPLERATE   0xa1

Definition at line 158 of file es1938.c.

#define ESS_CMD_FILTERDIV   0xa2

Definition at line 159 of file es1938.c.

#define ESS_CMD_IRQCONTROL   0xb1

Definition at line 163 of file es1938.c.

#define ESS_CMD_OFFSETLEFT   0xba

Definition at line 170 of file es1938.c.

#define ESS_CMD_OFFSETRIGHT   0xbb

Definition at line 171 of file es1938.c.

#define ESS_CMD_PAUSEDMA   0xd0

Definition at line 174 of file es1938.c.

#define ESS_CMD_READREG   0xc0

Definition at line 172 of file es1938.c.

#define ESS_CMD_RECLEVEL   0xb4

Definition at line 165 of file es1938.c.

#define ESS_CMD_SETFORMAT   0xb6

Definition at line 166 of file es1938.c.

#define ESS_CMD_SETFORMAT2   0xb7

Definition at line 167 of file es1938.c.

#define ESS_CMD_STOPAUDIO1   0xd3

Definition at line 176 of file es1938.c.

#define ESS_CMD_TESTIRQ   0xf2

Definition at line 179 of file es1938.c.

#define ESS_RECSRC_AUXACD   2

Definition at line 182 of file es1938.c.

#define ESS_RECSRC_AUXB   5

Definition at line 183 of file es1938.c.

#define ESS_RECSRC_LINE   6

Definition at line 184 of file es1938.c.

#define ESS_RECSRC_MIC   0

Definition at line 181 of file es1938.c.

#define ESS_RECSRC_NONE   7

Definition at line 185 of file es1938.c.

#define ESSDM_REG_DMAADDR   0x00

Definition at line 106 of file es1938.c.

#define ESSDM_REG_DMACLEAR   0x0d

Definition at line 111 of file es1938.c.

#define ESSDM_REG_DMACOMMAND   0x08

Definition at line 108 of file es1938.c.

#define ESSDM_REG_DMACOUNT   0x04

Definition at line 107 of file es1938.c.

#define ESSDM_REG_DMAMASK   0x0f

Definition at line 112 of file es1938.c.

#define ESSDM_REG_DMAMODE   0x0b

Definition at line 110 of file es1938.c.

#define ESSDM_REG_DMASTATUS   0x08

Definition at line 109 of file es1938.c.

#define ESSIO_REG_AUDIO2DMAADDR   0

Definition at line 101 of file es1938.c.

#define ESSIO_REG_AUDIO2DMACOUNT   4

Definition at line 102 of file es1938.c.

#define ESSIO_REG_AUDIO2MODE   6

Definition at line 103 of file es1938.c.

#define ESSIO_REG_IRQCONTROL   7

Definition at line 104 of file es1938.c.

#define ESSSB_IREG_AUDIO1   0x14

Definition at line 119 of file es1938.c.

#define ESSSB_IREG_AUDIO2   0x7c

Definition at line 148 of file es1938.c.

#define ESSSB_IREG_AUDIO2CONTROL1   0x78

Definition at line 146 of file es1938.c.

#define ESSSB_IREG_AUDIO2CONTROL2   0x7a

Definition at line 147 of file es1938.c.

#define ESSSB_IREG_AUDIO2FILTER   0x72

Definition at line 143 of file es1938.c.

#define ESSSB_IREG_AUDIO2MODE   0x71

Definition at line 142 of file es1938.c.

#define ESSSB_IREG_AUDIO2RECORD   0x69

Definition at line 134 of file es1938.c.

#define ESSSB_IREG_AUDIO2SAMPLE   0x70

Definition at line 141 of file es1938.c.

#define ESSSB_IREG_AUDIO2TCOUNTH   0x76

Definition at line 145 of file es1938.c.

#define ESSSB_IREG_AUDIO2TCOUNTL   0x74

Definition at line 144 of file es1938.c.

#define ESSSB_IREG_AUXACD   0x38

Definition at line 124 of file es1938.c.

#define ESSSB_IREG_AUXACDRECORD   0x6a

Definition at line 135 of file es1938.c.

#define ESSSB_IREG_AUXB   0x3a

Definition at line 125 of file es1938.c.

#define ESSSB_IREG_AUXBRECORD   0x6c

Definition at line 137 of file es1938.c.

#define ESSSB_IREG_FM   0x36

Definition at line 123 of file es1938.c.

#define ESSSB_IREG_FMRECORD   0x6b

Definition at line 136 of file es1938.c.

#define ESSSB_IREG_LINE   0x3e

Definition at line 127 of file es1938.c.

#define ESSSB_IREG_LINERECORD   0x6e

Definition at line 139 of file es1938.c.

#define ESSSB_IREG_MASTER   0x32

Definition at line 122 of file es1938.c.

#define ESSSB_IREG_MASTER_LEFT   0x60

Definition at line 130 of file es1938.c.

#define ESSSB_IREG_MASTER_RIGHT   0x62

Definition at line 131 of file es1938.c.

#define ESSSB_IREG_MICMIX   0x1a

Definition at line 120 of file es1938.c.

#define ESSSB_IREG_MICMIXRECORD   0x68

Definition at line 133 of file es1938.c.

#define ESSSB_IREG_MONO   0x6d

Definition at line 138 of file es1938.c.

#define ESSSB_IREG_MONORECORD   0x6f

Definition at line 140 of file es1938.c.

#define ESSSB_IREG_MPU401CONTROL   0x64

Definition at line 132 of file es1938.c.

#define ESSSB_IREG_PCSPEAKER   0x3c

Definition at line 126 of file es1938.c.

#define ESSSB_IREG_RECSRC   0x1c

Definition at line 121 of file es1938.c.

#define ESSSB_IREG_SPATCONTROL   0x50

Definition at line 128 of file es1938.c.

#define ESSSB_IREG_SPATLEVEL   0x52

Definition at line 129 of file es1938.c.

#define ESSSB_REG_FMHIGHADDR   0x02

Definition at line 115 of file es1938.c.

#define ESSSB_REG_FMLOWADDR   0x00

Definition at line 114 of file es1938.c.

#define ESSSB_REG_MIXERADDR   0x04

Definition at line 116 of file es1938.c.

#define ESSSB_REG_MIXERDATA   0x05

Definition at line 117 of file es1938.c.

#define ESSSB_REG_READDATA   0x0a

Definition at line 152 of file es1938.c.

#define ESSSB_REG_READSTATUS   0x0c

Definition at line 154 of file es1938.c.

#define ESSSB_REG_RESET   0x06

Definition at line 150 of file es1938.c.

#define ESSSB_REG_STATUS   0x0e

Definition at line 156 of file es1938.c.

#define ESSSB_REG_WRITEDATA   0x0c

Definition at line 153 of file es1938.c.

#define GET_LOOP_TIMEOUT   0x01000

Definition at line 255 of file es1938.c.

#define RESET_LOOP_TIMEOUT   0x10000

Definition at line 253 of file es1938.c.

#define SAVED_REG_SIZE   32 /* max. number of registers to save */

Definition at line 195 of file es1938.c.

#define SL_PCI_CONFIG   0x50

Definition at line 98 of file es1938.c.

#define SL_PCI_DDMACONTROL   0x60

Definition at line 99 of file es1938.c.

#define SL_PCI_LEGACYCONTROL   0x40

Definition at line 97 of file es1938.c.

#define SLDM_REG (   chip,
  x 
)    ((chip)->ddma_port + ESSDM_REG_##x)

Definition at line 93 of file es1938.c.

#define SLIO_REG (   chip,
  x 
)    ((chip)->io_port + ESSIO_REG_##x)

Definition at line 91 of file es1938.c.

#define SLSB_REG (   chip,
  x 
)    ((chip)->sb_port + ESSSB_REG_##x)

Definition at line 95 of file es1938.c.

#define snd_es1938_info_hw_switch   snd_ctl_boolean_stereo_info

Definition at line 1138 of file es1938.c.

#define snd_es1938_info_spatializer_enable   snd_ctl_boolean_mono_info

Definition at line 1092 of file es1938.c.

#define WRITE_LOOP_TIMEOUT   0x10000

Definition at line 254 of file es1938.c.

Function Documentation

MODULE_AUTHOR ( "Jaromir Koutek <[email protected]>"  )
MODULE_DESCRIPTION ( "ESS Solo-1"  )
MODULE_DEVICE_TABLE ( pci  ,
snd_es1938_ids   
)
MODULE_LICENSE ( "GPL"  )
module_param_array ( index  ,
int  ,
NULL  ,
0444   
)
module_param_array ( id  ,
charp  ,
NULL  ,
0444   
)
module_param_array ( enable  ,
bool  ,
NULL  ,
0444   
)
MODULE_PARM_DESC ( index  ,
"Index value for ESS Solo-1 soundcard."   
)
MODULE_PARM_DESC ( id  ,
"ID string for ESS Solo-1 soundcard."   
)
MODULE_PARM_DESC ( enable  ,
"Enable ESS Solo-1 soundcard."   
)
module_pci_driver ( es1938_driver  )
MODULE_SUPPORTED_DEVICE ( "{{ESS,ES1938},""{ESS,ES1946},""{ESS,ES1969},""{TerraTec,128i PCI}}"  )