Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e7dd8c1b
Commit
e7dd8c1b
authored
Nov 26, 2008
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/misc' into topic/pcsp-fix
Conflicts: sound/drivers/pcsp/pcsp_lib.c
parents
ed313489
bc4a68fe
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
359 additions
and
303 deletions
+359
-303
include/sound/core.h
include/sound/core.h
+25
-3
include/sound/version.h
include/sound/version.h
+1
-1
sound/core/device.c
sound/core/device.c
+2
-2
sound/drivers/pcsp/pcsp.c
sound/drivers/pcsp/pcsp.c
+3
-5
sound/drivers/pcsp/pcsp.h
sound/drivers/pcsp/pcsp.h
+1
-0
sound/drivers/pcsp/pcsp_lib.c
sound/drivers/pcsp/pcsp_lib.c
+52
-43
sound/pci/ac97/ac97_patch.c
sound/pci/ac97/ac97_patch.c
+2
-0
sound/pci/emu10k1/emu10k1_main.c
sound/pci/emu10k1/emu10k1_main.c
+258
-236
sound/pci/ice1712/ice1724.c
sound/pci/ice1712/ice1724.c
+12
-11
sound/ppc/pmac.c
sound/ppc/pmac.c
+1
-1
sound/ppc/tumbler.c
sound/ppc/tumbler.c
+2
-1
No files found.
include/sound/core.h
View file @
e7dd8c1b
...
...
@@ -353,7 +353,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
* snd_printk - printk wrapper
* @fmt: format string
*
* Works like print() but prints the file and the line of the caller
* Works like print
k
() but prints the file and the line of the caller
* when configured with CONFIG_SND_VERBOSE_PRINTK.
*/
#define snd_printk(fmt, args...) \
...
...
@@ -380,18 +380,40 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
printk(fmt ,##args)
#endif
/**
* snd_BUG - give a BUG warning message and stack trace
*
* Calls WARN() if CONFIG_SND_DEBUG is set.
* Ignored when CONFIG_SND_DEBUG is not set.
*/
#define snd_BUG() WARN(1, "BUG?\n")
/**
* snd_BUG_ON - debugging check macro
* @cond: condition to evaluate
*
* When CONFIG_SND_DEBUG is set, this macro evaluates the given condition,
* and call WARN() and returns the value if it's non-zero.
*
* When CONFIG_SND_DEBUG is not set, this just returns zero, and the given
* condition is ignored.
*
* NOTE: the argument won't be evaluated at all when CONFIG_SND_DEBUG=n.
* Thus, don't put any statement that influences on the code behavior,
* such as pre/post increment, to the argument of this macro.
* If you want to evaluate and give a warning, use standard WARN_ON().
*/
#define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond))
#else
/* !CONFIG_SND_DEBUG */
#define snd_printd(fmt, args...) do { } while (0)
#define snd_BUG() do { } while (0)
static
inline
int
__snd_bug_on
(
voi
d
)
static
inline
int
__snd_bug_on
(
int
con
d
)
{
return
0
;
}
#define snd_BUG_ON(cond)
__snd_bug_on(
)
/* always false */
#define snd_BUG_ON(cond)
__snd_bug_on(0 && (cond)
)
/* always false */
#endif
/* CONFIG_SND_DEBUG */
...
...
include/sound/version.h
View file @
e7dd8c1b
/* include/version.h */
#define CONFIG_SND_VERSION "1.0.18
rc3
"
#define CONFIG_SND_VERSION "1.0.18
a
"
#define CONFIG_SND_DATE ""
sound/core/device.c
View file @
e7dd8c1b
...
...
@@ -98,7 +98,7 @@ int snd_device_free(struct snd_card *card, void *device_data)
kfree
(
dev
);
return
0
;
}
snd_printd
(
"device free %p (from %p), not found
\n
"
,
device_data
,
snd_printd
(
"device free %p (from %p
F
), not found
\n
"
,
device_data
,
__builtin_return_address
(
0
));
return
-
ENXIO
;
}
...
...
@@ -135,7 +135,7 @@ int snd_device_disconnect(struct snd_card *card, void *device_data)
}
return
0
;
}
snd_printd
(
"device disconnect %p (from %p), not found
\n
"
,
device_data
,
snd_printd
(
"device disconnect %p (from %p
F
), not found
\n
"
,
device_data
,
__builtin_return_address
(
0
));
return
-
ENXIO
;
}
...
...
sound/drivers/pcsp/pcsp.c
View file @
e7dd8c1b
...
...
@@ -96,7 +96,7 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
return
-
EINVAL
;
hrtimer_init
(
&
pcsp_chip
.
timer
,
CLOCK_MONOTONIC
,
HRTIMER_MODE_REL
);
pcsp_chip
.
timer
.
cb_mode
=
HRTIMER_CB_
SOFTIRQ
;
pcsp_chip
.
timer
.
cb_mode
=
HRTIMER_CB_
IRQSAFE_UNLOCKED
;
pcsp_chip
.
timer
.
function
=
pcsp_do_timer
;
card
=
snd_card_new
(
index
,
id
,
THIS_MODULE
,
0
);
...
...
@@ -188,10 +188,8 @@ static int __devexit pcsp_remove(struct platform_device *dev)
static
void
pcsp_stop_beep
(
struct
snd_pcsp
*
chip
)
{
spin_lock_irq
(
&
chip
->
substream_lock
);
if
(
!
chip
->
playback_substream
)
pcsp_sync_stop
(
chip
);
pcspkr_stop_sound
();
spin_unlock_irq
(
&
chip
->
substream_lock
);
}
#ifdef CONFIG_PM
...
...
sound/drivers/pcsp/pcsp.h
View file @
e7dd8c1b
...
...
@@ -77,6 +77,7 @@ struct snd_pcsp {
extern
struct
snd_pcsp
pcsp_chip
;
extern
enum
hrtimer_restart
pcsp_do_timer
(
struct
hrtimer
*
handle
);
extern
void
pcsp_sync_stop
(
struct
snd_pcsp
*
chip
);
extern
int
snd_pcsp_new_pcm
(
struct
snd_pcsp
*
chip
);
extern
int
snd_pcsp_new_mixer
(
struct
snd_pcsp
*
chip
);
...
...
sound/drivers/pcsp/pcsp_lib.c
View file @
e7dd8c1b
...
...
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/interrupt.h>
#include <sound/pcm.h>
#include <asm/io.h>
#include "pcsp.h"
...
...
@@ -19,6 +20,22 @@ MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround "
#define DMIX_WANTS_S16 1
/*
* Call snd_pcm_period_elapsed in a tasklet
* This avoids spinlock messes and long-running irq contexts
*/
static
void
pcsp_call_pcm_elapsed
(
unsigned
long
priv
)
{
if
(
atomic_read
(
&
pcsp_chip
.
timer_active
))
{
struct
snd_pcm_substream
*
substream
;
substream
=
pcsp_chip
.
playback_substream
;
if
(
substream
)
snd_pcm_period_elapsed
(
substream
);
}
}
static
DECLARE_TASKLET
(
pcsp_pcm_tasklet
,
pcsp_call_pcm_elapsed
,
0
);
enum
hrtimer_restart
pcsp_do_timer
(
struct
hrtimer
*
handle
)
{
unsigned
char
timer_cnt
,
val
;
...
...
@@ -28,41 +45,23 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
struct
snd_pcm_substream
*
substream
;
struct
snd_pcm_runtime
*
runtime
;
struct
snd_pcsp
*
chip
=
container_of
(
handle
,
struct
snd_pcsp
,
timer
);
unsigned
long
flags
;
if
(
chip
->
thalf
)
{
outb
(
chip
->
val61
,
0x61
);
chip
->
thalf
=
0
;
if
(
!
atomic_read
(
&
chip
->
timer_active
))
return
HRTIMER_NORESTART
;
goto
stop
;
hrtimer_forward
(
&
chip
->
timer
,
hrtimer_get_expires
(
&
chip
->
timer
),
ktime_set
(
0
,
chip
->
ns_rem
));
return
HRTIMER_RESTART
;
}
spin_lock_irq
(
&
chip
->
substream_lock
);
/* Takashi Iwai says regarding this extra lock:
If the irq handler handles some data on the DMA buffer, it should
do snd_pcm_stream_lock().
That protects basically against all races among PCM callbacks, yes.
However, there are two remaining issues:
1. The substream pointer you try to lock isn't protected _before_
this lock yet.
2. snd_pcm_period_elapsed() itself acquires the lock.
The requirement of another lock is because of 1. When you get
chip->playback_substream, it's not protected.
Keeping this lock while snd_pcm_period_elapsed() assures the substream
is still protected (at least, not released). And the other status is
handled properly inside snd_pcm_stream_lock() in
snd_pcm_period_elapsed().
*/
if
(
!
chip
->
playback_substream
)
goto
exit_nr_unlock1
;
substream
=
chip
->
playback_substream
;
snd_pcm_stream_lock
(
substream
);
if
(
!
atomic_read
(
&
chip
->
timer_active
))
goto
exit_nr_unlock2
;
goto
stop
;
substream
=
chip
->
playback_substream
;
if
(
!
substream
)
goto
stop
;
runtime
=
substream
->
runtime
;
fmt_size
=
snd_pcm_format_physical_width
(
runtime
->
format
)
>>
3
;
...
...
@@ -87,6 +86,8 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
period_bytes
=
snd_pcm_lib_period_bytes
(
substream
);
buffer_bytes
=
snd_pcm_lib_buffer_bytes
(
substream
);
spin_lock_irqsave
(
&
chip
->
substream_lock
,
flags
);
chip
->
playback_ptr
+=
PCSP_INDEX_INC
()
*
fmt_size
;
periods_elapsed
=
chip
->
playback_ptr
-
chip
->
period_ptr
;
if
(
periods_elapsed
<
0
)
{
...
...
@@ -102,18 +103,15 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
* or ALSA will BUG on us. */
chip
->
playback_ptr
%=
buffer_bytes
;
snd_pcm_stream_unlock
(
substream
);
if
(
periods_elapsed
)
{
snd_pcm_period_elapsed
(
substream
);
chip
->
period_ptr
+=
periods_elapsed
*
period_bytes
;
chip
->
period_ptr
%=
buffer_bytes
;
tasklet_schedule
(
&
pcsp_pcm_tasklet
);
}
spin_unlock_irq
(
&
chip
->
substream_lock
);
spin_unlock_irqrestore
(
&
chip
->
substream_lock
,
flags
);
if
(
!
atomic_read
(
&
chip
->
timer_active
))
return
HRTIMER_NORESTART
;
goto
stop
;
chip
->
ns_rem
=
PCSP_PERIOD_NS
();
ns
=
(
chip
->
thalf
?
PCSP_CALC_NS
(
timer_cnt
)
:
chip
->
ns_rem
);
...
...
@@ -122,10 +120,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
ktime_set
(
0
,
ns
));
return
HRTIMER_RESTART
;
exit_nr_unlock2:
snd_pcm_stream_unlock
(
substream
);
exit_nr_unlock1:
spin_unlock_irq
(
&
chip
->
substream_lock
);
stop:
return
HRTIMER_NORESTART
;
}
...
...
@@ -165,26 +160,35 @@ static void pcsp_stop_playing(struct snd_pcsp *chip)
spin_unlock
(
&
i8253_lock
);
}
/*
* Force to stop and sync the stream
*/
void
pcsp_sync_stop
(
struct
snd_pcsp
*
chip
)
{
local_irq_disable
();
pcsp_stop_playing
(
chip
);
local_irq_enable
();
hrtimer_cancel
(
&
chip
->
timer
);
tasklet_kill
(
&
pcsp_pcm_tasklet
);
}
static
int
snd_pcsp_playback_close
(
struct
snd_pcm_substream
*
substream
)
{
struct
snd_pcsp
*
chip
=
snd_pcm_substream_chip
(
substream
);
#if PCSP_DEBUG
printk
(
KERN_INFO
"PCSP: close called
\n
"
);
#endif
if
(
atomic_read
(
&
chip
->
timer_active
))
{
printk
(
KERN_ERR
"PCSP: timer still active
\n
"
);
pcsp_stop_playing
(
chip
);
}
spin_lock_irq
(
&
chip
->
substream_lock
);
pcsp_sync_stop
(
chip
);
chip
->
playback_substream
=
NULL
;
spin_unlock_irq
(
&
chip
->
substream_lock
);
return
0
;
}
static
int
snd_pcsp_playback_hw_params
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
hw_params
)
{
struct
snd_pcsp
*
chip
=
snd_pcm_substream_chip
(
substream
);
int
err
;
pcsp_sync_stop
(
chip
);
err
=
snd_pcm_lib_malloc_pages
(
substream
,
params_buffer_bytes
(
hw_params
));
if
(
err
<
0
)
...
...
@@ -194,9 +198,11 @@ static int snd_pcsp_playback_hw_params(struct snd_pcm_substream *substream,
static
int
snd_pcsp_playback_hw_free
(
struct
snd_pcm_substream
*
substream
)
{
struct
snd_pcsp
*
chip
=
snd_pcm_substream_chip
(
substream
);
#if PCSP_DEBUG
printk
(
KERN_INFO
"PCSP: hw_free called
\n
"
);
#endif
pcsp_sync_stop
(
chip
);
return
snd_pcm_lib_free_pages
(
substream
);
}
...
...
@@ -212,6 +218,7 @@ static int snd_pcsp_playback_prepare(struct snd_pcm_substream *substream)
snd_pcm_lib_period_bytes
(
substream
),
substream
->
runtime
->
periods
);
#endif
pcsp_sync_stop
(
chip
);
chip
->
playback_ptr
=
0
;
chip
->
period_ptr
=
0
;
return
0
;
...
...
@@ -242,7 +249,11 @@ static snd_pcm_uframes_t snd_pcsp_playback_pointer(struct snd_pcm_substream
*
substream
)
{
struct
snd_pcsp
*
chip
=
snd_pcm_substream_chip
(
substream
);
return
bytes_to_frames
(
substream
->
runtime
,
chip
->
playback_ptr
);
unsigned
int
pos
;
spin_lock
(
&
chip
->
substream_lock
);
pos
=
chip
->
playback_ptr
;
spin_unlock
(
&
chip
->
substream_lock
);
return
bytes_to_frames
(
substream
->
runtime
,
pos
);
}
static
struct
snd_pcm_hardware
snd_pcsp_playback
=
{
...
...
@@ -279,9 +290,7 @@ static int snd_pcsp_playback_open(struct snd_pcm_substream *substream)
return
-
EBUSY
;
}
runtime
->
hw
=
snd_pcsp_playback
;
spin_lock_irq
(
&
chip
->
substream_lock
);
chip
->
playback_substream
=
substream
;
spin_unlock_irq
(
&
chip
->
substream_lock
);
return
0
;
}
...
...
sound/pci/ac97/ac97_patch.c
View file @
e7dd8c1b
...
...
@@ -2832,6 +2832,8 @@ static int patch_alc655(struct snd_ac97 * ac97)
val
&=
~
(
1
<<
1
);
/* Pin 47 is EAPD (for internal speaker) */
else
val
|=
(
1
<<
1
);
/* Pin 47 is spdif input pin */
/* this seems missing on some hardwares */
ac97
->
ext_id
|=
AC97_EI_SPDIF
;
}
val
&=
~
(
1
<<
12
);
/* vref enable */
snd_ac97_write_cache
(
ac97
,
0x7a
,
val
);
...
...
sound/pci/emu10k1/emu10k1_main.c
View file @
e7dd8c1b
...
...
@@ -69,7 +69,7 @@ MODULE_FIRMWARE(EMU1010_NOTEBOOK_FILENAME);
* EMU10K1 init / done
*************************************************************************/
void
snd_emu10k1_voice_init
(
struct
snd_emu10k1
*
emu
,
int
ch
)
void
snd_emu10k1_voice_init
(
struct
snd_emu10k1
*
emu
,
int
ch
)
{
snd_emu10k1_ptr_write
(
emu
,
DCYSUSV
,
ch
,
0
);
snd_emu10k1_ptr_write
(
emu
,
IP
,
ch
,
0
);
...
...
@@ -151,7 +151,7 @@ static unsigned int i2c_adc_init[][2] = {
{
0x12
,
0x32
},
/* ALC Control 3 */
{
0x13
,
0x00
},
/* Noise gate control */
{
0x14
,
0xa6
},
/* Limiter control */
{
0x15
,
ADC_MUX_2
},
/* ADC Mixer control. Mic for A
udigy 2
ZS Notebook */
{
0x15
,
ADC_MUX_2
},
/* ADC Mixer control. Mic for A
2
ZS Notebook */
};
static
int
snd_emu10k1_init
(
struct
snd_emu10k1
*
emu
,
int
enable_ir
,
int
resume
)
...
...
@@ -161,8 +161,8 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
u32
tmp
;
/* disable audio and lock cache */
outl
(
HCFG_LOCKSOUNDCACHE
|
HCFG_LOCKTANKCACHE_MASK
|
HCFG_MUTEBUTTONENABLE
,
emu
->
port
+
HCFG
);
outl
(
HCFG_LOCKSOUNDCACHE
|
HCFG_LOCKTANKCACHE_MASK
|
HCFG_MUTEBUTTONENABLE
,
emu
->
port
+
HCFG
);
/* reset recording buffers */
snd_emu10k1_ptr_write
(
emu
,
MICBS
,
0
,
ADCBS_BUFSIZE_NONE
);
...
...
@@ -179,7 +179,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
snd_emu10k1_ptr_write
(
emu
,
SOLEL
,
0
,
0
);
snd_emu10k1_ptr_write
(
emu
,
SOLEH
,
0
,
0
);
if
(
emu
->
audigy
){
if
(
emu
->
audigy
)
{
/* set SPDIF bypass mode */
snd_emu10k1_ptr_write
(
emu
,
SPBYPASS
,
0
,
SPBYPASS_FORMAT
);
/* enable rear left + rear right AC97 slots */
...
...
@@ -197,7 +197,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
if
(
emu
->
card_capabilities
->
ca0151_chip
)
{
/* audigy2 */
/* Hacks for Alice3 to work independent of haP16V driver */
/
/Setup SRCMulti_I2S SamplingRate
/
* Setup SRCMulti_I2S SamplingRate */
tmp
=
snd_emu10k1_ptr_read
(
emu
,
A_SPDIF_SAMPLERATE
,
0
);
tmp
&=
0xfffff1ff
;
tmp
|=
(
0x2
<<
9
);
...
...
@@ -217,7 +217,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
if
(
emu
->
card_capabilities
->
ca0108_chip
)
{
/* audigy2 Value */
/* Hacks for Alice3 to work independent of haP16V driver */
snd_printk
(
KERN_INFO
"Audigy2 value: Special config.
\n
"
);
/
/Setup SRCMulti_I2S SamplingRate
/
* Setup SRCMulti_I2S SamplingRate */
tmp
=
snd_emu10k1_ptr_read
(
emu
,
A_SPDIF_SAMPLERATE
,
0
);
tmp
&=
0xfffff1ff
;
tmp
|=
(
0x2
<<
9
);
...
...
@@ -270,9 +270,9 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
size
=
ARRAY_SIZE
(
i2c_adc_init
);
for
(
n
=
0
;
n
<
size
;
n
++
)
snd_emu10k1_i2c_write
(
emu
,
i2c_adc_init
[
n
][
0
],
i2c_adc_init
[
n
][
1
]);
for
(
n
=
0
;
n
<
4
;
n
++
)
{
emu
->
i2c_capture_volume
[
n
][
0
]
=
0xcf
;
emu
->
i2c_capture_volume
[
n
][
1
]
=
0xcf
;
for
(
n
=
0
;
n
<
4
;
n
++
)
{
emu
->
i2c_capture_volume
[
n
][
0
]
=
0xcf
;
emu
->
i2c_capture_volume
[
n
][
1
]
=
0xcf
;
}
}
...
...
@@ -313,7 +313,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
(
emu
->
model
==
0x21
&&
emu
->
revision
<
6
))
outl
(
HCFG_LOCKTANKCACHE_MASK
|
HCFG_AUTOMUTE
,
emu
->
port
+
HCFG
);
else
/
/ With on-chip joystick
/
* With on-chip joystick */
outl
(
HCFG_LOCKTANKCACHE_MASK
|
HCFG_AUTOMUTE
|
HCFG_JOYENABLE
,
emu
->
port
+
HCFG
);
if
(
enable_ir
)
{
/* enable IR for SB Live */
...
...
@@ -383,7 +383,7 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
{
unsigned int tmp;
/* FIXME: the following routine disables LiveDrive-II !! */
/
/ TOSLink detection
/
* TOSLink detection */
emu->tos_link = 0;
tmp = inl(emu->port + HCFG);
if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) {
...
...
@@ -400,7 +400,7 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
snd_emu10k1_intr_enable
(
emu
,
INTE_PCIERRORENABLE
);
}
int
snd_emu10k1_done
(
struct
snd_emu10k1
*
emu
)
int
snd_emu10k1_done
(
struct
snd_emu10k1
*
emu
)
{
int
ch
;
...
...
@@ -523,7 +523,7 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
* register.
*/
static
void
snd_emu10k1_ecard_write
(
struct
snd_emu10k1
*
emu
,
unsigned
int
value
)
static
void
snd_emu10k1_ecard_write
(
struct
snd_emu10k1
*
emu
,
unsigned
int
value
)
{
unsigned
short
count
;
unsigned
int
data
;
...
...
@@ -561,7 +561,7 @@ static void snd_emu10k1_ecard_write(struct snd_emu10k1 * emu, unsigned int value
* channel.
*/
static
void
snd_emu10k1_ecard_setadcgain
(
struct
snd_emu10k1
*
emu
,
static
void
snd_emu10k1_ecard_setadcgain
(
struct
snd_emu10k1
*
emu
,
unsigned
short
gain
)
{
unsigned
int
bit
;
...
...
@@ -589,7 +589,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
snd_emu10k1_ecard_write
(
emu
,
emu
->
ecard_ctrl
);
}
static
int
snd_emu10k1_ecard_init
(
struct
snd_emu10k1
*
emu
)
static
int
snd_emu10k1_ecard_init
(
struct
snd_emu10k1
*
emu
)
{
unsigned
int
hc_value
;
...
...
@@ -629,7 +629,7 @@ static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
return
0
;
}
static
int
snd_emu10k1_cardbus_init
(
struct
snd_emu10k1
*
emu
)
static
int
snd_emu10k1_cardbus_init
(
struct
snd_emu10k1
*
emu
)
{
unsigned
long
special_port
;
unsigned
int
value
;
...
...
@@ -656,7 +656,7 @@ static int snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu)
return
0
;
}
static
int
snd_emu1010_load_firmware
(
struct
snd_emu10k1
*
emu
,
const
char
*
filename
)
static
int
snd_emu1010_load_firmware
(
struct
snd_emu10k1
*
emu
,
const
char
*
filename
)
{
int
err
;
int
n
,
i
;
...
...
@@ -666,11 +666,12 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
unsigned
long
flags
;
const
struct
firmware
*
fw_entry
;
if
((
err
=
request_firmware
(
&
fw_entry
,
filename
,
&
emu
->
pci
->
dev
))
!=
0
)
{
snd_printk
(
KERN_ERR
"firmware: %s not found. Err=%d
\n
"
,
filename
,
err
);
err
=
request_firmware
(
&
fw_entry
,
filename
,
&
emu
->
pci
->
dev
);
if
(
err
!=
0
)
{
snd_printk
(
KERN_ERR
"firmware: %s not found. Err = %d
\n
"
,
filename
,
err
);
return
err
;
}
snd_printk
(
KERN_INFO
"firmware size
=
0x%zx
\n
"
,
fw_entry
->
size
);
snd_printk
(
KERN_INFO
"firmware size
=
0x%zx
\n
"
,
fw_entry
->
size
);
/* The FPGA is a Xilinx Spartan IIE XC2S50E */
/* GPIO7 -> FPGA PGMN
...
...
@@ -685,9 +686,9 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
outl
(
0x80
,
emu
->
port
+
A_IOCFG
);
/* Leave bit 7 set during netlist setup. */
write_post
=
inl
(
emu
->
port
+
A_IOCFG
);
udelay
(
100
);
/* Allow FPGA memory to clean */
for
(
n
=
0
;
n
<
fw_entry
->
size
;
n
++
)
{
value
=
fw_entry
->
data
[
n
];
for
(
i
=
0
;
i
<
8
;
i
++
)
{
for
(
n
=
0
;
n
<
fw_entry
->
size
;
n
++
)
{
value
=
fw_entry
->
data
[
n
];
for
(
i
=
0
;
i
<
8
;
i
++
)
{
reg
=
0x80
;
if
(
value
&
0x1
)
reg
=
reg
|
0x20
;
...
...
@@ -709,8 +710,8 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
static
int
emu1010_firmware_thread
(
void
*
data
)
{
struct
snd_emu10k1
*
emu
=
data
;
int
tmp
,
tmp2
;
struct
snd_emu10k1
*
emu
=
data
;
int
tmp
,
tmp2
;
int
reg
;
int
err
;
...
...
@@ -719,50 +720,50 @@ static int emu1010_firmware_thread(void *data)
msleep_interruptible
(
1000
);
if
(
kthread_should_stop
())
break
;
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_IRQ_STATUS
,
&
tmp
);
/* IRQ Status */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
/* OPTIONS: Which cards are attached to the EMU */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_IRQ_STATUS
,
&
tmp
);
/* IRQ Status */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
/* OPTIONS: Which cards are attached to the EMU */
if
(
reg
&
EMU_HANA_OPTION_DOCK_OFFLINE
)
{
/* Audio Dock attached */
/* Return to Audio Dock programming mode */
snd_printk
(
KERN_INFO
"emu1010: Loading Audio Dock Firmware
\n
"
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_FPGA_CONFIG
,
EMU_HANA_FPGA_CONFIG_AUDIODOCK
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_FPGA_CONFIG
,
EMU_HANA_FPGA_CONFIG_AUDIODOCK
);
if
(
emu
->
card_capabilities
->
emu_model
==
EMU_MODEL_EMU1010
)
{
if
((
err
=
snd_emu1010_load_firmware
(
emu
,
DOCK_FILENAME
))
!=
0
)
{
err
=
snd_emu1010_load_firmware
(
emu
,
DOCK_FILENAME
);
if
(
err
!=
0
)
continue
;
}
}
else
if
(
emu
->
card_capabilities
->
emu_model
==
EMU_MODEL_EMU1010B
)
{
if
((
err
=
snd_emu1010_load_firmware
(
emu
,
MICRO_DOCK_FILENAME
))
!=
0
)
{
err
=
snd_emu1010_load_firmware
(
emu
,
MICRO_DOCK_FILENAME
);
if
(
err
!=
0
)
continue
;
}
}
else
if
(
emu
->
card_capabilities
->
emu_model
==
EMU_MODEL_EMU1616
)
{
if
((
err
=
snd_emu1010_load_firmware
(
emu
,
MICRO_DOCK_FILENAME
))
!=
0
)
{
err
=
snd_emu1010_load_firmware
(
emu
,
MICRO_DOCK_FILENAME
);
if
(
err
!=
0
)
continue
;
}
}
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_FPGA_CONFIG
,
0
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_IRQ_STATUS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: EMU_HANA+DOCK_IRQ_STATUS
=0x%x
\n
"
,
reg
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_FPGA_CONFIG
,
0
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_IRQ_STATUS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: EMU_HANA+DOCK_IRQ_STATUS
= 0x%x
\n
"
,
reg
);
/* ID, should read & 0x7f = 0x55 when FPGA programmed. */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: EMU_HANA+DOCK_ID
=0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: EMU_HANA+DOCK_ID
= 0x%x
\n
"
,
reg
);
if
((
reg
&
0x1f
)
!=
0x15
)
{
/* FPGA failed to be programmed */
snd_printk
(
KERN_INFO
"emu1010: Loading Audio Dock Firmware file failed, reg
=
0x%x
\n
"
,
reg
);
snd_printk
(
KERN_INFO
"emu1010: Loading Audio Dock Firmware file failed, reg
=
0x%x
\n
"
,
reg
);
continue
;
}
snd_printk
(
KERN_INFO
"emu1010: Audio Dock Firmware loaded
\n
"
);
snd_emu1010_fpga_read
(
emu
,
EMU_DOCK_MAJOR_REV
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_DOCK_MINOR_REV
,
&
tmp2
);
snd_printk
(
"Audio Dock ver:%d.%d
\n
"
,
tmp
,
tmp2
);
snd_emu1010_fpga_read
(
emu
,
EMU_DOCK_MAJOR_REV
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_DOCK_MINOR_REV
,
&
tmp2
);
snd_printk
(
"Audio Dock ver:%d.%d
\n
"
,
tmp
,
tmp2
);
/* Sync clocking between 1010 and Dock */
/* Allow DLL to settle */
msleep
(
10
);
/* Unmute all. Default is muted after a firmware load */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_UNMUTE
,
EMU_UNMUTE
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_UNMUTE
,
EMU_UNMUTE
);
}
}
snd_printk
(
KERN_INFO
"emu1010: firmware thread stopping
\n
"
);
...
...
@@ -800,10 +801,10 @@ static int emu1010_firmware_thread(void *data)
* 16 x 16-bit playback - snd_emu10k1_fx8010_playback_ops
* 16 x 32-bit capture - snd_emu10k1_capture_efx_ops
*/
static
int
snd_emu10k1_emu1010_init
(
struct
snd_emu10k1
*
emu
)
static
int
snd_emu10k1_emu1010_init
(
struct
snd_emu10k1
*
emu
)
{
unsigned
int
i
;
int
tmp
,
tmp2
;
int
tmp
,
tmp2
;
int
reg
;
int
err
;
const
char
*
filename
=
NULL
;
...
...
@@ -829,25 +830,25 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
outl
(
0x0005a000
,
emu
->
port
+
HCFG
);
/* Disable 48Volt power to Audio Dock */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_PWR
,
0
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_PWR
,
0
);
/* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
snd_printdd
(
"reg1
=0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
snd_printdd
(
"reg1
= 0x%x
\n
"
,
reg
);
if
((
reg
&
0x3f
)
==
0x15
)
{
/* FPGA netlist already present so clear it */
/* Return to programming mode */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_FPGA_CONFIG
,
0x02
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_FPGA_CONFIG
,
0x02
);
}
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
snd_printdd
(
"reg2
=0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
snd_printdd
(
"reg2
= 0x%x
\n
"
,
reg
);
if
((
reg
&
0x3f
)
==
0x15
)
{
/* FPGA failed to return to programming mode */
snd_printk
(
KERN_INFO
"emu1010: FPGA failed to return to programming mode
\n
"
);
return
-
ENODEV
;
}
snd_printk
(
KERN_INFO
"emu1010: EMU_HANA_ID
=0x%x
\n
"
,
reg
);
snd_printk
(
KERN_INFO
"emu1010: EMU_HANA_ID
= 0x%x
\n
"
,
reg
);
switch
(
emu
->
card_capabilities
->
emu_model
)
{
case
EMU_MODEL_EMU1010
:
filename
=
HANA_FILENAME
;
...
...
@@ -876,25 +877,25 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
}
/* ID, should read & 0x7f = 0x55 when FPGA programmed. */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ID
,
&
reg
);
if
((
reg
&
0x3f
)
!=
0x15
)
{
/* FPGA failed to be programmed */
snd_printk
(
KERN_INFO
"emu1010: Loading Hana Firmware file failed, reg
=
0x%x
\n
"
,
reg
);
snd_printk
(
KERN_INFO
"emu1010: Loading Hana Firmware file failed, reg
=
0x%x
\n
"
,
reg
);
return
-
ENODEV
;
}
snd_printk
(
KERN_INFO
"emu1010: Hana Firmware loaded
\n
"
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_MAJOR_REV
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_MINOR_REV
,
&
tmp2
);
snd_printk
(
"
Hana ver:%d.%d
\n
"
,
tmp
,
tmp2
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_MAJOR_REV
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_MINOR_REV
,
&
tmp2
);
snd_printk
(
"
emu1010: Hana version: %d.%d
\n
"
,
tmp
,
tmp2
);
/* Enable 48Volt power to Audio Dock */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_PWR
,
EMU_HANA_DOCK_PWR_ON
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_PWR
,
EMU_HANA_DOCK_PWR_ON
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: Card options
=0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: Card options
=0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTICAL_TYPE
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: Card options
= 0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: Card options
= 0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTICAL_TYPE
,
&
tmp
);
/* Optical -> ADAT I/O */
/* 0 : SPDIF
* 1 : ADAT
...
...
@@ -904,41 +905,42 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
tmp
=
0
;
tmp
=
(
emu
->
emu1010
.
optical_in
?
EMU_HANA_OPTICAL_IN_ADAT
:
0
)
|
(
emu
->
emu1010
.
optical_out
?
EMU_HANA_OPTICAL_OUT_ADAT
:
0
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_OPTICAL_TYPE
,
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ADC_PADS
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_OPTICAL_TYPE
,
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_ADC_PADS
,
&
tmp
);
/* Set no attenuation on Audio Dock pads. */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_ADC_PADS
,
0x00
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_ADC_PADS
,
0x00
);
emu
->
emu1010
.
adc_pads
=
0x00
;
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_DOCK_MISC
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_DOCK_MISC
,
&
tmp
);
/* Unmute Audio dock DACs, Headphone source DAC-4. */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_MISC
,
0x30
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_LEDS_2
,
0x12
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_DAC_PADS
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_MISC
,
0x30
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_LEDS_2
,
0x12
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_DAC_PADS
,
&
tmp
);
/* DAC PADs. */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DAC_PADS
,
0x0f
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DAC_PADS
,
0x0f
);
emu
->
emu1010
.
dac_pads
=
0x0f
;
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_DOCK_MISC
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_MISC
,
0x30
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_SPDIF_MODE
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_DOCK_MISC
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_MISC
,
0x30
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_SPDIF_MODE
,
&
tmp
);
/* SPDIF Format. Set Consumer mode, 24bit, copy enable */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_SPDIF_MODE
,
0x10
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_SPDIF_MODE
,
0x10
);
/* MIDI routing */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_IN
,
0x19
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_IN
,
0x19
);
/* Unknown. */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_OUT
,
0x0c
);
/* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); // IRQ Enable: All on */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_OUT
,
0x0c
);
/* IRQ Enable: Alll on */
/* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); */
/* IRQ Enable: All off */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_IRQ_ENABLE
,
0x00
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_IRQ_ENABLE
,
0x00
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: Card options3
=0x%x
\n
"
,
reg
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
reg
);
snd_printk
(
KERN_INFO
"emu1010: Card options3
= 0x%x
\n
"
,
reg
);
/* Default WCLK set to 48kHz. */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DEFCLOCK
,
0x00
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DEFCLOCK
,
0x00
);
/* Word Clock source, Internal 48kHz x1 */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_WCLOCK
,
EMU_HANA_WCLOCK_INT_48K
);
/
/snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_WCLOCK
,
EMU_HANA_WCLOCK_INT_48K
);
/
* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
/* Audio Dock LEDs. */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_LEDS_2
,
0x12
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_LEDS_2
,
0x12
);
#if 0
/* For 96kHz */
...
...
@@ -1037,19 +1039,19 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
snd_emu1010_fpga_link_dst_src_write(emu,
EMU_DST_ALICE2_EMU32_F, EMU_SRC_HAMOA_ADC_LEFT2);
#endif
for
(
i
=
0
;
i
<
0x20
;
i
++
)
{
for
(
i
=
0
;
i
<
0x20
;
i
++
)
{
/* AudioDock Elink <- Silence */
snd_emu1010_fpga_link_dst_src_write
(
emu
,
0x0100
+
i
,
EMU_SRC_SILENCE
);
snd_emu1010_fpga_link_dst_src_write
(
emu
,
0x0100
+
i
,
EMU_SRC_SILENCE
);
}
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
/* Hana SPDIF Out <- Silence */
snd_emu1010_fpga_link_dst_src_write
(
emu
,
0x0200
+
i
,
EMU_SRC_SILENCE
);
snd_emu1010_fpga_link_dst_src_write
(
emu
,
0x0200
+
i
,
EMU_SRC_SILENCE
);
}
for
(
i
=
0
;
i
<
7
;
i
++
)
{
for
(
i
=
0
;
i
<
7
;
i
++
)
{
/* Hamoa DAC <- Silence */
snd_emu1010_fpga_link_dst_src_write
(
emu
,
0x0300
+
i
,
EMU_SRC_SILENCE
);
snd_emu1010_fpga_link_dst_src_write
(
emu
,
0x0300
+
i
,
EMU_SRC_SILENCE
);
}
for
(
i
=
0
;
i
<
7
;
i
++
)
{
for
(
i
=
0
;
i
<
7
;
i
++
)
{
/* Hana ADAT Out <- Silence */
snd_emu1010_fpga_link_dst_src_write
(
emu
,
EMU_DST_HANA_ADAT
+
i
,
EMU_SRC_SILENCE
);
}
...
...
@@ -1065,9 +1067,9 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
EMU_DST_ALICE_I2S2_LEFT
,
EMU_SRC_DOCK_ADC3_LEFT1
);
snd_emu1010_fpga_link_dst_src_write
(
emu
,
EMU_DST_ALICE_I2S2_RIGHT
,
EMU_SRC_DOCK_ADC3_RIGHT1
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_UNMUTE
,
0x01
);
// Unmute all
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_UNMUTE
,
0x01
);
/* Unmute all */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
tmp
);
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
tmp
);
/* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
* Lock Sound Memory Cache, Lock Tank Memory Cache,
...
...
@@ -1082,13 +1084,13 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
/* Initial boot complete. Now patches */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_IN
,
0x19
);
/* MIDI Route */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_OUT
,
0x0c
);
/* Unknown */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_IN
,
0x19
);
/* MIDI Route */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_OUT
,
0x0c
);
/* Unknown */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_SPDIF_MODE
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_SPDIF_MODE
,
0x10
);
/* SPDIF Format spdif (or 0x11 for aes/ebu) */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_OPTION_CARDS
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_IN
,
0x19
);
/* MIDI Route */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_OUT
,
0x0c
);
/* Unknown */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_IN
,
0x19
);
/* MIDI Route */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_MIDI_OUT
,
0x0c
);
/* Unknown */
snd_emu1010_fpga_read
(
emu
,
EMU_HANA_SPDIF_MODE
,
&
tmp
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_SPDIF_MODE
,
0x10
);
/* SPDIF Format spdif (or 0x11 for aes/ebu) */
/* Start Micro/Audio Dock firmware loader thread */
if
(
!
emu
->
emu1010
.
firmware_thread
)
{
...
...
@@ -1218,20 +1220,20 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
emu
->
emu1010
.
output_source
[
23
]
=
28
;
}
/* TEMP: Select SPDIF in/out */
/
/snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0);
/* Output spdif */
/
* snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); */
/* Output spdif */
/* TEMP: Select 48kHz SPDIF out */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_UNMUTE
,
0x0
);
/* Mute all */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DEFCLOCK
,
0x0
);
/* Default fallback clock 48kHz */
/* Word Clock source, Internal 48kHz x1 */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_WCLOCK
,
EMU_HANA_WCLOCK_INT_48K
);
/
/snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_WCLOCK
,
EMU_HANA_WCLOCK_INT_48K
);
/
* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
emu
->
emu1010
.
internal_clock
=
1
;
/* 48000 */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_LEDS_2
,
0x12
);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_LEDS_2
,
0x12
);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_UNMUTE
,
0x1
);
/* Unmute all */
/
/snd_emu1010_fpga_write(emu, 0x7, 0x0);
/* Mute all */
/
/snd_emu1010_fpga_write(emu, 0x7, 0x1);
/* Unmute all */
/
/snd_emu1010_fpga_write(emu, 0xe, 0x12);
/* Set LEDs on Audio Dock */
/
* snd_emu1010_fpga_write(emu, 0x7, 0x0); */
/* Mute all */
/
* snd_emu1010_fpga_write(emu, 0x7, 0x1); */
/* Unmute all */
/
* snd_emu1010_fpga_write(emu, 0xe, 0x12); */
/* Set LEDs on Audio Dock */
return
0
;
}
...
...
@@ -1253,7 +1255,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
}
if
(
emu
->
card_capabilities
->
emu_model
==
EMU_MODEL_EMU1010
)
{
/* Disable 48Volt power to Audio Dock */
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_PWR
,
0
);
snd_emu1010_fpga_write
(
emu
,
EMU_HANA_DOCK_PWR
,
0
);
}
if
(
emu
->
emu1010
.
firmware_thread
)
kthread_stop
(
emu
->
emu1010
.
firmware_thread
);
...
...
@@ -1292,21 +1294,6 @@ static int snd_emu10k1_dev_free(struct snd_device *device)
}
static
struct
snd_emu_chip_details
emu_chip_details
[]
=
{
/* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/
/* Tested by James@superbug.co.uk 3rd July 2005 */
/* DSP: CA0108-IAT
* DAC: CS4382-KQ
* ADC: Philips 1361T
* AC97: STAC9750
* CA0151: None
*/
{.
vendor
=
0x1102
,
.
device
=
0x0008
,
.
subsystem
=
0x10011102
,
.
driver
=
"Audigy2"
,
.
name
=
"Audigy 2 Value [SB0400]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0108_chip
=
1
,
.
spk71
=
1
,
.
ac97_chip
=
1
}
,
/* Audigy4 (Not PRO) SB0610 */
/* Tested by James@superbug.co.uk 4th April 2006 */
/* A_IOCFG bits
...
...
@@ -1346,13 +1333,30 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: None
*/
{.
vendor
=
0x1102
,
.
device
=
0x0008
,
.
subsystem
=
0x10211102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 4 [SB0610]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 4 [SB0610]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0108_chip
=
1
,
.
spk71
=
1
,
.
adc_1361t
=
1
,
/* 24 bit capture instead of 16bit */
.
ac97_chip
=
1
}
,
/* Audigy 2 Value AC3 out does not work yet.
* Need to find out how to turn off interpolators.
*/
/* Tested by James@superbug.co.uk 3rd July 2005 */
/* DSP: CA0108-IAT
* DAC: CS4382-KQ
* ADC: Philips 1361T
* AC97: STAC9750
* CA0151: None
*/
{.
vendor
=
0x1102
,
.
device
=
0x0008
,
.
subsystem
=
0x10011102
,
.
driver
=
"Audigy2"
,
.
name
=
"SB Audigy 2 Value [SB0400]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0108_chip
=
1
,
.
spk71
=
1
,
.
ac97_chip
=
1
}
,
/* Audigy 2 ZS Notebook Cardbus card.*/
/* Tested by James@superbug.co.uk 6th November 2006 */
/* Audio output 7.1/Headphones working.
...
...
@@ -1386,7 +1390,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
*
*/
{.
vendor
=
0x1102
,
.
device
=
0x0008
,
.
subsystem
=
0x20011102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 ZS Notebook [SB0530]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 ZS Notebook [SB0530]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0108_chip
=
1
,
...
...
@@ -1404,47 +1408,49 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
spk71
=
1
,
.
emu_model
=
EMU_MODEL_EMU1616
},
/* Tested by James@superbug.co.uk 4th Nov 2007. */
/* This is MAEM8960, 0202 is MAEM 8980 */
{.
vendor
=
0x1102
,
.
device
=
0x0008
,
.
subsystem
=
0x40041102
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 1010b PCI [MAEM
????]"
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 1010b PCI [MAEM
8960]"
,
.
id
=
"EMU1010"
,
.
emu10k2_chip
=
1
,
.
ca0108_chip
=
1
,
.
spk71
=
1
,
.
emu_model
=
EMU_MODEL_EMU1010B
},
.
emu_model
=
EMU_MODEL_EMU1010B
},
/* EMU 1010 new revision */
/* Tested by James@superbug.co.uk 8th July 2005. */
/* This is MAEM8810, 0202 is MAEM8820 */
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x40011102
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 1010 [
4001
]"
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 1010 [
MAEM8810
]"
,
.
id
=
"EMU1010"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
.
spk71
=
1
,
.
emu_model
=
EMU_MODEL_EMU1010
},
/* E
mu 1010
*/
.
emu_model
=
EMU_MODEL_EMU1010
},
/* E
MU 1010 old revision
*/
/* EMU0404b */
{.
vendor
=
0x1102
,
.
device
=
0x0008
,
.
subsystem
=
0x40021102
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 0404b
[400
2]"
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 0404b
PCI [MAEM885
2]"
,
.
id
=
"EMU0404"
,
.
emu10k2_chip
=
1
,
.
ca0108_chip
=
1
,
.
spk71
=
1
,
.
emu_model
=
EMU_MODEL_EMU0404
},
/* EMU 0404 */
.
emu_model
=
EMU_MODEL_EMU0404
},
/* EMU 0404
new revision
*/
/* Tested by James@superbug.co.uk 20-3-2007. */
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x40021102
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 0404 [
4002
]"
,
.
driver
=
"Audigy2"
,
.
name
=
"E-mu 0404 [
MAEM8850
]"
,
.
id
=
"EMU0404"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
.
spk71
=
1
,
.
emu_model
=
EMU_MODEL_EMU0404
},
/* EMU 0404 */
/*
Audigy4 (Not PRO) SB0610
*/
/*
Note that all E-mu cards require kernel 2.6 or newer.
*/
{.
vendor
=
0x1102
,
.
device
=
0x0008
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 Value [Unknown]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 Value [Unknown]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0108_chip
=
1
,
.
ac97_chip
=
1
}
,
/* Tested by James@superbug.co.uk 3rd July 2005 */
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x20071102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 4 PRO [SB0380]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 4 PRO [SB0380]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1457,7 +1463,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* Just like 0x20021102
*/
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x20061102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 [SB0350b]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 [SB0350b]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1467,7 +1473,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
invert_shared_spdif
=
1
,
/* digital/analog switch swapped */
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x20021102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 ZS [SB0350]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 ZS [SB0350]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1477,7 +1483,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
invert_shared_spdif
=
1
,
/* digital/analog switch swapped */
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x20011102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 ZS [2001]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 ZS [SB0360]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1495,7 +1501,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: Yes
*/
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x10071102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 [SB0240]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 [SB0240]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1505,7 +1511,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
adc_1361t
=
1
,
/* 24 bit capture instead of 16bit */
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x10051102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 EX [1005]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 Platinum EX [SB0280]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1515,7 +1521,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
/* Dell OEM/Creative Labs Audigy 2 ZS */
/* See ALSA bug#1365 */
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x10031102
,
.
driver
=
"Audigy2"
,
.
name
=
"Audigy 2 ZS [SB0353]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB
Audigy 2 ZS [SB0353]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1524,7 +1530,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
spdif_bug
=
1
,
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x10021102
,
.
driver
=
"Audigy2"
,
.
name
=
"
Audigy 2 Platinum [SB0240P]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB Audigy 2 Platinum [SB0240P]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1535,7 +1541,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
adc_1361t
=
1
,
/* 24 bit capture instead of 16bit. Fixes ALSA bug#324 */
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
revision
=
0x04
,
.
driver
=
"Audigy2"
,
.
name
=
"Audigy 2 [Unknown]"
,
.
driver
=
"Audigy2"
,
.
name
=
"
SB
Audigy 2 [Unknown]"
,
.
id
=
"Audigy2"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1543,20 +1549,20 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
spdif_bug
=
1
,
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x00531102
,
.
driver
=
"Audigy"
,
.
name
=
"
Audigy 1 [SB0090]"
,
.
driver
=
"Audigy"
,
.
name
=
"
SB Audigy 1 [SB0092]"
,
.
id
=
"Audigy"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x00521102
,
.
driver
=
"Audigy"
,
.
name
=
"
Audigy 1 ES [SB0160]"
,
.
driver
=
"Audigy"
,
.
name
=
"
SB Audigy 1 ES [SB0160]"
,
.
id
=
"Audigy"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
.
spdif_bug
=
1
,
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0004
,
.
subsystem
=
0x00511102
,
.
driver
=
"Audigy"
,
.
name
=
"
Audigy 1 [SB0090]"
,
.
driver
=
"Audigy"
,
.
name
=
"
SB Audigy 1 [SB0090]"
,
.
id
=
"Audigy"
,
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
...
...
@@ -1567,54 +1573,55 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
emu10k2_chip
=
1
,
.
ca0102_chip
=
1
,
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x
806B
1102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! [SB0105]"
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x
100a
1102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! 5.1 [SB0220]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x806A1102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SBLive! Value [SB0103]"
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x806b1102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live! [SB0105]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x806a1102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live! Value [SB0103]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80691102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [SB0101]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [SB0101]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
/* Tested by ALSA bug#1680 26th December 2005 */
/* note: It really has SB0220 written on the card. */
/* note: It really has SB0220 written on the card, */
/* but it's SB0228 according to kx.inf */
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80661102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live
5.1 Dell OEM [SB0220]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live
! 5.1 Dell OEM [SB0228]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
/* Tested by Thomas Zehetbauer 27th Aug 2005 */
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80651102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live 5.1 [SB0220]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x100a1102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live 5.1 [SB0220]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live! 5.1 [SB0220]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80641102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live
5.1"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live
! 5.1"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
/* Tested by alsa bugtrack user "hus" bug #1297 12th Aug 2005 */
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80611102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live
5.1 [SB0060]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live!
5.1 [SB0060]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
2
,
/* ac97 is optional; both SBLive 5.1 and platinum
...
...
@@ -1622,43 +1629,43 @@ static struct snd_emu_chip_details emu_chip_details[] = {
*/
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80511102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4850]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4850]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80401102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Platinum [CT4760P]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Platinum [CT4760P]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80321102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4871]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4871]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80311102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4831]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4831]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80281102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4870]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4870]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
/* Tested by James@superbug.co.uk 3rd July 2005 */
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80271102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4832]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4832]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80261102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4830]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4830]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
...
...
@@ -1670,30 +1677,30 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x80221102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4780]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4780]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x40011102
,
.
driver
=
"EMU10K1"
,
.
name
=
"E-mu APS [
4001]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"E-mu APS [
PC545]"
,
.
id
=
"APS"
,
.
emu10k1_chip
=
1
,
.
ecard
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x00211102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! [CT4620]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! [CT4620]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
subsystem
=
0x00201102
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4670]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB
Live! Value [CT4670]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
.
sblive51
=
1
}
,
{.
vendor
=
0x1102
,
.
device
=
0x0002
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live
[Unknown]"
,
.
driver
=
"EMU10K1"
,
.
name
=
"SB Live
! [Unknown]"
,
.
id
=
"Live"
,
.
emu10k1_chip
=
1
,
.
ac97_chip
=
1
,
...
...
@@ -1702,13 +1709,13 @@ static struct snd_emu_chip_details emu_chip_details[] = {
};
int
__devinit
snd_emu10k1_create
(
struct
snd_card
*
card
,
struct
pci_dev
*
pci
,
struct
pci_dev
*
pci
,
unsigned
short
extin_mask
,
unsigned
short
extout_mask
,
long
max_cache_bytes
,
int
enable_ir
,
uint
subsystem
,
struct
snd_emu10k1
**
remu
)
struct
snd_emu10k1
**
remu
)
{
struct
snd_emu10k1
*
emu
;
int
idx
,
err
;
...
...
@@ -1722,7 +1729,8 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
*
remu
=
NULL
;
/* enable PCI device */
if
((
err
=
pci_enable_device
(
pci
))
<
0
)
err
=
pci_enable_device
(
pci
);
if
(
err
<
0
)
return
err
;
emu
=
kzalloc
(
sizeof
(
*
emu
),
GFP_KERNEL
);
...
...
@@ -1749,16 +1757,17 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
emu
->
revision
=
pci
->
revision
;
pci_read_config_dword
(
pci
,
PCI_SUBSYSTEM_VENDOR_ID
,
&
emu
->
serial
);
pci_read_config_word
(
pci
,
PCI_SUBSYSTEM_ID
,
&
emu
->
model
);
snd_printdd
(
"vendor
=0x%x, device=0x%x, subsystem_vendor_id=0x%x, subsystem_id=0x%x
\n
"
,
pci
->
vendor
,
pci
->
device
,
emu
->
serial
,
emu
->
model
);
snd_printdd
(
"vendor
= 0x%x, device = 0x%x, subsystem_vendor_id = 0x%x, subsystem_id = 0x%x
\n
"
,
pci
->
vendor
,
pci
->
device
,
emu
->
serial
,
emu
->
model
);
for
(
c
=
emu_chip_details
;
c
->
vendor
;
c
++
)
{
if
(
c
->
vendor
==
pci
->
vendor
&&
c
->
device
==
pci
->
device
)
{
if
(
subsystem
)
{
if
(
c
->
subsystem
&&
(
c
->
subsystem
==
subsystem
)
)
{
if
(
c
->
subsystem
&&
(
c
->
subsystem
==
subsystem
)
)
break
;
}
else
continue
;
else
continue
;
}
else
{
if
(
c
->
subsystem
&&
(
c
->
subsystem
!=
emu
->
serial
)
)
if
(
c
->
subsystem
&&
(
c
->
subsystem
!=
emu
->
serial
))
continue
;
if
(
c
->
revision
&&
c
->
revision
!=
emu
->
revision
)
continue
;
...
...
@@ -1774,13 +1783,17 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
}
emu
->
card_capabilities
=
c
;
if
(
c
->
subsystem
&&
!
subsystem
)
snd_printdd
(
"Sound card name
=
%s
\n
"
,
c
->
name
);
snd_printdd
(
"Sound card name
=
%s
\n
"
,
c
->
name
);
else
if
(
subsystem
)
snd_printdd
(
"Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x. Forced to subsytem=0x%x
\n
"
,
c
->
name
,
pci
->
vendor
,
pci
->
device
,
emu
->
serial
,
c
->
subsystem
);
snd_printdd
(
"Sound card name = %s, "
"vendor = 0x%x, device = 0x%x, subsystem = 0x%x. "
"Forced to subsytem = 0x%x
\n
"
,
c
->
name
,
pci
->
vendor
,
pci
->
device
,
emu
->
serial
,
c
->
subsystem
);
else
snd_printdd
(
"Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x.
\n
"
,
c
->
name
,
pci
->
vendor
,
pci
->
device
,
emu
->
serial
);
snd_printdd
(
"Sound card name = %s, "
"vendor = 0x%x, device = 0x%x, subsystem = 0x%x.
\n
"
,
c
->
name
,
pci
->
vendor
,
pci
->
device
,
emu
->
serial
);
if
(
!*
card
->
id
&&
c
->
id
)
{
int
i
,
n
=
0
;
...
...
@@ -1815,7 +1828,8 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
else
emu
->
gpr_base
=
FXGPREGBASE
;
if
((
err
=
pci_request_regions
(
pci
,
"EMU10K1"
))
<
0
)
{
err
=
pci_request_regions
(
pci
,
"EMU10K1"
);
if
(
err
<
0
)
{
kfree
(
emu
);
pci_disable_device
(
pci
);
return
err
;
...
...
@@ -1862,21 +1876,25 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
emu
->
enable_ir
=
enable_ir
;
if
(
emu
->
card_capabilities
->
ca_cardbus_chip
)
{
if
((
err
=
snd_emu10k1_cardbus_init
(
emu
))
<
0
)
err
=
snd_emu10k1_cardbus_init
(
emu
);
if
(
err
<
0
)
goto
error
;
}
if
(
emu
->
card_capabilities
->
ecard
)
{
if
((
err
=
snd_emu10k1_ecard_init
(
emu
))
<
0
)
err
=
snd_emu10k1_ecard_init
(
emu
);
if
(
err
<
0
)
goto
error
;
}
else
if
(
emu
->
card_capabilities
->
emu_model
)
{
if
((
err
=
snd_emu10k1_emu1010_init
(
emu
))
<
0
)
{
err
=
snd_emu10k1_emu1010_init
(
emu
);
if
(
err
<
0
)
{
snd_emu10k1_free
(
emu
);
return
err
;
}
}
else
{
/* 5.1: Enable the additional AC97 Slots. If the emu10k1 version
does not support this, it shouldn't do any harm */
snd_emu10k1_ptr_write
(
emu
,
AC97SLOT
,
0
,
AC97SLOT_CNTR
|
AC97SLOT_LFE
);
snd_emu10k1_ptr_write
(
emu
,
AC97SLOT
,
0
,
AC97SLOT_CNTR
|
AC97SLOT_LFE
);
}
/* initialize TRAM setup */
...
...
@@ -1929,19 +1947,23 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
emu
->
voices
[
idx
].
number
=
idx
;
}
if
((
err
=
snd_emu10k1_init
(
emu
,
enable_ir
,
0
))
<
0
)
err
=
snd_emu10k1_init
(
emu
,
enable_ir
,
0
);
if
(
err
<
0
)
goto
error
;
#ifdef CONFIG_PM
if
((
err
=
alloc_pm_buffer
(
emu
))
<
0
)
err
=
alloc_pm_buffer
(
emu
);
if
(
err
<
0
)
goto
error
;
#endif
/* Initialize the effect engine */
if
((
err
=
snd_emu10k1_init_efx
(
emu
))
<
0
)
err
=
snd_emu10k1_init_efx
(
emu
);
if
(
err
<
0
)
goto
error
;
snd_emu10k1_audio_enable
(
emu
);
if
((
err
=
snd_device_new
(
card
,
SNDRV_DEV_LOWLEVEL
,
emu
,
&
ops
))
<
0
)
err
=
snd_device_new
(
card
,
SNDRV_DEV_LOWLEVEL
,
emu
,
&
ops
);
if
(
err
<
0
)
goto
error
;
#ifdef CONFIG_PROC_FS
...
...
@@ -1981,7 +2003,7 @@ static int __devinit alloc_pm_buffer(struct snd_emu10k1 *emu)
if
(
emu
->
audigy
)
size
+=
ARRAY_SIZE
(
saved_regs_audigy
);
emu
->
saved_ptr
=
vmalloc
(
4
*
NUM_G
*
size
);
if
(
!
emu
->
saved_ptr
)
if
(
!
emu
->
saved_ptr
)
return
-
ENOMEM
;
if
(
snd_emu10k1_efx_alloc_pm_buffer
(
emu
)
<
0
)
return
-
ENOMEM
;
...
...
sound/pci/ice1712/ice1724.c
View file @
e7dd8c1b
...
...
@@ -382,23 +382,25 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id)
unsigned
char
status_mask
=
VT1724_IRQ_MPU_RX
|
VT1724_IRQ_MPU_TX
|
VT1724_IRQ_MTPCM
;
int
handled
=
0
;
#ifdef CONFIG_SND_DEBUG
int
timeout
=
0
;
#endif
while
(
1
)
{
status
=
inb
(
ICEREG1724
(
ice
,
IRQSTAT
));
status
&=
status_mask
;
if
(
status
==
0
)
break
;
#ifdef CONFIG_SND_DEBUG
if
(
++
timeout
>
10
)
{
printk
(
KERN_ERR
"ice1724: Too long irq loop, status = 0x%x
\n
"
,
status
);
status
=
inb
(
ICEREG1724
(
ice
,
IRQSTAT
));
printk
(
KERN_ERR
"ice1724: Too long irq loop, "
"status = 0x%x
\n
"
,
status
);
if
(
status
&
VT1724_IRQ_MPU_TX
)
{
printk
(
KERN_ERR
"ice1724: Disabling MPU_TX
\n
"
);
outb
(
inb
(
ICEREG1724
(
ice
,
IRQMASK
))
|
VT1724_IRQ_MPU_TX
,
ICEREG1724
(
ice
,
IRQMASK
));
}
break
;
}
#endif
handled
=
1
;
if
(
status
&
VT1724_IRQ_MPU_TX
)
{
spin_lock
(
&
ice
->
reg_lock
);
...
...
@@ -2351,7 +2353,6 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
{
struct
snd_ice1712
*
ice
;
int
err
;
unsigned
char
mask
;
static
struct
snd_device_ops
ops
=
{
.
dev_free
=
snd_vt1724_dev_free
,
};
...
...
@@ -2412,9 +2413,9 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
return
-
EIO
;
}
/*
unmask used interrupts
*/
mask
=
VT1724_IRQ_MPU_RX
|
VT1724_IRQ_MPU_TX
;
outb
(
mask
,
ICEREG1724
(
ice
,
IRQMASK
));
/*
MPU_RX and TX irq masks are cleared later dynamically
*/
outb
(
VT1724_IRQ_MPU_RX
|
VT1724_IRQ_MPU_TX
,
ICEREG1724
(
ice
,
IRQMASK
))
;
/* don't handle FIFO overrun/underruns (just yet),
* since they cause machine lockups
*/
...
...
sound/ppc/pmac.c
View file @
e7dd8c1b
...
...
@@ -1033,7 +1033,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
}
if
(
of_device_is_compatible
(
sound
,
"tumbler"
))
{
chip
->
model
=
PMAC_TUMBLER
;
chip
->
can_capture
=
0
;
/* no capture */
chip
->
can_capture
=
machine_is_compatible
(
"PowerMac4,2"
);
chip
->
can_duplex
=
0
;
// chip->can_byte_swap = 0; /* FIXME: check this */
chip
->
num_freqs
=
ARRAY_SIZE
(
tumbler_freqs
);
...
...
sound/ppc/tumbler.c
View file @
e7dd8c1b
...
...
@@ -875,7 +875,8 @@ static struct snd_kcontrol_new snapper_mixers[] __initdata = {
.
put
=
tumbler_put_master_switch
},
DEFINE_SNAPPER_MIX
(
"PCM Playback Volume"
,
0
,
VOL_IDX_PCM
),
DEFINE_SNAPPER_MIX
(
"PCM Playback Volume"
,
1
,
VOL_IDX_PCM2
),
/* Alternative PCM is assigned to Mic analog loopback on iBook G4 */
DEFINE_SNAPPER_MIX
(
"Mic Playback Volume"
,
0
,
VOL_IDX_PCM2
),
DEFINE_SNAPPER_MIX
(
"Monitor Mix Volume"
,
0
,
VOL_IDX_ADC
),
DEFINE_SNAPPER_MONO
(
"Tone Control - Bass"
,
bass
),
DEFINE_SNAPPER_MONO
(
"Tone Control - Treble"
,
treble
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment