Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
nm256.c File Reference
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/initval.h>
#include "nm256_coef.c"

Go to the source code of this file.

Data Structures

struct  nm256_stream
 
struct  nm256
 
struct  initialValues
 

Macros

#define CARD_NAME   "NeoMagic 256AV/ZX"
 
#define DRIVER_NAME   "NM256"
 
#define NM_SIGNATURE   0x4e4d0000
 
#define NM_SIG_MASK   0xffff0000
 
#define NM_PORT2_SIZE   4096
 
#define NM_MIXER_OFFSET   0x600
 
#define NM_MAX_PLAYBACK_COEF_SIZE   0x5000
 
#define NM_MAX_RECORD_COEF_SIZE   0x1260
 
#define NM_INT_REG   0xa04
 
#define NM_PLAYBACK_INT   0x40
 
#define NM_RECORD_INT   0x100
 
#define NM_MISC_INT_1   0x4000
 
#define NM_MISC_INT_2   0x1
 
#define NM_ACK_INT(chip, X)   snd_nm256_writew(chip, NM_INT_REG, (X) << 1)
 
#define NM_MIXER_STATUS_OFFSET   0xa04
 
#define NM_MIXER_READY_MASK   0x0800
 
#define NM_MIXER_PRESENCE   0xa06
 
#define NM_PRESENCE_MASK   0x0050
 
#define NM_PRESENCE_VALUE   0x0040
 
#define NM2_PLAYBACK_INT   0x10000
 
#define NM2_RECORD_INT   0x80000
 
#define NM2_MISC_INT_1   0x8
 
#define NM2_MISC_INT_2   0x2
 
#define NM2_ACK_INT(chip, X)   snd_nm256_writel(chip, NM_INT_REG, (X))
 
#define NM2_MIXER_STATUS_OFFSET   0xa06
 
#define NM2_MIXER_READY_MASK   0x0800
 
#define NM_PLAYBACK_REG_OFFSET   0x0
 
#define NM_RECORD_REG_OFFSET   0x200
 
#define NM_RATE_REG_OFFSET   2
 
#define NM_RATE_STEREO   1
 
#define NM_RATE_BITS_16   2
 
#define NM_RATE_MASK   0xf0
 
#define NM_PLAYBACK_ENABLE_REG   (NM_PLAYBACK_REG_OFFSET + 0x1)
 
#define NM_PLAYBACK_ENABLE_FLAG   1
 
#define NM_PLAYBACK_ONESHOT   2
 
#define NM_PLAYBACK_FREERUN   4
 
#define NM_AUDIO_MUTE_REG   (NM_PLAYBACK_REG_OFFSET + 0x18)
 
#define NM_AUDIO_MUTE_LEFT   0x8000
 
#define NM_AUDIO_MUTE_RIGHT   0x0080
 
#define NM_RECORD_ENABLE_REG   (NM_RECORD_REG_OFFSET + 0)
 
#define NM_RECORD_ENABLE_FLAG   1
 
#define NM_RECORD_FREERUN   2
 
#define NM_COEFF_START_OFFSET   0x1c
 
#define NM_COEFF_END_OFFSET   0x20
 
#define NM_RBUFFER_START   (NM_RECORD_REG_OFFSET + 0x4)
 
#define NM_RBUFFER_END   (NM_RECORD_REG_OFFSET + 0x10)
 
#define NM_RBUFFER_WMARK   (NM_RECORD_REG_OFFSET + 0xc)
 
#define NM_RBUFFER_CURRP   (NM_RECORD_REG_OFFSET + 0x8)
 
#define NM_PBUFFER_START   (NM_PLAYBACK_REG_OFFSET + 0x4)
 
#define NM_PBUFFER_END   (NM_PLAYBACK_REG_OFFSET + 0x14)
 
#define NM_PBUFFER_WMARK   (NM_PLAYBACK_REG_OFFSET + 0xc)
 
