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

Go to the source code of this file.

Data Structures

struct  fm801
 

Macros

#define TUNER_DISABLED   (1<<3)
 
#define TUNER_ONLY   (1<<4)
 
#define TUNER_TYPE_MASK   (~TUNER_ONLY & 0xFFFF)
 
#define FM801_REG(chip, reg)   (chip->port + FM801_##reg)
 
#define FM801_PCM_VOL   0x00 /* PCM Output Volume */
 
#define FM801_FM_VOL   0x02 /* FM Output Volume */
 
#define FM801_I2S_VOL   0x04 /* I2S Volume */
 
#define FM801_REC_SRC   0x06 /* Record Source */
 
#define FM801_PLY_CTRL   0x08 /* Playback Control */
 
#define FM801_PLY_COUNT   0x0a /* Playback Count */
 
#define FM801_PLY_BUF1   0x0c /* Playback Bufer I */
 
#define FM801_PLY_BUF2   0x10 /* Playback Buffer II */
 
#define FM801_CAP_CTRL   0x14 /* Capture Control */
 
#define FM801_CAP_COUNT   0x16 /* Capture Count */
 
#define FM801_CAP_BUF1   0x18 /* Capture Buffer I */
 
#define FM801_CAP_BUF2   0x1c /* Capture Buffer II */
 
#define FM801_CODEC_CTRL   0x22 /* Codec Control */
 
#define FM801_I2S_MODE   0x24 /* I2S Mode Control */
 
#define FM801_VOLUME   0x26 /* Volume Up/Down/Mute Status */
 
#define FM801_I2C_CTRL   0x29 /* I2C Control */
 
#define FM801_AC97_CMD   0x2a /* AC'97 Command */
 
#define FM801_AC97_DATA   0x2c /* AC'97 Data */
 
#define FM801_MPU401_DATA   0x30 /* MPU401 Data */
 
#define FM801_MPU401_CMD   0x31 /* MPU401 Command */
 
#define FM801_GPIO_CTRL   0x52 /* General Purpose I/O Control */
 
#define FM801_GEN_CTRL   0x54 /* General Control */
 
#define FM801_IRQ_MASK   0x56 /* Interrupt Mask */
 
#define FM801_IRQ_STATUS   0x5a /* Interrupt Status */
 
#define FM801_OPL3_BANK0   0x68 /* OPL3 Status Read / Bank 0 Write */
 
#define FM801_OPL3_DATA0   0x69 /* OPL3 Data 0 Write */
 
#define FM801_OPL3_BANK1   0x6a /* OPL3 Bank 1 Write */
 
#define FM801_OPL3_DATA1   0x6b /* OPL3 Bank 1 Write */
 
#define FM801_POWERDOWN   0x70 /* Blocks Power Down Control */
 
#define FM801_AC97_READ   (1<<7) /* read=1, write=0 */
 
#define FM801_AC97_VALID   (1<<8) /* port valid=1 */
 
#define FM801_AC97_BUSY   (1<<9) /* busy=1 */
 
#define FM801_AC97_ADDR_SHIFT   10 /* codec id (2bit) */
 
#define FM801_BUF1_LAST   (1<<1)
 
#define FM801_BUF2_LAST   (1<<2)
 
#define FM801_START   (1<<5)
 
#define FM801_PAUSE   (1<<6)
 
#define FM801_IMMED_STOP   (1<<7)
 
#define FM801_RATE_SHIFT   8
 
#define FM801_RATE_MASK   (15 << FM801_RATE_SHIFT)
 
#define FM801_CHANNELS_4   (1<<12) /* playback only */
 
#define FM801_CHANNELS_6   (2<<12) /* playback only */
 
#define FM801_CHANNELS_6MS   (3<<12) /* playback only */
 
#define FM801_CHANNELS_MASK   (3<<12)
 
#define FM801_16BIT   (1<<14)
 
#define FM801_STEREO   (1<<15)
 
#define FM801_IRQ_PLAYBACK   (1<<8)
 
#define FM801_IRQ_CAPTURE   (1<<9)
 
#define FM801_IRQ_VOLUME   (1<<14)
 
#define FM801_IRQ_MPU   (1<<15)
 
#define FM801_GPIO_GP0   (1<<0) /* read/write */
 
#define FM801_GPIO_GP1   (1<<1)
 
