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

Go to the source code of this file.

Data Structures

struct  snd_rme9652
 

Macros

#define RME9652_NCHANNELS   26
 
#define RME9636_NCHANNELS   18
 
#define RME9652_SYNC_FROM_SPDIF   0
 
#define RME9652_SYNC_FROM_ADAT1   1
 
#define RME9652_SYNC_FROM_ADAT2   2
 
#define RME9652_SYNC_FROM_ADAT3   3
 
#define RME9652_SPDIFIN_OPTICAL   0 /* optical (ADAT1) */
 
#define RME9652_SPDIFIN_COAXIAL   1 /* coaxial (RCA) */
 
#define RME9652_SPDIFIN_INTERN   2 /* internal (CDROM) */
 
#define RME9652_IRQ   (1<<0) /* IRQ is High if not reset by irq_clear */
 
#define RME9652_lock_2   (1<<1) /* ADAT 3-PLL: 1=locked, 0=unlocked */
 
#define RME9652_lock_1   (1<<2) /* ADAT 2-PLL: 1=locked, 0=unlocked */
 
#define RME9652_lock_0   (1<<3) /* ADAT 1-PLL: 1=locked, 0=unlocked */
 
#define RME9652_fs48   (1<<4) /* sample rate is 0=44.1/88.2,1=48/96 Khz */
 
#define RME9652_wsel_rd   (1<<5) /* if Word-Clock is used and valid then 1 */
 
#define RME9652_sync_2   (1<<16) /* if ADAT-IN 3 in sync to system clock */
 
#define RME9652_sync_1   (1<<17) /* if ADAT-IN 2 in sync to system clock */
 
#define RME9652_sync_0   (1<<18) /* if ADAT-IN 1 in sync to system clock */
 
#define RME9652_DS_rd   (1<<19) /* 1=Double Speed Mode, 0=Normal Speed */
 
#define RME9652_tc_busy   (1<<20) /* 1=time-code copy in progress (960ms) */
 
#define RME9652_tc_out   (1<<21) /* time-code out bit */
 
#define RME9652_F_0   (1<<22) /* 000=64kHz, 100=88.2kHz, 011=96kHz */
 
#define RME9652_F_1   (1<<23) /* 111=32kHz, 110=44.1kHz, 101=48kHz, */
 
#define RME9652_F_2   (1<<24) /* external Crystal Chip if ERF=1 */
 
#define RME9652_ERF   (1<<25) /* Error-Flag of SDPIF Receiver (1=No Lock) */
 
#define RME9652_buffer_id   (1<<26) /* toggles by each interrupt on rec/play */
 
#define RME9652_tc_valid   (1<<27) /* 1 = a signal is detected on time-code input */
 
#define RME9652_SPDIF_READ   (1<<28) /* byte available from Rev 1.5+ S/PDIF interface */
 
#define RME9652_sync   (RME9652_sync_0|RME9652_sync_1|RME9652_sync_2)
 
#define RME9652_lock   (RME9652_lock_0|RME9652_lock_1|RME9652_lock_2)
 
#define RME9652_F   (RME9652_F_0|RME9652_F_1|RME9652_F_2)
 
#define rme9652_decode_spdif_rate(x)   ((x)>>22)
 
#define RME9652_buf_pos   0x000FFC0
 
#define RME9652_REV15_buf_pos(x)   ((((x)&0xE0000000)>>26)|((x)&RME9652_buf_pos))
 
#define RME9652_IO_EXTENT   1024
 
#define RME9652_init_buffer   0
 
#define RME9652_play_buffer   32 /* holds ptr to 26x64kBit host RAM */
 
#define RME9652_rec_buffer   36 /* holds ptr to 26x64kBit host RAM */
 
#define RME9652_control_register   64
 
#define RME9652_irq_clear   96
 
#define RME9652_time_code   100 /* useful if used with alesis adat */
 
#define RME9652_thru_base   128 /* 132...228 Thru for 26 channels */
 
#define RME9652_status_register   0
 
#define RME9652_start_bit   (1<<0) /* start record/play */
 
#define RME9652_Master   (1<<4) /* Clock Mode Master=1,Slave/Auto=0 */
 
#define RME9652_IE   (1<<5) /* Interrupt Enable */
 
#define RME9652_freq   (1<<6) /* samplerate 0=44.1/88.2, 1=48/96 kHz */
 
#define RME9652_freq1   (1<<7) /* if 0, 32kHz, else always 1 */
 
#define RME9652_DS   (1<<8) /* Doule Speed 0=44.1/48, 1=88.2/96 Khz */
 