#define NM_PBUFFER_CURRP   (NM_PLAYBACK_REG_OFFSET + 0x8)
 
#define snd_nm256_playback_mark(chip, s)   snd_nm256_pcm_mark(chip, s, NM_PBUFFER_WMARK)
 
#define snd_nm256_capture_mark(chip, s)   snd_nm256_pcm_mark(chip, s, NM_RBUFFER_WMARK)
 
#define NM256_PM_OPS   NULL
 

Enumerations

enum  { NM_BLACKLISTED, NM_RESET_WORKAROUND, NM_RESET_WORKAROUND_2 }
 

Functions

 MODULE_AUTHOR ("Takashi Iwai <[email protected]>")
 
 MODULE_DESCRIPTION ("NeoMagic NM256AV/ZX")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("{{NeoMagic,NM256AV},""{NeoMagic,NM256ZX}}")
 
 module_param (index, int, 0444)
 
 MODULE_PARM_DESC (index,"Index value for "CARD_NAME" soundcard.")
 
 module_param (id, charp, 0444)
 
 MODULE_PARM_DESC (id,"ID string for "CARD_NAME" soundcard.")
 
 module_param (playback_bufsize, int, 0444)
 
 MODULE_PARM_DESC (playback_bufsize,"DAC frame size in kB for "CARD_NAME" soundcard.")
 
 module_param (capture_bufsize, int, 0444)
 
 MODULE_PARM_DESC (capture_bufsize,"ADC frame size in kB for "CARD_NAME" soundcard.")
 
 module_param (force_ac97, bool, 0444)
 
 MODULE_PARM_DESC (force_ac97,"Force to use AC97 codec for "CARD_NAME" soundcard.")
 
 module_param (buffer_top, int, 0444)
 
 MODULE_PARM_DESC (buffer_top,"Set the top address of audio buffer for "CARD_NAME" soundcard.")
 
 module_param (use_cache, bool, 0444)
 
 MODULE_PARM_DESC (use_cache,"Enable the cache for coefficient table access.")
 
 module_param (vaio_hack, bool, 0444)
 
 MODULE_PARM_DESC (vaio_hack,"Enable workaround for Sony VAIO notebooks.")
 
 module_param (reset_workaround, bool, 0444)
 
 MODULE_PARM_DESC (reset_workaround,"Enable AC97 RESET workaround for some laptops.")
 
 module_param (reset_workaround_2, bool, 0444)
 
 MODULE_PARM_DESC (reset_workaround_2,"Enable extended AC97 RESET workaround for some other laptops.")
 
 module_param (enable, bool, 0444)
 
 MODULE_DEVICE_TABLE (pci, snd_nm256_ids)
 
 module_pci_driver (nm256_driver)
 

Macro Definition Documentation

#define CARD_NAME   "NeoMagic 256AV/ZX"

Definition at line 43 of file nm256.c.

#define DRIVER_NAME   "NM256"

Definition at line 44 of file nm256.c.

#define NM256_PM_OPS   NULL

Definition at line 1443 of file nm256.c.

#define NM2_ACK_INT (   chip,
  X 
)    snd_nm256_writel(chip, NM_INT_REG, (X))

Definition at line 137 of file nm256.c.

#define NM2_MISC_INT_1   0x8

Definition at line 135 of file nm256.c.

#define NM2_MISC_INT_2   0x2

Definition at line 136 of file nm256.c.

#define NM2_MIXER_READY_MASK   0x0800

Definition at line 141 of file nm256.c.

#define NM2_MIXER_STATUS_OFFSET   0xa06

Definition at line 140 of file nm256.c.

#define NM2_PLAYBACK_INT   0x10000

Definition at line 133 of file nm256.c.

#define NM2_RECORD_INT   0x80000

Definition at line 134 of file nm256.c.

#define NM_ACK_INT (   chip,
  X 
)    snd_nm256_writew(chip, NM_INT_REG, (X) << 1)