#define FM801_GPIO_GP2   (1<<2)
 
#define FM801_GPIO_GP3   (1<<3)
 
#define FM801_GPIO_GP(x)   (1<<(0+(x)))
 
#define FM801_GPIO_GD0   (1<<8) /* directions: 1 = input, 0 = output*/
 
#define FM801_GPIO_GD1   (1<<9)
 
#define FM801_GPIO_GD2   (1<<10)
 
#define FM801_GPIO_GD3   (1<<11)
 
#define FM801_GPIO_GD(x)   (1<<(8+(x)))
 
#define FM801_GPIO_GS0   (1<<12) /* function select: */
 
#define FM801_GPIO_GS1   (1<<13) /* 1 = GPIO */
 
#define FM801_GPIO_GS2   (1<<14) /* 0 = other (S/PDIF, VOL) */
 
#define FM801_GPIO_GS3   (1<<15)
 
#define FM801_GPIO_GS(x)   (1<<(12+(x)))
 
#define FM801_SINGLE(xname, reg, shift, mask, invert)
 
#define FM801_DOUBLE(xname, reg, shift_left, shift_right, mask, invert)
 
#define FM801_DOUBLE_TLV(xname, reg, shift_left, shift_right, mask, invert, xtlv)
 
#define FM801_CONTROLS   ARRAY_SIZE(snd_fm801_controls)
 
#define FM801_CONTROLS_MULTI   ARRAY_SIZE(snd_fm801_controls_multi)
 
#define SND_FM801_PM_OPS   NULL
 

Functions

 MODULE_AUTHOR ("Jaroslav Kysela <[email protected]>")
 
 MODULE_DESCRIPTION ("ForteMedia FM801")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("{{ForteMedia,FM801},""{Genius,SoundMaker Live 5.1}}")
 
 module_param_array (index, int, NULL, 0444)
 
 MODULE_PARM_DESC (index,"Index value for the FM801 soundcard.")
 
 module_param_array (id, charp, NULL, 0444)
 
 MODULE_PARM_DESC (id,"ID string for the FM801 soundcard.")
 
 module_param_array (enable, bool, NULL, 0444)
 
 MODULE_PARM_DESC (enable,"Enable FM801 soundcard.")
 
 module_param_array (tea575x_tuner, int, NULL, 0444)
 
 MODULE_PARM_DESC (tea575x_tuner,"TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only).")
 
 module_param_array (radio_nr, int, NULL, 0444)
 
 MODULE_PARM_DESC (radio_nr,"Radio device numbers")
 
 MODULE_DEVICE_TABLE (pci, snd_fm801_ids)
 
 module_pci_driver (fm801_driver)
 

Macro Definition Documentation

#define FM801_16BIT   (1<<14)

Definition at line 133 of file fm801.c.

#define FM801_AC97_ADDR_SHIFT   10 /* codec id (2bit) */

Definition at line 119 of file fm801.c.

#define FM801_AC97_BUSY   (1<<9) /* busy=1 */

Definition at line 118 of file fm801.c.

#define FM801_AC97_CMD   0x2a /* AC'97 Command */

Definition at line 101 of file fm801.c.

#define FM801_AC97_DATA   0x2c /* AC'97 Data */

Definition at line 102 of file fm801.c.

#define FM801_AC97_READ   (1<<7) /* read=1, write=0 */

Definition at line 116 of file fm801.c.

#define FM801_AC97_VALID   (1<<8) /* port valid=1 */

Definition at line 117 of file fm801.c.

#define FM801_BUF1_LAST   (1<<1)

Definition at line 122 of file fm801.c.

#define FM801_BUF2_LAST   (1<<2)

Definition at line 123 of file fm801.c.

#define FM801_CAP_BUF1   0x18 /* Capture Buffer I */

Definition at line 95 of file fm801.c.

#define FM801_CAP_BUF2   0x1c /* Capture Buffer II */

Definition at line 96 of file fm801.c.

#define FM801_CAP_COUNT   0x16 /* Capture Count */

Definition at line 94 of file fm801.c.

#define FM801_CAP_CTRL   0x14 /* Capture Control */

Definition at line 93 of file fm801.c.

#define FM801_CHANNELS_4   (1<<12) /* playback only */

Definition at line 129 of file fm801.c.

