Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ali5451.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/dma-mapping.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
#include <sound/ac97_codec.h>
#include <sound/mpu401.h>
#include <sound/initval.h>

Go to the source code of this file.

Data Structures

struct  snd_ali_channel_control
 
struct  snd_ali_channel_control::REGDATA
 
struct  snd_ali_channel_control::REGS
 
struct  snd_ali_voice
 
struct  snd_alidev
 
struct  snd_ali_image
 
struct  snd_ali
 
struct  ali_pcm_description
 

Macros

#define snd_ali_printk(format, args...)
 
#define DEVICE_ID_ALI5451   ((PCI_VENDOR_ID_AL<<16)|PCI_DEVICE_ID_AL_M5451)
 
#define ALI_CHANNELS   32
 
#define ALI_PCM_IN_CHANNEL   31
 
#define ALI_SPDIF_IN_CHANNEL   19
 
#define ALI_SPDIF_OUT_CHANNEL   15
 
#define ALI_CENTER_CHANNEL   24
 
#define ALI_LEF_CHANNEL   23
 
#define ALI_SURR_LEFT_CHANNEL   26
 
#define ALI_SURR_RIGHT_CHANNEL   25
 
#define ALI_MODEM_IN_CHANNEL   21
 
#define ALI_MODEM_OUT_CHANNEL   20
 
#define SNDRV_ALI_VOICE_TYPE_PCM   01
 
#define SNDRV_ALI_VOICE_TYPE_OTH   02
 
#define ALI_5451_V02   0x02
 
#define ALI_LEGACY_DMAR0   0x00 /* ADR0 */
 
#define ALI_LEGACY_DMAR4   0x04 /* CNT0 */
 
#define ALI_LEGACY_DMAR11   0x0b /* MOD */
 
#define ALI_LEGACY_DMAR15   0x0f /* MMR */
 
#define ALI_MPUR0   0x20
 
#define ALI_MPUR1   0x21
 
#define ALI_MPUR2   0x22
 
#define ALI_MPUR3   0x23
 
#define ALI_AC97_WRITE   0x40
 
#define ALI_AC97_READ   0x44
 
#define ALI_SCTRL   0x48
 
#define ALI_SPDIF_OUT_ENABLE   0x20
 
#define ALI_SCTRL_LINE_IN2   (1 << 9)
 
#define ALI_SCTRL_GPIO_IN2   (1 << 13)
 
#define ALI_SCTRL_LINE_OUT_EN   (1 << 20)
 
#define ALI_SCTRL_GPIO_OUT_EN   (1 << 23)
 
#define ALI_SCTRL_CODEC1_READY   (1 << 24)
 
#define ALI_SCTRL_CODEC2_READY   (1 << 25)
 
#define ALI_AC97_GPIO   0x4c
 
#define ALI_AC97_GPIO_ENABLE   0x8000
 
#define ALI_AC97_GPIO_DATA_SHIFT   16
 
#define ALI_SPDIF_CS   0x70
 
#define ALI_SPDIF_CTRL   0x74
 
#define ALI_SPDIF_IN_FUNC_ENABLE   0x02
 
#define ALI_SPDIF_IN_CH_STATUS   0x40
 
#define ALI_SPDIF_OUT_CH_STATUS   0xbf
 
#define ALI_START   0x80
 
#define ALI_STOP   0x84
 
#define ALI_CSPF   0x90
 
#define ALI_AINT   0x98
 
#define ALI_GC_CIR   0xa0
 
#define ENDLP_IE   0x00001000
 
#define MIDLP_IE   0x00002000
 
#define ALI_AINTEN   0xa4
 
#define ALI_VOLUME   0xa8
 
#define ALI_SBDELTA_DELTA_R   0xac
 
#define ALI_MISCINT   0xb0
 
#define ADDRESS_IRQ   0x00000020
 
#define TARGET_REACHED   0x00008000
 
#define MIXER_OVERFLOW   0x00000800
 
#define MIXER_UNDERFLOW   0x00000400
 
#define GPIO_IRQ   0x01000000
 