#define RME9652_PRO   (1<<9) /* S/PDIF out: 0=consumer, 1=professional */
 
#define RME9652_EMP   (1<<10) /* Emphasis 0=None, 1=ON */
 
#define RME9652_Dolby   (1<<11) /* Non-audio bit 1=set, 0=unset */
 
#define RME9652_opt_out   (1<<12) /* Use 1st optical OUT as SPDIF: 1=yes,0=no */
 
#define RME9652_wsel   (1<<13) /* use Wordclock as sync (overwrites master) */
 
#define RME9652_inp_0   (1<<14) /* SPDIF-IN: 00=optical (ADAT1), */
 
#define RME9652_inp_1   (1<<15) /* 01=koaxial (Cinch), 10=Internal CDROM */
 
#define RME9652_SyncPref_ADAT2   (1<<16)
 
#define RME9652_SyncPref_ADAT3   (1<<17)
 
#define RME9652_SPDIF_RESET   (1<<18) /* Rev 1.5+: h/w S/PDIF receiver */
 
#define RME9652_SPDIF_SELECT   (1<<19)
 
#define RME9652_SPDIF_CLOCK   (1<<20)
 
#define RME9652_SPDIF_WRITE   (1<<21)
 
#define RME9652_ADAT1_INTERNAL   (1<<22) /* Rev 1.5+: if set, internal CD connector carries ADAT */
 
#define RME9652_latency   0x0e
 
#define rme9652_encode_latency(x)   (((x)&0x7)<<1)
 
#define rme9652_decode_latency(x)   (((x)>>1)&0x7)
 
#define rme9652_running_double_speed(s)   ((s)->control_register & RME9652_DS)
 
#define RME9652_inp   (RME9652_inp_0|RME9652_inp_1)
 
#define rme9652_encode_spdif_in(x)   (((x)&0x3)<<14)
 
#define rme9652_decode_spdif_in(x)   (((x)>>14)&0x3)
 
#define RME9652_SyncPref_Mask   (RME9652_SyncPref_ADAT2|RME9652_SyncPref_ADAT3)
 
#define RME9652_SyncPref_ADAT1   0
 
#define RME9652_SyncPref_SPDIF   (RME9652_SyncPref_ADAT2|RME9652_SyncPref_ADAT3)
 
#define RME9652_CHANNEL_BUFFER_SAMPLES   (16*1024)
 
#define RME9652_CHANNEL_BUFFER_BYTES   (4*RME9652_CHANNEL_BUFFER_SAMPLES)
 
#define RME9652_DMA_AREA_BYTES   ((RME9652_NCHANNELS+1) * RME9652_CHANNEL_BUFFER_BYTES)
 
#define RME9652_DMA_AREA_KILOBYTES   (RME9652_DMA_AREA_BYTES/1024)
 
#define RME9652_ADAT1_IN(xname, xindex)
 
#define RME9652_SPDIF_IN(xname, xindex)
 
#define RME9652_SPDIF_OUT(xname, xindex)
 
#define snd_rme9652_info_spdif_out   snd_ctl_boolean_mono_info
 
#define RME9652_SYNC_MODE(xname, xindex)
 
#define RME9652_SYNC_PREF(xname, xindex)
 
#define RME9652_PASSTHRU(xname, xindex)
 
#define snd_rme9652_info_passthru   snd_ctl_boolean_mono_info
 
#define RME9652_SPDIF_RATE(xname, xindex)
 
#define RME9652_ADAT_SYNC(xname, xindex, xidx)
 
#define RME9652_TC_VALID(xname, xindex)
 
#define snd_rme9652_info_tc_valid   snd_ctl_boolean_mono_info
 

Functions

 module_param_array (index, int, NULL, 0444)
 
 MODULE_PARM_DESC (index,"Index value for RME Digi9652 (Hammerfall) soundcard.")
 
 module_param_array (id, charp, NULL, 0444)
 
 MODULE_PARM_DESC (id,"ID string for RME Digi9652 (Hammerfall) soundcard.")
 
 module_param_array (enable, bool, NULL, 0444)
 
 MODULE_PARM_DESC (enable,"Enable/disable specific RME96{52,36} soundcards.")
 
 module_param_array (precise_ptr, bool, NULL, 0444)
 
 MODULE_PARM_DESC (precise_ptr,"Enable precise pointer (doesn't work reliably).")
 
 MODULE_AUTHOR ("Paul Davis <[email protected]>, Winfried Ritsch")
 
 MODULE_DESCRIPTION ("RME Digi9652/Digi9636")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("{{RME,Hammerfall},""{RME,Hammerfall-Light}}")
 
 MODULE_DEVICE_TABLE (pci, snd_rme9652_ids)
 
 module_pci_driver (rme9652_driver)
 