#define FM801_CHANNELS_6   (2<<12) /* playback only */

Definition at line 130 of file fm801.c.

#define FM801_CHANNELS_6MS   (3<<12) /* playback only */

Definition at line 131 of file fm801.c.

#define FM801_CHANNELS_MASK   (3<<12)

Definition at line 132 of file fm801.c.

#define FM801_CODEC_CTRL   0x22 /* Codec Control */

Definition at line 97 of file fm801.c.

#define FM801_CONTROLS   ARRAY_SIZE(snd_fm801_controls)

Definition at line 985 of file fm801.c.

#define FM801_CONTROLS_MULTI   ARRAY_SIZE(snd_fm801_controls_multi)

Definition at line 1006 of file fm801.c.

#define FM801_DOUBLE (   xname,
  reg,
  shift_left,
  shift_right,
  mask,
  invert 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_fm801_info_double, \
.get = snd_fm801_get_double, .put = snd_fm801_put_double, \
.private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) }

Definition at line 876 of file fm801.c.

#define FM801_DOUBLE_TLV (   xname,
  reg,
  shift_left,
  shift_right,
  mask,
  invert,
  xtlv 
)
Value:
.name = xname, .info = snd_fm801_info_double, \
.get = snd_fm801_get_double, .put = snd_fm801_put_double, \
.private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24), \
.tlv = { .p = (xtlv) } }

Definition at line 880 of file fm801.c.

#define FM801_FM_VOL   0x02 /* FM Output Volume */

Definition at line 86 of file fm801.c.

#define FM801_GEN_CTRL   0x54 /* General Control */

Definition at line 106 of file fm801.c.

#define FM801_GPIO_CTRL   0x52 /* General Purpose I/O Control */

Definition at line 105 of file fm801.c.

#define FM801_GPIO_GD (   x)    (1<<(8+(x)))

Definition at line 152 of file fm801.c.

#define FM801_GPIO_GD0   (1<<8) /* directions: 1 = input, 0 = output*/

Definition at line 148 of file fm801.c.

#define FM801_GPIO_GD1   (1<<9)

Definition at line 149 of file fm801.c.

#define FM801_GPIO_GD2   (1<<10)

Definition at line 150 of file fm801.c.

#define FM801_GPIO_GD3   (1<<11)

Definition at line 151 of file fm801.c.

#define FM801_GPIO_GP (   x)    (1<<(0+(x)))

Definition at line 147 of file fm801.c.

#define FM801_GPIO_GP0   (1<<0) /* read/write */

Definition at line 143 of file fm801.c.

#define FM801_GPIO_GP1   (1<<1)

Definition at line 144 of file fm801.c.

#define FM801_GPIO_GP2   (1<<2)

Definition at line 145 of file fm801.c.

#define FM801_GPIO_GP3   (1<<3)

Definition at line 146 of file fm801.c.

#define FM801_GPIO_GS (   x)    (1<<(12+(x)))

Definition at line 157 of file fm801.c.

#define FM801_GPIO_GS0   (1<<12) /* function select: */

Definition at line 153 of file fm801.c.

#define FM801_GPIO_GS1   (1<<13) /* 1 = GPIO */

Definition at line 154 of file fm801.c.

#define FM801_GPIO_GS2   (1<<14) /* 0 = other (S/PDIF, VOL) */

Definition at line 155 of file fm801.c.

#define FM801_GPIO_GS3   (1<<15)

Definition at line 156 of file fm801.c.

#define FM801_I2C_CTRL   0x29 /* I2C Control */

Definition at line 100 of file fm801.c.

#define FM801_I2S_MODE   0x24 /* I2S Mode Control */

Definition at line 98 of file fm801.c.

#define FM801_I2S_VOL   0x04 /* I2S Volume */

Definition at line 87 of file fm801.c.

#define FM801_IMMED_STOP   (1<<7)

Definition at line 126 of file fm801.c.

#define FM801_IRQ_CAPTURE   (1<<9)

Definition at line 138 of file fm801.c.

#define FM801_IRQ_MASK   0x56 /* Interrupt Mask */

Definition at line 107 of file fm801.c.

#define FM801_IRQ_MPU   (1<<15)

Definition at line 140 of file fm801.c.

#define FM801_IRQ_PLAYBACK   (1<<8)

Definition at line 137 of file fm801.c.