#define ALI_SBBL_SBCL   0xc0
 
#define ALI_SBCTRL_SBE2R_SBDD   0xc4
 
#define ALI_STIMER   0xc8
 
#define ALI_GLOBAL_CONTROL   0xd4
 
#define ALI_SPDIF_OUT_SEL_PCM   0x00000400 /* bit 10 */
 
#define ALI_SPDIF_IN_SUPPORT   0x00000800 /* bit 11 */
 
#define ALI_SPDIF_OUT_CH_ENABLE   0x00008000 /* bit 15 */
 
#define ALI_SPDIF_IN_CH_ENABLE   0x00080000 /* bit 19 */
 
#define ALI_PCM_IN_ENABLE   0x80000000 /* bit 31 */
 
#define ALI_CSO_ALPHA_FMS   0xe0
 
#define ALI_LBA   0xe4
 
#define ALI_ESO_DELTA   0xe8
 
#define ALI_GVSEL_PAN_VOC_CTRL_EC   0xf0
 
#define ALI_EBUF1   0xf4
 
#define ALI_EBUF2   0xf8
 
#define ALI_REG(codec, x)   ((codec)->port + x)
 
#define MAX_CODECS   2
 
#define ALI_GLOBAL_REGS   56
 
#define ALI_CHANNEL_REGS   8
 
#define ALI5451_SPDIF(xname, xindex, value)
 
#define snd_ali5451_spdif_info   snd_ctl_boolean_mono_info
 
#define ALI_PM_OPS   NULL
 

Functions

 MODULE_AUTHOR ("Matt Wu <[email protected]>")
 
 MODULE_DESCRIPTION ("ALI M5451")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("{{ALI,M5451,pci},{ALI,M5451}}")
 
 module_param (index, int, 0444)
 
 MODULE_PARM_DESC (index,"Index value for ALI M5451 PCI Audio.")
 
 module_param (id, charp, 0444)
 
 MODULE_PARM_DESC (id,"ID string for ALI M5451 PCI Audio.")
 
 module_param (pcm_channels, int, 0444)
 
 MODULE_PARM_DESC (pcm_channels,"PCM Channels")
 
 module_param (spdif, bool, 0444)
 
 MODULE_PARM_DESC (spdif,"Support SPDIF I/O")
 
 module_param (enable, bool, 0444)
 
 MODULE_DEVICE_TABLE (pci, snd_ali_ids)
 
 module_pci_driver (ali5451_driver)
 

Macro Definition Documentation

#define ADDRESS_IRQ   0x00000020

Definition at line 146 of file ali5451.c.

#define ALI5451_SPDIF (   xname,
  xindex,
  value 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex,\
.info = snd_ali5451_spdif_info, .get = snd_ali5451_spdif_get, \
.put = snd_ali5451_spdif_put, .private_value = value}

Definition at line 1742 of file ali5451.c.

#define ALI_5451_V02   0x02

Definition at line 101 of file ali5451.c.

#define ALI_AC97_GPIO   0x4c

Definition at line 127 of file ali5451.c.

#define ALI_AC97_GPIO_DATA_SHIFT   16

Definition at line 129 of file ali5451.c.

#define ALI_AC97_GPIO_ENABLE   0x8000

Definition at line 128 of file ali5451.c.

#define ALI_AC97_READ   0x44

Definition at line 117 of file ali5451.c.

#define ALI_AC97_WRITE   0x40

Definition at line 116 of file ali5451.c.

#define ALI_AINT   0x98

Definition at line 138 of file ali5451.c.

#define ALI_AINTEN   0xa4

Definition at line 142 of file ali5451.c.

#define ALI_CENTER_CHANNEL   24

Definition at line 91 of file ali5451.c.

#define ALI_CHANNEL_REGS   8

Definition at line 233 of file ali5451.c.

#define ALI_CHANNELS   32

Definition at line 86 of file ali5451.c.

#define ALI_CSO_ALPHA_FMS   0xe0

Definition at line 161 of file ali5451.c.