Definition at line 120 of file nm256.c.

#define NM_AUDIO_MUTE_LEFT   0x8000

Definition at line 164 of file nm256.c.

#define NM_AUDIO_MUTE_REG   (NM_PLAYBACK_REG_OFFSET + 0x18)

Definition at line 163 of file nm256.c.

#define NM_AUDIO_MUTE_RIGHT   0x0080

Definition at line 165 of file nm256.c.

#define NM_COEFF_END_OFFSET   0x20

Definition at line 174 of file nm256.c.

#define NM_COEFF_START_OFFSET   0x1c

Definition at line 173 of file nm256.c.

#define NM_INT_REG   0xa04

Definition at line 114 of file nm256.c.

#define NM_MAX_PLAYBACK_COEF_SIZE   0x5000

Definition at line 110 of file nm256.c.

#define NM_MAX_RECORD_COEF_SIZE   0x1260

Definition at line 111 of file nm256.c.

#define NM_MISC_INT_1   0x4000

Definition at line 118 of file nm256.c.

#define NM_MISC_INT_2   0x1

Definition at line 119 of file nm256.c.

#define NM_MIXER_OFFSET   0x600

Definition at line 107 of file nm256.c.

#define NM_MIXER_PRESENCE   0xa06

Definition at line 125 of file nm256.c.

#define NM_MIXER_READY_MASK   0x0800

Definition at line 124 of file nm256.c.

#define NM_MIXER_STATUS_OFFSET   0xa04

Definition at line 123 of file nm256.c.

#define NM_PBUFFER_CURRP   (NM_PLAYBACK_REG_OFFSET + 0x8)

Definition at line 185 of file nm256.c.

#define NM_PBUFFER_END   (NM_PLAYBACK_REG_OFFSET + 0x14)

Definition at line 183 of file nm256.c.

#define NM_PBUFFER_START   (NM_PLAYBACK_REG_OFFSET + 0x4)

Definition at line 182 of file nm256.c.

#define NM_PBUFFER_WMARK   (NM_PLAYBACK_REG_OFFSET + 0xc)

Definition at line 184 of file nm256.c.

#define NM_PLAYBACK_ENABLE_FLAG   1

Definition at line 158 of file nm256.c.

#define NM_PLAYBACK_ENABLE_REG   (NM_PLAYBACK_REG_OFFSET + 0x1)

Definition at line 157 of file nm256.c.

#define NM_PLAYBACK_FREERUN   4

Definition at line 160 of file nm256.c.

#define NM_PLAYBACK_INT   0x40

Definition at line 116 of file nm256.c.

#define NM_PLAYBACK_ONESHOT   2

Definition at line 159 of file nm256.c.

#define NM_PLAYBACK_REG_OFFSET   0x0

Definition at line 144 of file nm256.c.

#define NM_PORT2_SIZE   4096

Definition at line 104 of file nm256.c.

#define NM_PRESENCE_MASK   0x0050

Definition at line 126 of file nm256.c.

#define NM_PRESENCE_VALUE   0x0040

Definition at line 127 of file nm256.c.

#define NM_RATE_BITS_16   2

Definition at line 153 of file nm256.c.

#define NM_RATE_MASK   0xf0

Definition at line 154 of file nm256.c.

#define NM_RATE_REG_OFFSET   2

Definition at line 149 of file nm256.c.

#define NM_RATE_STEREO   1

Definition at line 152 of file nm256.c.

#define NM_RBUFFER_CURRP   (NM_RECORD_REG_OFFSET + 0x8)

Definition at line 180 of file nm256.c.

#define NM_RBUFFER_END   (NM_RECORD_REG_OFFSET + 0x10)

Definition at line 178 of file nm256.c.

#define NM_RBUFFER_START   (NM_RECORD_REG_OFFSET + 0x4)

Definition at line 177 of file nm256.c.