Macro Definition Documentation

#define RME9636_NCHANNELS   18

Definition at line 68 of file rme9652.c.

#define RME9652_ADAT1_IN (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_rme9652_info_adat1_in, \
.get = snd_rme9652_get_adat1_in, \
.put = snd_rme9652_put_adat1_in }

Definition at line 884 of file rme9652.c.

#define RME9652_ADAT1_INTERNAL   (1<<22) /* Rev 1.5+: if set, internal CD connector carries ADAT */

Definition at line 166 of file rme9652.c.

#define RME9652_ADAT_SYNC (   xname,
  xindex,
  xidx 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_rme9652_info_adat_sync, \
.get = snd_rme9652_get_adat_sync, .private_value = xidx }

Definition at line 1388 of file rme9652.c.

#define RME9652_buf_pos   0x000FFC0

Definition at line 113 of file rme9652.c.

#define RME9652_buffer_id   (1<<26) /* toggles by each interrupt on rec/play */

Definition at line 102 of file rme9652.c.

#define RME9652_CHANNEL_BUFFER_BYTES   (4*RME9652_CHANNEL_BUFFER_SAMPLES)

Definition at line 185 of file rme9652.c.

#define RME9652_CHANNEL_BUFFER_SAMPLES   (16*1024)

Definition at line 184 of file rme9652.c.

#define RME9652_control_register   64

Definition at line 130 of file rme9652.c.

#define rme9652_decode_latency (   x)    (((x)>>1)&0x7)

Definition at line 172 of file rme9652.c.

#define rme9652_decode_spdif_in (   x)    (((x)>>14)&0x3)

Definition at line 176 of file rme9652.c.

#define rme9652_decode_spdif_rate (   x)    ((x)>>22)

Definition at line 109 of file rme9652.c.

#define RME9652_DMA_AREA_BYTES   ((RME9652_NCHANNELS+1) * RME9652_CHANNEL_BUFFER_BYTES)

Definition at line 196 of file rme9652.c.

#define RME9652_DMA_AREA_KILOBYTES   (RME9652_DMA_AREA_BYTES/1024)

Definition at line 197 of file rme9652.c.

#define RME9652_Dolby   (1<<11) /* Non-audio bit 1=set, 0=unset */

Definition at line 155 of file rme9652.c.

#define RME9652_DS   (1<<8) /* Doule Speed 0=44.1/48, 1=88.2/96 Khz */

Definition at line 152 of file rme9652.c.

#define RME9652_DS_rd   (1<<19) /* 1=Double Speed Mode, 0=Normal Speed */

Definition at line 95 of file rme9652.c.

#define RME9652_EMP   (1<<10) /* Emphasis 0=None, 1=ON */

Definition at line 154 of file rme9652.c.

#define rme9652_encode_latency (   x)    (((x)&0x7)<<1)

Definition at line 171 of file rme9652.c.

#define rme9652_encode_spdif_in (   x)    (((x)&0x3)<<14)

Definition at line 175 of file rme9652.c.

#define RME9652_ERF   (1<<25) /* Error-Flag of SDPIF Receiver (1=No Lock) */

Definition at line 101 of file rme9652.c.

#define RME9652_F   (RME9652_F_0|RME9652_F_1|RME9652_F_2)

Definition at line 108 of file rme9652.c.

#define RME9652_F_0   (1<<22) /* 000=64kHz, 100=88.2kHz, 011=96kHz */

Definition at line 98 of file rme9652.c.

#define RME9652_F_1   (1<<23) /* 111=32kHz, 110=44.1kHz, 101=48kHz, */

Definition at line 99 of file rme9652.c.

#define RME9652_F_2   (1<<24) /* external Crystal Chip if ERF=1 */

Definition at line 100 of file rme9652.c.

#define RME9652_freq   (1<<6) /* samplerate 0=44.1/88.2, 1=48/96 kHz */

Definition at line 150 of file rme9652.c.

#define RME9652_freq1   (1<<7) /* if 0, 32kHz, else always 1 */

Definition at line 151 of file rme9652.c.

#define RME9652_fs48   (1<<4) /* sample rate is 0=44.1/88.2,1=48/96 Khz */

Definition at line 89 of file rme9652.c.

#define RME9652_IE   (1<<5) /* Interrupt Enable */

Definition at line 149 of file rme9652.c.

#define RME9652_init_buffer   0

Definition at line 127 of file rme9652.c.

#define RME9652_inp   (RME9652_inp_0|RME9652_inp_1)

Definition at line 174 of file rme9652.c.