#define ALI_CSPF   0x90

Definition at line 137 of file ali5451.c.

#define ALI_EBUF1   0xf4

Definition at line 165 of file ali5451.c.

#define ALI_EBUF2   0xf8

Definition at line 166 of file ali5451.c.

#define ALI_ESO_DELTA   0xe8

Definition at line 163 of file ali5451.c.

#define ALI_GC_CIR   0xa0

Definition at line 139 of file ali5451.c.

#define ALI_GLOBAL_CONTROL   0xd4

Definition at line 154 of file ali5451.c.

#define ALI_GLOBAL_REGS   56

Definition at line 232 of file ali5451.c.

#define ALI_GVSEL_PAN_VOC_CTRL_EC   0xf0

Definition at line 164 of file ali5451.c.

#define ALI_LBA   0xe4

Definition at line 162 of file ali5451.c.

#define ALI_LEF_CHANNEL   23

Definition at line 92 of file ali5451.c.

#define ALI_LEGACY_DMAR0   0x00 /* ADR0 */

Definition at line 107 of file ali5451.c.

#define ALI_LEGACY_DMAR11   0x0b /* MOD */

Definition at line 109 of file ali5451.c.

#define ALI_LEGACY_DMAR15   0x0f /* MMR */

Definition at line 110 of file ali5451.c.

#define ALI_LEGACY_DMAR4   0x04 /* CNT0 */

Definition at line 108 of file ali5451.c.

#define ALI_MISCINT   0xb0

Definition at line 145 of file ali5451.c.

#define ALI_MODEM_IN_CHANNEL   21

Definition at line 95 of file ali5451.c.

#define ALI_MODEM_OUT_CHANNEL   20

Definition at line 96 of file ali5451.c.

#define ALI_MPUR0   0x20

Definition at line 111 of file ali5451.c.

#define ALI_MPUR1   0x21

Definition at line 112 of file ali5451.c.

#define ALI_MPUR2   0x22

Definition at line 113 of file ali5451.c.

#define ALI_MPUR3   0x23

Definition at line 114 of file ali5451.c.

#define ALI_PCM_IN_CHANNEL   31

Definition at line 88 of file ali5451.c.

#define ALI_PCM_IN_ENABLE   0x80000000 /* bit 31 */

Definition at line 159 of file ali5451.c.

#define ALI_PM_OPS   NULL

Definition at line 1991 of file ali5451.c.

#define ALI_REG (   codec,
  x 
)    ((codec)->port + x)

Definition at line 168 of file ali5451.c.

#define ALI_SBBL_SBCL   0xc0

Definition at line 151 of file ali5451.c.

#define ALI_SBCTRL_SBE2R_SBDD   0xc4

Definition at line 152 of file ali5451.c.

#define ALI_SBDELTA_DELTA_R   0xac

Definition at line 144 of file ali5451.c.

#define ALI_SCTRL   0x48

Definition at line 119 of file ali5451.c.

#define ALI_SCTRL_CODEC1_READY   (1 << 24)

Definition at line 125 of file ali5451.c.

#define ALI_SCTRL_CODEC2_READY   (1 << 25)

Definition at line 126 of file ali5451.c.

#define ALI_SCTRL_GPIO_IN2   (1 << 13)

Definition at line 122 of file ali5451.c.

#define ALI_SCTRL_GPIO_OUT_EN   (1 << 23)

Definition at line 124 of file ali5451.c.

#define ALI_SCTRL_LINE_IN2   (1 << 9)

Definition at line 121 of file ali5451.c.

#define ALI_SCTRL_LINE_OUT_EN   (1 << 20)

Definition at line 123 of file ali5451.c.

#define ALI_SPDIF_CS   0x70

Definition at line 130 of file ali5451.c.

#define ALI_SPDIF_CTRL   0x74

Definition at line 131 of file ali5451.c.

#define ALI_SPDIF_IN_CH_ENABLE   0x00080000 /* bit 19 */

Definition at line 158 of file ali5451.c.

#define ALI_SPDIF_IN_CH_STATUS   0x40