#define NM_RBUFFER_WMARK   (NM_RECORD_REG_OFFSET + 0xc)

Definition at line 179 of file nm256.c.

#define NM_RECORD_ENABLE_FLAG   1

Definition at line 169 of file nm256.c.

#define NM_RECORD_ENABLE_REG   (NM_RECORD_REG_OFFSET + 0)

Definition at line 168 of file nm256.c.

#define NM_RECORD_FREERUN   2

Definition at line 170 of file nm256.c.

#define NM_RECORD_INT   0x100

Definition at line 117 of file nm256.c.

#define NM_RECORD_REG_OFFSET   0x200

Definition at line 146 of file nm256.c.

#define NM_SIG_MASK   0xffff0000

Definition at line 101 of file nm256.c.

#define NM_SIGNATURE   0x4e4d0000

Definition at line 99 of file nm256.c.

#define snd_nm256_capture_mark (   chip,
  s 
)    snd_nm256_pcm_mark(chip, s, NM_RBUFFER_WMARK)

Definition at line 506 of file nm256.c.

#define snd_nm256_playback_mark (   chip,
  s 
)    snd_nm256_pcm_mark(chip, s, NM_PBUFFER_WMARK)

Definition at line 505 of file nm256.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
NM_BLACKLISTED 
NM_RESET_WORKAROUND 
NM_RESET_WORKAROUND_2 

Definition at line 1640 of file nm256.c.

Function Documentation

MODULE_AUTHOR ( "Takashi Iwai <[email protected]>"  )
MODULE_DESCRIPTION ( "NeoMagic NM256AV/ZX"  )
MODULE_DEVICE_TABLE ( pci  ,
snd_nm256_ids   
)
MODULE_LICENSE ( "GPL"  )
module_param ( index  ,
int  ,
0444   
)
module_param ( id  ,
charp  ,
0444   
)
module_param ( playback_bufsize  ,
int  ,
0444   
)
module_param ( capture_bufsize  ,
int  ,
0444   
)
module_param ( force_ac97  ,
bool  ,
0444   
)
module_param ( buffer_top  ,
int  ,
0444   
)
module_param ( use_cache  ,
bool  ,
0444   
)
module_param ( vaio_hack  ,
bool  ,
0444   
)
module_param ( reset_workaround  ,
bool  ,
0444   
)
module_param ( reset_workaround_2  ,
bool  ,
0444   
)
module_param ( enable  ,
bool  ,
0444   
)
MODULE_PARM_DESC ( index  ,
"Index value for "CARD_NAME" soundcard."   
)
MODULE_PARM_DESC ( id  ,
"ID string for "CARD_NAME" soundcard."   
)
MODULE_PARM_DESC ( playback_bufsize  ,
"DAC frame size in kB for "CARD_NAME" soundcard."   
)
MODULE_PARM_DESC ( capture_bufsize  ,
"ADC frame size in kB for "CARD_NAME" soundcard."   
)
MODULE_PARM_DESC ( force_ac97  ,
"Force to use AC97 codec for "CARD_NAME" soundcard."   
)
MODULE_PARM_DESC ( buffer_top  ,
"Set the top address of audio buffer for "CARD_NAME" soundcard."   
)
MODULE_PARM_DESC ( use_cache  ,
"Enable the cache for coefficient table access."   
)
MODULE_PARM_DESC ( vaio_hack  ,
"Enable workaround for Sony VAIO notebooks."   
)
MODULE_PARM_DESC ( reset_workaround  ,
"Enable AC97 RESET workaround for some laptops."   
)
MODULE_PARM_DESC ( reset_workaround_2  ,
"Enable extended AC97 RESET workaround for some other laptops."   
)
module_pci_driver ( nm256_driver  )
MODULE_SUPPORTED_DEVICE ( "{{NeoMagic,NM256AV},""{NeoMagic,NM256ZX}}"  )