#define FM801_IRQ_STATUS   0x5a /* Interrupt Status */

Definition at line 108 of file fm801.c.

#define FM801_IRQ_VOLUME   (1<<14)

Definition at line 139 of file fm801.c.

#define FM801_MPU401_CMD   0x31 /* MPU401 Command */

Definition at line 104 of file fm801.c.

#define FM801_MPU401_DATA   0x30 /* MPU401 Data */

Definition at line 103 of file fm801.c.

#define FM801_OPL3_BANK0   0x68 /* OPL3 Status Read / Bank 0 Write */

Definition at line 109 of file fm801.c.

#define FM801_OPL3_BANK1   0x6a /* OPL3 Bank 1 Write */

Definition at line 111 of file fm801.c.

#define FM801_OPL3_DATA0   0x69 /* OPL3 Data 0 Write */

Definition at line 110 of file fm801.c.

#define FM801_OPL3_DATA1   0x6b /* OPL3 Bank 1 Write */

Definition at line 112 of file fm801.c.

#define FM801_PAUSE   (1<<6)

Definition at line 125 of file fm801.c.

#define FM801_PCM_VOL   0x00 /* PCM Output Volume */

Definition at line 85 of file fm801.c.

#define FM801_PLY_BUF1   0x0c /* Playback Bufer I */

Definition at line 91 of file fm801.c.

#define FM801_PLY_BUF2   0x10 /* Playback Buffer II */

Definition at line 92 of file fm801.c.

#define FM801_PLY_COUNT   0x0a /* Playback Count */

Definition at line 90 of file fm801.c.

#define FM801_PLY_CTRL   0x08 /* Playback Control */

Definition at line 89 of file fm801.c.

#define FM801_POWERDOWN   0x70 /* Blocks Power Down Control */

Definition at line 113 of file fm801.c.

#define FM801_RATE_MASK   (15 << FM801_RATE_SHIFT)

Definition at line 128 of file fm801.c.

#define FM801_RATE_SHIFT   8

Definition at line 127 of file fm801.c.

#define FM801_REC_SRC   0x06 /* Record Source */

Definition at line 88 of file fm801.c.

#define FM801_REG (   chip,
  reg 
)    (chip->port + FM801_##reg)

Definition at line 83 of file fm801.c.

#define FM801_SINGLE (   xname,
  reg,
  shift,
  mask,
  invert 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_fm801_info_single, \
.get = snd_fm801_get_single, .put = snd_fm801_put_single, \
.private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }

Definition at line 828 of file fm801.c.

#define FM801_START   (1<<5)

Definition at line 124 of file fm801.c.

#define FM801_STEREO   (1<<15)

Definition at line 134 of file fm801.c.

#define FM801_VOLUME   0x26 /* Volume Up/Down/Mute Status */

Definition at line 99 of file fm801.c.

#define SND_FM801_PM_OPS   NULL

Definition at line 1435 of file fm801.c.

#define TUNER_DISABLED   (1<<3)

Definition at line 75 of file fm801.c.

#define TUNER_ONLY   (1<<4)

Definition at line 76 of file fm801.c.

#define TUNER_TYPE_MASK   (~TUNER_ONLY & 0xFFFF)

Definition at line 77 of file fm801.c.

Function Documentation

MODULE_AUTHOR ( "Jaroslav Kysela <[email protected]>"  )
MODULE_DESCRIPTION ( "ForteMedia FM801"  )
MODULE_DEVICE_TABLE ( pci  ,
snd_fm801_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_param_array ( tea575x_tuner  ,
int  ,
NULL  ,
0444   
)
module_param_array ( radio_nr  ,
int  ,
NULL  ,
0444   
)
MODULE_PARM_DESC ( index  ,
"Index value for the FM801 soundcard."   
)
MODULE_PARM_DESC ( id  ,
"ID string for the FM801 soundcard."   
)
MODULE_PARM_DESC ( enable  ,
"Enable FM801 soundcard."   
)
MODULE_PARM_DESC ( tea575x_tuner  ,
"TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only)."   
)
MODULE_PARM_DESC ( radio_nr  ,
"Radio device numbers"   
)
module_pci_driver ( fm801_driver  )
MODULE_SUPPORTED_DEVICE ( "{{ForteMedia,FM801},""{Genius,SoundMaker Live 5.1}}"  )