Definition at line 133 of file ali5451.c.

#define ALI_SPDIF_IN_CHANNEL   19

Definition at line 89 of file ali5451.c.

#define ALI_SPDIF_IN_FUNC_ENABLE   0x02

Definition at line 132 of file ali5451.c.

#define ALI_SPDIF_IN_SUPPORT   0x00000800 /* bit 11 */

Definition at line 156 of file ali5451.c.

#define ALI_SPDIF_OUT_CH_ENABLE   0x00008000 /* bit 15 */

Definition at line 157 of file ali5451.c.

#define ALI_SPDIF_OUT_CH_STATUS   0xbf

Definition at line 134 of file ali5451.c.

#define ALI_SPDIF_OUT_CHANNEL   15

Definition at line 90 of file ali5451.c.

#define ALI_SPDIF_OUT_ENABLE   0x20

Definition at line 120 of file ali5451.c.

#define ALI_SPDIF_OUT_SEL_PCM   0x00000400 /* bit 10 */

Definition at line 155 of file ali5451.c.

#define ALI_START   0x80

Definition at line 135 of file ali5451.c.

#define ALI_STIMER   0xc8

Definition at line 153 of file ali5451.c.

#define ALI_STOP   0x84

Definition at line 136 of file ali5451.c.

#define ALI_SURR_LEFT_CHANNEL   26

Definition at line 93 of file ali5451.c.

#define ALI_SURR_RIGHT_CHANNEL   25

Definition at line 94 of file ali5451.c.

#define ALI_VOLUME   0xa8

Definition at line 143 of file ali5451.c.

#define DEVICE_ID_ALI5451   ((PCI_VENDOR_ID_AL<<16)|PCI_DEVICE_ID_AL_M5451)

Definition at line 83 of file ali5451.c.

#define ENDLP_IE   0x00001000

Definition at line 140 of file ali5451.c.

#define GPIO_IRQ   0x01000000

Definition at line 150 of file ali5451.c.

#define MAX_CODECS   2

Definition at line 170 of file ali5451.c.

#define MIDLP_IE   0x00002000

Definition at line 141 of file ali5451.c.

#define MIXER_OVERFLOW   0x00000800

Definition at line 148 of file ali5451.c.

#define MIXER_UNDERFLOW   0x00000400

Definition at line 149 of file ali5451.c.

#define snd_ali5451_spdif_info   snd_ctl_boolean_mono_info

Definition at line 1747 of file ali5451.c.

#define snd_ali_printk (   format,
  args... 
)

Definition at line 76 of file ali5451.c.

#define SNDRV_ALI_VOICE_TYPE_OTH   02

Definition at line 99 of file ali5451.c.

#define SNDRV_ALI_VOICE_TYPE_PCM   01

Definition at line 98 of file ali5451.c.

#define TARGET_REACHED   0x00008000

Definition at line 147 of file ali5451.c.

Function Documentation

MODULE_AUTHOR ( "Matt Wu <[email protected]>"  )
MODULE_DESCRIPTION ( "ALI M5451"  )
MODULE_DEVICE_TABLE ( pci  ,
snd_ali_ids   
)
MODULE_LICENSE ( "GPL"  )
module_param ( index  ,
int  ,
0444   
)
module_param ( id  ,
charp  ,
0444   
)
module_param ( pcm_channels  ,
int  ,
0444   
)
module_param ( spdif  ,
bool  ,
0444   
)
module_param ( enable  ,
bool  ,
0444   
)
MODULE_PARM_DESC ( index  ,
"Index value for ALI M5451 PCI Audio."   
)
MODULE_PARM_DESC ( id  ,
"ID string for ALI M5451 PCI Audio."   
)
MODULE_PARM_DESC ( pcm_channels  ,
"PCM Channels"   
)
MODULE_PARM_DESC ( spdif  ,
"Support SPDIF I/O"   
)
module_pci_driver ( ali5451_driver  )
MODULE_SUPPORTED_DEVICE ( "{{ALI,M5451,pci},{ALI,M5451}}"  )