#define RME9652_inp_0   (1<<14) /* SPDIF-IN: 00=optical (ADAT1), */

Definition at line 158 of file rme9652.c.

#define RME9652_inp_1   (1<<15) /* 01=koaxial (Cinch), 10=Internal CDROM */

Definition at line 159 of file rme9652.c.

#define RME9652_IO_EXTENT   1024

Definition at line 125 of file rme9652.c.

#define RME9652_IRQ   (1<<0) /* IRQ is High if not reset by irq_clear */

Definition at line 85 of file rme9652.c.

#define RME9652_irq_clear   96

Definition at line 131 of file rme9652.c.

#define RME9652_latency   0x0e

Definition at line 170 of file rme9652.c.

#define RME9652_lock   (RME9652_lock_0|RME9652_lock_1|RME9652_lock_2)

Definition at line 107 of file rme9652.c.

#define RME9652_lock_0   (1<<3) /* ADAT 1-PLL: 1=locked, 0=unlocked */

Definition at line 88 of file rme9652.c.

#define RME9652_lock_1   (1<<2) /* ADAT 2-PLL: 1=locked, 0=unlocked */

Definition at line 87 of file rme9652.c.

#define RME9652_lock_2   (1<<1) /* ADAT 3-PLL: 1=locked, 0=unlocked */

Definition at line 86 of file rme9652.c.

#define RME9652_Master   (1<<4) /* Clock Mode Master=1,Slave/Auto=0 */

Definition at line 148 of file rme9652.c.

#define RME9652_NCHANNELS   26

Definition at line 67 of file rme9652.c.

#define RME9652_opt_out   (1<<12) /* Use 1st optical OUT as SPDIF: 1=yes,0=no */

Definition at line 156 of file rme9652.c.

#define RME9652_PASSTHRU (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.put = snd_rme9652_put_passthru, \
.get = snd_rme9652_get_passthru }

Definition at line 1324 of file rme9652.c.

#define RME9652_play_buffer   32 /* holds ptr to 26x64kBit host RAM */

Definition at line 128 of file rme9652.c.

#define RME9652_PRO   (1<<9) /* S/PDIF out: 0=consumer, 1=professional */

Definition at line 153 of file rme9652.c.

#define RME9652_rec_buffer   36 /* holds ptr to 26x64kBit host RAM */

Definition at line 129 of file rme9652.c.

#define RME9652_REV15_buf_pos (   x)    ((((x)&0xE0000000)>>26)|((x)&RME9652_buf_pos))

Definition at line 119 of file rme9652.c.

#define rme9652_running_double_speed (   s)    ((s)->control_register & RME9652_DS)

Definition at line 173 of file rme9652.c.

#define RME9652_SPDIF_CLOCK   (1<<20)

Definition at line 164 of file rme9652.c.

#define RME9652_SPDIF_IN (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_rme9652_info_spdif_in, \
.get = snd_rme9652_get_spdif_in, .put = snd_rme9652_put_spdif_in }

Definition at line 962 of file rme9652.c.

#define RME9652_SPDIF_OUT (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.get = snd_rme9652_get_spdif_out, .put = snd_rme9652_put_spdif_out }

Definition at line 1033 of file rme9652.c.

#define RME9652_SPDIF_RATE (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_rme9652_info_spdif_rate, \
.get = snd_rme9652_get_spdif_rate }

Definition at line 1363 of file rme9652.c.

#define RME9652_SPDIF_READ   (1<<28) /* byte available from Rev 1.5+ S/PDIF interface */

Definition at line 104 of file rme9652.c.

#define RME9652_SPDIF_RESET   (1<<18) /* Rev 1.5+: h/w S/PDIF receiver */

Definition at line 162 of file rme9652.c.

#define RME9652_SPDIF_SELECT   (1<<19)

Definition at line 163 of file rme9652.c.

#define RME9652_SPDIF_WRITE   (1<<21)

Definition at line 165 of file rme9652.c.

#define RME9652_SPDIFIN_COAXIAL   1 /* coaxial (RCA) */

Definition at line 80 of file rme9652.c.

#define RME9652_SPDIFIN_INTERN   2 /* internal (CDROM) */

Definition at line 81 of file rme9652.c.

#define RME9652_SPDIFIN_OPTICAL   0 /* optical (ADAT1) */

Definition at line 79 of file rme9652.c.

#define RME9652_start_bit   (1<<0) /* start record/play */

Definition at line 146 of file rme9652.c.

#define RME9652_status_register   0

Definition at line 141 of file rme9652.c.

#define RME9652_sync   (RME9652_sync_0|RME9652_sync_1|RME9652_sync_2)

Definition at line 106 of file rme9652.c.

#define RME9652_sync_0   (1<<18) /* if ADAT-IN 1 in sync to system clock */

Definition at line 94 of file rme9652.c.

#define RME9652_sync_1   (1<<17) /* if ADAT-IN 2 in sync to system clock */

Definition at line 93 of file rme9652.c.

#define RME9652_sync_2   (1<<16) /* if ADAT-IN 3 in sync to system clock */

Definition at line 92 of file rme9652.c.

#define RME9652_SYNC_FROM_ADAT1   1

Definition at line 73 of file rme9652.c.

#define RME9652_SYNC_FROM_ADAT2   2

Definition at line 74 of file rme9652.c.

#define RME9652_SYNC_FROM_ADAT3   3

Definition at line 75 of file rme9652.c.

#define RME9652_SYNC_FROM_SPDIF   0

Definition at line 72 of file rme9652.c.

#define RME9652_SYNC_MODE (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_rme9652_info_sync_mode, \
.get = snd_rme9652_get_sync_mode, .put = snd_rme9652_put_sync_mode }

Definition at line 1094 of file rme9652.c.

#define RME9652_SYNC_PREF (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.info = snd_rme9652_info_sync_pref, \
.get = snd_rme9652_get_sync_pref, .put = snd_rme9652_put_sync_pref }

Definition at line 1179 of file rme9652.c.

#define RME9652_SyncPref_ADAT1   0

Definition at line 179 of file rme9652.c.

#define RME9652_SyncPref_ADAT2   (1<<16)

Definition at line 160 of file rme9652.c.

#define RME9652_SyncPref_ADAT3   (1<<17)

Definition at line 161 of file rme9652.c.

#define RME9652_SyncPref_Mask   (RME9652_SyncPref_ADAT2|RME9652_SyncPref_ADAT3)

Definition at line 178 of file rme9652.c.

#define RME9652_SyncPref_SPDIF   (RME9652_SyncPref_ADAT2|RME9652_SyncPref_ADAT3)

Definition at line 180 of file rme9652.c.

#define RME9652_tc_busy   (1<<20) /* 1=time-code copy in progress (960ms) */

Definition at line 96 of file rme9652.c.

#define RME9652_tc_out   (1<<21) /* time-code out bit */

Definition at line 97 of file rme9652.c.

#define RME9652_tc_valid   (1<<27) /* 1 = a signal is detected on time-code input */

Definition at line 103 of file rme9652.c.

#define RME9652_TC_VALID (   xname,
  xindex 
)
Value:
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
.get = snd_rme9652_get_tc_valid }

Definition at line 1424 of file rme9652.c.

#define RME9652_thru_base   128 /* 132...228 Thru for 26 channels */

Definition at line 133 of file rme9652.c.

#define RME9652_time_code   100 /* useful if used with alesis adat */

Definition at line 132 of file rme9652.c.

#define RME9652_wsel   (1<<13) /* use Wordclock as sync (overwrites master) */

Definition at line 157 of file rme9652.c.

#define RME9652_wsel_rd   (1<<5) /* if Word-Clock is used and valid then 1 */

Definition at line 90 of file rme9652.c.

#define snd_rme9652_info_passthru   snd_ctl_boolean_mono_info

Definition at line 1330 of file rme9652.c.

#define snd_rme9652_info_spdif_out   snd_ctl_boolean_mono_info

Definition at line 1066 of file rme9652.c.

#define snd_rme9652_info_tc_valid   snd_ctl_boolean_mono_info

Definition at line 1430 of file rme9652.c.

Function Documentation

MODULE_AUTHOR ( "Paul Davis <[email protected] ,
Winfried Ritsch"   
)
MODULE_DESCRIPTION ( "RME Digi9652/Digi9636"  )
MODULE_DEVICE_TABLE ( pci  ,
snd_rme9652_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 ( precise_ptr  ,
bool  ,
NULL  ,
0444   
)
MODULE_PARM_DESC ( index  ,
"Index value for RME Digi9652 (Hammerfall) soundcard."   
)
MODULE_PARM_DESC ( id  ,
"ID string for RME Digi9652 (Hammerfall) soundcard."   
)
MODULE_PARM_DESC ( enable  ,
"Enable/disable specific RME96{52,36} soundcards."   
)
MODULE_PARM_DESC ( precise_ptr  ,
"Enable precise pointer (doesn't work reliably)."   
)
module_pci_driver ( rme9652_driver  )
MODULE_SUPPORTED_DEVICE ( "{{RME,Hammerfall},""{RME,Hammerfall-Light}}"  )