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
e1f8e356
Commit
e1f8e356
authored
Dec 18, 2002
by
Jaroslav Kysela
Browse files
Options
Browse Files
Download
Plain Diff
Merge suse.cz:/home/perex/bk/linux-sound/linux-sound
into suse.cz:/home/perex/bk/linux-sound/work
parents
53b4c216
6a4dad1d
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1451 additions
and
84 deletions
+1451
-84
Documentation/sound/alsa/ALSA-Configuration.txt
Documentation/sound/alsa/ALSA-Configuration.txt
+1188
-0
Documentation/sound/alsa/ControlNames.txt
Documentation/sound/alsa/ControlNames.txt
+82
-0
drivers/net/hp100.c
drivers/net/hp100.c
+3
-0
include/sound/version.h
include/sound/version.h
+1
-1
sound/core/pcm_sgbuf.c
sound/core/pcm_sgbuf.c
+51
-1
sound/drivers/mtpav.c
sound/drivers/mtpav.c
+39
-39
sound/pci/ali5451/ali5451.c
sound/pci/ali5451/ali5451.c
+7
-4
sound/pci/fm801.c
sound/pci/fm801.c
+1
-1
sound/pci/ice1712/hoontech.h
sound/pci/ice1712/hoontech.h
+5
-2
sound/pci/intel8x0.c
sound/pci/intel8x0.c
+6
-0
sound/usb/usbaudio.c
sound/usb/usbaudio.c
+25
-18
sound/usb/usbmidi.c
sound/usb/usbmidi.c
+31
-8
sound/usb/usbmixer.c
sound/usb/usbmixer.c
+12
-10
No files found.
Documentation/sound/alsa/ALSA-Configuration.txt
0 → 100644
View file @
e1f8e356
This diff is collapsed.
Click to expand it.
Documentation/sound/alsa/ControlNames.txt
0 → 100644
View file @
e1f8e356
This document describes standard names of mixer controls.
Syntax: SOURCE [DIRECTION] FUNCTION
DIRECTION:
<nothing> (both directions)
Playback
Capture
Bypass Playback
Bypass Capture
FUNCTION:
Switch (on/off switch)
Volume
Route (route control, hardware specific)
SOURCE:
Master
Master Mono
Hardware Master
Headphone
PC Speaker
Phone
Phone Input
Phone Output
Synth
FM
Mic
Line
CD
Video
Zoom Video
Aux
PCM
PCM Front
PCM Rear
PCM Pan
Loopback
Analog Loopback (D/A -> A/D loopback)
Digital Loopback (playback -> capture loopback - without analog path)
Mono
Mono Output
Multi
ADC
Wave
Music
I2S
IEC958
Exceptions:
[Digital] Capture Source
[Digital] Capture Switch (aka input gain switch)
[Digital] Capture Volume (aka input gain volume)
[Digital] Playback Switch (aka output gain switch)
[Digital] Playback Volume (aka output gain volume)
Tone Control - Switch
Tone Control - Bass
Tone Control - Treble
3D Control - Switch
3D Control - Center
3D Control - Depth
3D Control - Wide
3D Control - Space
3D Control - Level
Mic Boost [(?dB)]
PCM interface:
Sample Clock Source { "Word", "Internal", "AutoSync" }
Clock Sync Status { "Lock", "Sync", "No Lock" }
External Rate /* external capture rate */
Capture Rate /* capture rate taken from external source */
IEC958 (S/PDIF) interface:
IEC958 [...] [Playback|Capture] Switch /* turn on/off the IEC958 interface */
IEC958 [...] [Playback|Capture] Volume /* digital volume control */
IEC958 [...] [Playback|Capture] Default /* default or global value - read/write */
IEC958 [...] [Playback|Capture] Mask /* consumer and professional mask */
IEC958 [...] [Playback|Capture] Con Mask /* consumer mask */
IEC958 [...] [Playback|Capture] Pro Mask /* professional mask */
IEC958 [...] [Playback|Capture] PCM Stream /* the settings assigned to a PCM stream */
drivers/net/hp100.c
View file @
e1f8e356
...
...
@@ -2091,6 +2091,9 @@ static void hp100_update_stats(struct net_device *dev)
static
void
hp100_misc_interrupt
(
struct
net_device
*
dev
)
{
#ifdef HP100_DEBUG_B
int
ioaddr
=
dev
->
base_addr
;
#endif
struct
hp100_private
*
lp
=
(
struct
hp100_private
*
)
dev
->
priv
;
#ifdef HP100_DEBUG_B
...
...
include/sound/version.h
View file @
e1f8e356
/* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc6"
#define CONFIG_SND_DATE " (
Wed Dec 11 21:24:39
2002 UTC)"
#define CONFIG_SND_DATE " (
Tue Dec 17 19:01:13
2002 UTC)"
sound/core/pcm_sgbuf.c
View file @
e1f8e356
...
...
@@ -92,6 +92,56 @@ int snd_pcm_sgbuf_delete(snd_pcm_substream_t *substream)
return
0
;
}
/*
* snd_pci_alloc_page - allocate a page in the valid pci dma mask
*
* returns the virtual address and stores the physical address on
* addrp. this function cannot be called from interrupt handlers or
* within spinlocks.
*/
#ifdef __i386__
/*
* on ix86, we allocate a page with GFP_KERNEL to assure the
* allocation. the code is almost same with kernel/i386/pci-dma.c but
* it allocates only a single page and checkes the validity of the
* page address with the given pci dma mask.
*/
inline
static
void
*
snd_pci_alloc_page
(
struct
pci_dev
*
pci
,
dma_addr_t
*
addrp
)
{
void
*
ptr
;
dma_addr_t
addr
;
unsigned
long
rmask
;
if
(
pci
)
rmask
=
~
(
unsigned
long
)
pci
->
dma_mask
;
else
rmask
=
0
;
ptr
=
(
void
*
)
__get_free_page
(
GFP_KERNEL
);
if
(
ptr
)
{
addr
=
virt_to_phys
(
ptr
);
if
(((
unsigned
long
)
addr
+
PAGE_SIZE
-
1
)
&
rmask
)
{
/* try to reallocate with the GFP_DMA */
free_page
((
unsigned
long
)
ptr
);
ptr
=
(
void
*
)
__get_free_page
(
GFP_KERNEL
|
GFP_DMA
);
if
(
ptr
)
/* ok, the address must be within lower 16MB... */
addr
=
virt_to_phys
(
ptr
);
else
addr
=
0
;
}
}
else
addr
=
0
;
if
(
ptr
)
memset
(
ptr
,
0
,
PAGE_SIZE
);
*
addrp
=
addr
;
return
ptr
;
}
#else
/* on other architectures, call snd_malloc_pci_pages() helper function
* which uses pci_alloc_consistent().
*/
#define snd_pci_alloc_page(pci, addrp) snd_malloc_pci_pages(pci, PAGE_SIZE, addrp)
#endif
/*
* allocate sg buffer table with the given byte size.
* if the buffer table already exists, try to resize it.
...
...
@@ -128,7 +178,7 @@ int snd_pcm_sgbuf_alloc(snd_pcm_substream_t *substream, size_t size)
while
(
sgbuf
->
pages
<
pages
)
{
void
*
ptr
;
dma_addr_t
addr
;
ptr
=
snd_
malloc_pci_pages
(
sgbuf
->
pci
,
PAGE_SIZE
,
&
addr
);
ptr
=
snd_
pci_alloc_page
(
sgbuf
->
pci
,
&
addr
);
if
(
!
ptr
)
return
-
ENOMEM
;
sgbuf
->
table
[
sgbuf
->
pages
].
buf
=
ptr
;
...
...
sound/drivers/mtpav.c
View file @
e1f8e356
...
...
@@ -205,19 +205,19 @@ static int translate_subdevice_to_hwport(mtpav_t *chip, int subdev)
static
int
translate_hwport_to_subdevice
(
mtpav_t
*
chip
,
int
hwport
)
{
int
p
ort
;
int
p
;
if
(
hwport
<=
0x00
)
/* all ports */
return
chip
->
num_ports
+
MTPAV_PIDX_BROADCAST
;
else
if
(
hwport
<=
0x08
)
{
/* single port */
p
ort
=
hwport
-
1
;
if
(
p
ort
>=
chip
->
num_ports
)
p
ort
=
0
;
return
p
ort
;
p
=
hwport
-
1
;
if
(
p
>=
chip
->
num_ports
)
p
=
0
;
return
p
;
}
else
if
(
hwport
<=
0x10
)
{
/* remote port */
p
ort
=
hwport
-
0x09
+
chip
->
num_ports
;
if
(
p
ort
>=
chip
->
num_ports
*
2
)
p
ort
=
chip
->
num_ports
;
return
p
ort
;
p
=
hwport
-
0x09
+
chip
->
num_ports
;
if
(
p
>=
chip
->
num_ports
*
2
)
p
=
chip
->
num_ports
;
return
p
;
}
else
if
(
hwport
==
0x11
)
/* computer port */
return
chip
->
num_ports
+
MTPAV_PIDX_COMPUTER
;
else
/* ADAT */
...
...
@@ -335,11 +335,11 @@ static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream)
static
void
snd_mtpav_portscan
(
mtpav_t
*
chip
)
// put mtp into smart routing mode
{
u8
p
ort
;
u8
p
;
for
(
p
ort
=
0
;
port
<
8
;
port
++
)
{
for
(
p
=
0
;
p
<
8
;
p
++
)
{
snd_mtpav_send_byte
(
chip
,
0xf5
);
snd_mtpav_send_byte
(
chip
,
p
ort
);
snd_mtpav_send_byte
(
chip
,
p
);
snd_mtpav_send_byte
(
chip
,
0xfe
);
}
}
...
...
@@ -350,12 +350,12 @@ static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode
static
int
snd_mtpav_input_open
(
snd_rawmidi_substream_t
*
substream
)
{
unsigned
long
flags
;
mtpav_port_t
*
port
=
&
mtp_card
->
ports
[
substream
->
number
];
mtpav_port_t
*
port
p
=
&
mtp_card
->
ports
[
substream
->
number
];
//printk("mtpav port: %d opened\n", (int) substream->number);
spin_lock_irqsave
(
&
mtp_card
->
spinlock
,
flags
);
port
->
mode
|=
MTPAV_MODE_INPUT_OPENED
;
port
->
input
=
substream
;
port
p
->
mode
|=
MTPAV_MODE_INPUT_OPENED
;
port
p
->
input
=
substream
;
if
(
mtp_card
->
share_irq
++
==
0
)
snd_mtpav_mputreg
(
mtp_card
,
CREG
,
(
SIGC_INTEN
|
SIGC_WRITE
));
// enable pport interrupts
spin_unlock_irqrestore
(
&
mtp_card
->
spinlock
,
flags
);
...
...
@@ -368,14 +368,14 @@ static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream)
static
int
snd_mtpav_input_close
(
snd_rawmidi_substream_t
*
substream
)
{
unsigned
long
flags
;
mtpav_port_t
*
port
=
&
mtp_card
->
ports
[
substream
->
number
];
mtpav_port_t
*
port
p
=
&
mtp_card
->
ports
[
substream
->
number
];
//printk("mtpav port: %d closed\n", (int) port);
//printk("mtpav port: %d closed\n", (int) port
p
);
spin_lock_irqsave
(
&
mtp_card
->
spinlock
,
flags
);
port
->
mode
&=
(
~
MTPAV_MODE_INPUT_OPENED
);
port
->
input
=
NULL
;
port
p
->
mode
&=
(
~
MTPAV_MODE_INPUT_OPENED
);
port
p
->
input
=
NULL
;
if
(
--
mtp_card
->
share_irq
==
0
)
snd_mtpav_mputreg
(
mtp_card
,
CREG
,
0
);
// disable pport interrupts
...
...
@@ -389,13 +389,13 @@ static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream)
static
void
snd_mtpav_input_trigger
(
snd_rawmidi_substream_t
*
substream
,
int
up
)
{
unsigned
long
flags
;
mtpav_port_t
*
port
=
&
mtp_card
->
ports
[
substream
->
number
];
mtpav_port_t
*
port
p
=
&
mtp_card
->
ports
[
substream
->
number
];
spin_lock_irqsave
(
&
mtp_card
->
spinlock
,
flags
);
if
(
up
)
port
->
mode
|=
MTPAV_MODE_INPUT_TRIGGERED
;
port
p
->
mode
|=
MTPAV_MODE_INPUT_TRIGGERED
;
else
port
->
mode
&=
~
MTPAV_MODE_INPUT_TRIGGERED
;
port
p
->
mode
&=
~
MTPAV_MODE_INPUT_TRIGGERED
;
spin_unlock_irqrestore
(
&
mtp_card
->
spinlock
,
flags
);
}
...
...
@@ -416,9 +416,9 @@ static void snd_mtpav_output_timer(unsigned long data)
add_timer
(
&
chip
->
timer
);
/* process each port */
for
(
p
=
0
;
p
<=
chip
->
num_ports
*
2
+
MTPAV_PIDX_BROADCAST
;
p
++
)
{
mtpav_port_t
*
port
=
&
mtp_card
->
ports
[
p
];
if
((
port
->
mode
&
MTPAV_MODE_OUTPUT_TRIGGERED
)
&&
port
->
output
)
snd_mtpav_output_port_write
(
port
,
port
->
output
);
mtpav_port_t
*
port
p
=
&
mtp_card
->
ports
[
p
];
if
((
port
p
->
mode
&
MTPAV_MODE_OUTPUT_TRIGGERED
)
&&
portp
->
output
)
snd_mtpav_output_port_write
(
port
p
,
portp
->
output
);
}
spin_unlock
(
&
chip
->
spinlock
);
}
...
...
@@ -445,11 +445,11 @@ static void snd_mtpav_remove_output_timer(mtpav_t *chip)
static
int
snd_mtpav_output_open
(
snd_rawmidi_substream_t
*
substream
)
{
unsigned
long
flags
;
mtpav_port_t
*
port
=
&
mtp_card
->
ports
[
substream
->
number
];
mtpav_port_t
*
port
p
=
&
mtp_card
->
ports
[
substream
->
number
];
spin_lock_irqsave
(
&
mtp_card
->
spinlock
,
flags
);
port
->
mode
|=
MTPAV_MODE_OUTPUT_OPENED
;
port
->
output
=
substream
;
port
p
->
mode
|=
MTPAV_MODE_OUTPUT_OPENED
;
port
p
->
output
=
substream
;
spin_unlock_irqrestore
(
&
mtp_card
->
spinlock
,
flags
);
return
0
;
};
...
...
@@ -460,11 +460,11 @@ static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream)
static
int
snd_mtpav_output_close
(
snd_rawmidi_substream_t
*
substream
)
{
unsigned
long
flags
;
mtpav_port_t
*
port
=
&
mtp_card
->
ports
[
substream
->
number
];
mtpav_port_t
*
port
p
=
&
mtp_card
->
ports
[
substream
->
number
];
spin_lock_irqsave
(
&
mtp_card
->
spinlock
,
flags
);
port
->
mode
&=
(
~
MTPAV_MODE_OUTPUT_OPENED
);
port
->
output
=
NULL
;
port
p
->
mode
&=
(
~
MTPAV_MODE_OUTPUT_OPENED
);
port
p
->
output
=
NULL
;
spin_unlock_irqrestore
(
&
mtp_card
->
spinlock
,
flags
);
return
0
;
};
...
...
@@ -475,17 +475,17 @@ static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream)
static
void
snd_mtpav_output_trigger
(
snd_rawmidi_substream_t
*
substream
,
int
up
)
{
unsigned
long
flags
;
mtpav_port_t
*
port
=
&
mtp_card
->
ports
[
substream
->
number
];
mtpav_port_t
*
port
p
=
&
mtp_card
->
ports
[
substream
->
number
];
spin_lock_irqsave
(
&
mtp_card
->
spinlock
,
flags
);
if
(
up
)
{
if
(
!
(
port
->
mode
&
MTPAV_MODE_OUTPUT_TRIGGERED
))
{
if
(
!
(
port
p
->
mode
&
MTPAV_MODE_OUTPUT_TRIGGERED
))
{
if
(
mtp_card
->
istimer
++
==
0
)
snd_mtpav_add_output_timer
(
mtp_card
);
port
->
mode
|=
MTPAV_MODE_OUTPUT_TRIGGERED
;
port
p
->
mode
|=
MTPAV_MODE_OUTPUT_TRIGGERED
;
}
}
else
{
port
->
mode
&=
~
MTPAV_MODE_OUTPUT_TRIGGERED
;
port
p
->
mode
&=
~
MTPAV_MODE_OUTPUT_TRIGGERED
;
if
(
--
mtp_card
->
istimer
==
0
)
snd_mtpav_remove_output_timer
(
mtp_card
);
}
...
...
@@ -501,15 +501,15 @@ static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up
static
void
snd_mtpav_inmidi_process
(
mtpav_t
*
mcrd
,
u8
inbyte
)
{
mtpav_port_t
*
port
;
mtpav_port_t
*
port
p
;
if
(
mcrd
->
inmidiport
>
mcrd
->
num_ports
*
2
+
MTPAV_PIDX_BROADCAST
)
return
;
port
=
&
mcrd
->
ports
[
mcrd
->
inmidiport
];
if
(
port
->
mode
&
MTPAV_MODE_INPUT_TRIGGERED
)
{
port
p
=
&
mcrd
->
ports
[
mcrd
->
inmidiport
];
if
(
port
p
->
mode
&
MTPAV_MODE_INPUT_TRIGGERED
)
{
spin_unlock
(
&
mcrd
->
spinlock
);
snd_rawmidi_receive
(
port
->
input
,
&
inbyte
,
1
);
snd_rawmidi_receive
(
port
p
->
input
,
&
inbyte
,
1
);
spin_lock
(
&
mcrd
->
spinlock
);
}
}
...
...
sound/pci/ali5451/ali5451.c
View file @
e1f8e356
...
...
@@ -1831,9 +1831,10 @@ static int snd_ali5451_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
return
change
;
}
static
snd_kcontrol_new_t
snd_ali5451_mixer_spdif
[]
__devinit
=
{
static
snd_kcontrol_new_t
snd_ali5451_mixer_spdif
[]
__devinit
data
=
{
/* spdif aplayback switch */
ALI5451_SPDIF
(
SNDRV_CTL_NAME_IEC958
(
""
,
PLAYBACK
,
SWITCH
),
0
,
0
),
/* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */
ALI5451_SPDIF
(
"IEC958 Output switch"
,
0
,
0
),
/* spdif out to spdif channel */
ALI5451_SPDIF
(
"IEC958 Channel Output Switch"
,
0
,
1
),
/* spdif in from spdif channel */
...
...
@@ -1861,7 +1862,7 @@ static int __devinit snd_ali_mixer(ali_t * codec)
return
err
;
}
if
(
codec
->
revision
==
ALI_5451_V02
)
{
for
(
idx
=
0
;
idx
<
3
;
idx
++
)
{
for
(
idx
=
0
;
idx
<
ARRAY_SIZE
(
snd_ali5451_mixer_spdif
)
;
idx
++
)
{
err
=
snd_ctl_add
(
codec
->
card
,
snd_ctl_new1
(
&
snd_ali5451_mixer_spdif
[
idx
],
codec
));
if
(
err
<
0
)
return
err
;
}
...
...
@@ -2010,10 +2011,12 @@ static int snd_ali_chip_init(ali_t *codec)
if
(
codec
->
revision
==
ALI_5451_V02
)
{
pci_dev
=
codec
->
pci_m1533
;
pci_read_config_byte
(
pci_dev
,
0x59
,
&
temp
);
temp
|=
0x80
;
pci_write_config_byte
(
pci_dev
,
0x59
,
temp
);
pci_dev
=
codec
->
pci_m7101
;
pci_read_config_byte
(
pci_dev
,
0xb8
,
&
temp
);
temp
|=
1
<<
6
;
temp
|=
0x20
;
pci_write_config_byte
(
pci_dev
,
0xB8
,
temp
);
}
...
...
sound/pci/fm801.c
View file @
e1f8e356
...
...
@@ -164,7 +164,7 @@ struct _snd_fm801 {
};
static
struct
pci_device_id
snd_fm801_ids
[]
__devinitdata
=
{
{
0x1319
,
0x0801
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
0
,
},
/* FM801 */
{
0x1319
,
0x0801
,
PCI_ANY_ID
,
PCI_ANY_ID
,
PCI_CLASS_MULTIMEDIA_AUDIO
<<
8
,
0xffff0
0
,
0
,
},
/* FM801 */
{
0
,
}
};
...
...
sound/pci/ice1712/hoontech.h
View file @
e1f8e356
...
...
@@ -24,9 +24,12 @@
*
*/
#define HOONTECH_DEVICE_DESC "{Hoontech SoundTrack DSP 24},"
#define HOONTECH_DEVICE_DESC \
"{Hoontech SoundTrack DSP 24}," \
"{Hoontech SoundTrack DSP 24 Value}," \
"{Hoontech SoundTrack DSP 24 Media 7.1}," \
#define ICE1712_SUBDEVICE_STDSP24 0x12141217
/* Hoontech SoundTrack Audio DSP 24 */
#define ICE1712_SUBDEVICE_STDSP24
0x12141217
/* Hoontech SoundTrack Audio DSP 24 */
#define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1 0x16141217
/* Hoontech ST Audio DSP24 Media 7.1 */
extern
struct
snd_ice1712_card_info
snd_ice1712_hoontech_cards
[];
...
...
sound/pci/intel8x0.c
View file @
e1f8e356
...
...
@@ -53,6 +53,7 @@ MODULE_DEVICES("{{Intel,82801AA-ICH},"
"{Intel,MX440},"
"{SiS,SI7012},"
"{NVidia,NForce Audio},"
"{NVidia,NForce2 Audio},"
"{AMD,AMD768},"
"{AMD,AMD8111},"
"{ALI,M5455}}"
);
...
...
@@ -127,6 +128,9 @@ MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x300}},dialog
#ifndef PCI_DEVICE_ID_NVIDIA_MCP_AUDIO
#define PCI_DEVICE_ID_NVIDIA_MCP_AUDIO 0x01b1
#endif
#ifndef PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO
#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a
#endif
enum
{
DEVICE_INTEL
,
DEVICE_INTEL_ICH4
,
DEVICE_SIS
,
DEVICE_ALI
};
...
...
@@ -383,6 +387,7 @@ static struct pci_device_id snd_intel8x0_ids[] __devinitdata = {
{
0x8086
,
0x7195
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
DEVICE_INTEL
},
/* 440MX */
{
0x1039
,
0x7012
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
DEVICE_SIS
},
/* SI7012 */
{
0x10de
,
0x01b1
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
DEVICE_INTEL
},
/* NFORCE */
{
0x10de
,
0x006a
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
DEVICE_INTEL
},
/* NFORCE2 */
{
0x1022
,
0x746d
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
DEVICE_INTEL
},
/* AMD8111 */
{
0x1022
,
0x7445
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
DEVICE_INTEL
},
/* AMD768 */
{
0x10b9
,
0x5455
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
DEVICE_ALI
},
/* Ali5455 */
...
...
@@ -2298,6 +2303,7 @@ static struct shortname_table {
{
PCI_DEVICE_ID_INTEL_ICH4
,
"Intel 82801DB-ICH4"
},
{
PCI_DEVICE_ID_SI_7012
,
"SiS SI7012"
},
{
PCI_DEVICE_ID_NVIDIA_MCP_AUDIO
,
"NVidia NForce"
},
{
PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO
,
"NVidia NForce2"
},
{
0x746d
,
"AMD AMD8111"
},
{
0x7445
,
"AMD AMD768"
},
{
0x5455
,
"ALi M5455"
},
...
...
sound/usb/usbaudio.c
View file @
e1f8e356
...
...
@@ -526,7 +526,11 @@ static struct snd_urb_ops audio_urb_ops[2] = {
/*
* complete callback from data urb
*/
#ifndef OLD_USB
static
void
snd_complete_urb
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
#else
static
void
snd_complete_urb
(
struct
urb
*
urb
)
#endif
{
snd_urb_ctx_t
*
ctx
=
(
snd_urb_ctx_t
*
)
urb
->
context
;
snd_usb_substream_t
*
subs
=
ctx
->
subs
;
...
...
@@ -551,7 +555,11 @@ static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
/*
* complete callback from sync urb
*/
#ifndef OLD_USB
static
void
snd_complete_sync_urb
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
#else
static
void
snd_complete_sync_urb
(
struct
urb
*
urb
)
#endif
{
snd_urb_ctx_t
*
ctx
=
(
snd_urb_ctx_t
*
)
urb
->
context
;
snd_usb_substream_t
*
subs
=
ctx
->
subs
;
...
...
@@ -583,6 +591,9 @@ static int deactivate_urbs(snd_usb_substream_t *subs)
subs
->
running
=
0
;
if
(
subs
->
stream
->
chip
->
shutdown
)
/* to be sure... */
return
0
;
#ifndef SND_USB_ASYNC_UNLINK
if
(
in_interrupt
())
return
0
;
...
...
@@ -870,7 +881,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run
u
->
urb
->
transfer_flags
=
URB_ISO_ASAP
|
UNLINK_FLAGS
;
u
->
urb
->
number_of_packets
=
u
->
packets
;
u
->
urb
->
context
=
u
;
u
->
urb
->
complete
=
snd_complete_urb
;
u
->
urb
->
complete
=
(
usb_complete_t
)
snd_complete_urb
;
}
if
(
subs
->
syncpipe
)
{
...
...
@@ -892,7 +903,7 @@ static int init_substream_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *run
u
->
urb
->
transfer_flags
=
URB_ISO_ASAP
|
UNLINK_FLAGS
;
u
->
urb
->
number_of_packets
=
u
->
packets
;
u
->
urb
->
context
=
u
;
u
->
urb
->
complete
=
snd_complete_sync_urb
;
u
->
urb
->
complete
=
(
usb_complete_t
)
snd_complete_sync_urb
;
}
}
return
0
;
...
...
@@ -2253,9 +2264,6 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
snd_usb_audio_t
*
chip
;
snd_card_t
*
card
;
struct
list_head
*
p
;
snd_usb_stream_t
*
as
;
snd_usb_substream_t
*
subs
;
int
idx
;
if
(
ptr
==
(
void
*
)
-
1
)
return
;
...
...
@@ -2265,22 +2273,21 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
down
(
&
register_mutex
);
chip
->
shutdown
=
1
;
chip
->
num_interfaces
--
;
if
(
chip
->
num_interfaces
<=
0
)
if
(
chip
->
num_interfaces
<=
0
)
{
snd_card_disconnect
(
card
);
list_for_each
(
p
,
&
chip
->
pcm_list
)
{
as
=
list_entry
(
p
,
snd_usb_stream_t
,
list
);
for
(
idx
=
0
;
idx
<
2
;
idx
++
)
{
subs
=
&
as
->
substream
[
idx
];
if
(
!
subs
->
num_formats
)
continue
;
release_substream_urbs
(
subs
);
if
(
subs
->
interface
>=
0
)
{
usb_set_interface
(
subs
->
dev
,
subs
->
interface
,
0
);
subs
->
interface
=
-
1
;
/* release the pcm resources */
list_for_each
(
p
,
&
chip
->
pcm_list
)
{
snd_usb_stream_t
*
as
;
int
idx
;
as
=
list_entry
(
p
,
snd_usb_stream_t
,
list
);
for
(
idx
=
0
;
idx
<
2
;
idx
++
)
{
snd_usb_substream_t
*
subs
;
subs
=
&
as
->
substream
[
idx
];
if
(
!
subs
->
num_formats
)
continue
;
release_substream_urbs
(
subs
);
}
}
}
if
(
chip
->
num_interfaces
<=
0
)
{
up
(
&
register_mutex
);
snd_card_free_in_thread
(
card
);
}
else
{
...
...
sound/usb/usbmidi.c
View file @
e1f8e356
...
...
@@ -172,7 +172,11 @@ static void snd_usbmidi_input_packet(snd_usb_midi_in_endpoint_t* ep,
/*
* Processes the data read from the device.
*/
#ifndef OLD_USB
static
void
snd_usbmidi_in_urb_complete
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
#else
static
void
snd_usbmidi_in_urb_complete
(
struct
urb
*
urb
)
#endif
{
snd_usb_midi_in_endpoint_t
*
ep
=
snd_magic_cast
(
snd_usb_midi_in_endpoint_t
,
urb
->
context
,
return
);
...
...
@@ -197,7 +201,11 @@ static void snd_usbmidi_in_urb_complete(struct urb* urb, struct pt_regs *regs)
/*
* Converts the data read from a Midiman device to standard USB MIDI packets.
*/
#ifndef OLD_USB
static
void
snd_usbmidi_in_midiman_complete
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
#else
static
void
snd_usbmidi_in_midiman_complete
(
struct
urb
*
urb
)
#endif
{
if
(
urb
->
status
==
0
)
{
uint8_t
*
buffer
=
(
uint8_t
*
)
urb
->
transfer_buffer
;
...
...
@@ -223,10 +231,18 @@ static void snd_usbmidi_in_midiman_complete(struct urb* urb, struct pt_regs *reg
}
}
}
#ifndef OLD_USB
snd_usbmidi_in_urb_complete
(
urb
,
regs
);
#else
snd_usbmidi_in_urb_complete
(
urb
);
#endif
}
#ifndef OLD_USB
static
void
snd_usbmidi_out_urb_complete
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
#else
static
void
snd_usbmidi_out_urb_complete
(
struct
urb
*
urb
)
#endif
{
snd_usb_midi_out_endpoint_t
*
ep
=
snd_magic_cast
(
snd_usb_midi_out_endpoint_t
,
urb
->
context
,
return
);
...
...
@@ -451,8 +467,10 @@ static void snd_usbmidi_output_trigger(snd_rawmidi_substream_t* substream, int u
usbmidi_out_port_t
*
port
=
(
usbmidi_out_port_t
*
)
substream
->
runtime
->
private_data
;
port
->
active
=
up
;
if
(
up
)
tasklet_hi_schedule
(
&
port
->
ep
->
tasklet
);
if
(
up
)
{
if
(
!
port
->
ep
->
umidi
->
chip
->
shutdown
)
/* to be sure... */
tasklet_hi_schedule
(
&
port
->
ep
->
tasklet
);
}
}
static
int
snd_usbmidi_input_open
(
snd_rawmidi_substream_t
*
substream
)
...
...
@@ -489,7 +507,8 @@ static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep)
{
if
(
ep
->
urb
)
{
if
(
ep
->
urb
->
transfer_buffer
)
{
usb_unlink_urb
(
ep
->
urb
);
if
(
!
ep
->
umidi
->
chip
->
shutdown
)
/* to be sure */
usb_unlink_urb
(
ep
->
urb
);
kfree
(
ep
->
urb
->
transfer_buffer
);
}
usb_free_urb
(
ep
->
urb
);
...
...
@@ -587,10 +606,12 @@ static int snd_usbmidi_in_endpoint_create(snd_usb_midi_t* umidi,
}
if
(
int_epd
)
usb_fill_int_urb
(
ep
->
urb
,
umidi
->
chip
->
dev
,
pipe
,
buffer
,
length
,
snd_usbmidi_in_urb_complete
,
ep
,
int_epd
->
bInterval
);
(
usb_complete_t
)
snd_usbmidi_in_urb_complete
,
ep
,
int_epd
->
bInterval
);
else
usb_fill_bulk_urb
(
ep
->
urb
,
umidi
->
chip
->
dev
,
pipe
,
buffer
,
length
,
snd_usbmidi_in_urb_complete
,
ep
);
(
usb_complete_t
)
snd_usbmidi_in_urb_complete
,
ep
);
rep
->
in
=
ep
;
return
0
;
...
...
@@ -615,7 +636,8 @@ static void snd_usbmidi_out_endpoint_delete(snd_usb_midi_out_endpoint_t* ep)
tasklet_kill
(
&
ep
->
tasklet
);
if
(
ep
->
urb
)
{
if
(
ep
->
urb
->
transfer_buffer
)
{
usb_unlink_urb
(
ep
->
urb
);
if
(
!
ep
->
umidi
->
chip
->
shutdown
)
/* to be sure */
usb_unlink_urb
(
ep
->
urb
);
kfree
(
ep
->
urb
->
transfer_buffer
);
}
usb_free_urb
(
ep
->
urb
);
...
...
@@ -654,7 +676,8 @@ static int snd_usbmidi_out_endpoint_create(snd_usb_midi_t* umidi,
return
-
ENOMEM
;
}
usb_fill_bulk_urb
(
ep
->
urb
,
umidi
->
chip
->
dev
,
pipe
,
buffer
,
ep
->
max_transfer
,
snd_usbmidi_out_urb_complete
,
ep
);
ep
->
max_transfer
,
(
usb_complete_t
)
snd_usbmidi_out_urb_complete
,
ep
);
spin_lock_init
(
&
ep
->
buffer_lock
);
tasklet_init
(
&
ep
->
tasklet
,
snd_usbmidi_out_tasklet
,
(
unsigned
long
)
ep
);
...
...
@@ -944,7 +967,7 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi,
err
=
snd_usbmidi_in_endpoint_create
(
umidi
,
&
ep_info
,
&
umidi
->
endpoints
[
0
]);
if
(
err
<
0
)
return
err
;
umidi
->
endpoints
[
0
].
in
->
urb
->
complete
=
snd_usbmidi_in_midiman_complete
;
umidi
->
endpoints
[
0
].
in
->
urb
->
complete
=
(
usb_complete_t
)
snd_usbmidi_in_midiman_complete
;
if
(
endpoint
->
out_cables
>
0x0001
)
{
ep_info
.
epnum
=
get_endpoint
(
hostif
,
4
)
->
bEndpointAddress
&
USB_ENDPOINT_NUMBER_MASK
;
...
...
sound/usb/usbmixer.c
View file @
e1f8e356
...
...
@@ -296,7 +296,7 @@ static int get_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
return
0
;
}
}
snd_printdd
(
KERN_ERR
"cannot get ctl value: req = 0x%x,
idx = 0x%x, val
= 0x%x, type = %d
\n
"
,
request
,
validx
,
cval
->
ctrlif
|
(
cval
->
id
<<
8
),
cval
->
val_type
);
snd_printdd
(
KERN_ERR
"cannot get ctl value: req = 0x%x,
wValue = 0x%x, wIndex
= 0x%x, type = %d
\n
"
,
request
,
validx
,
cval
->
ctrlif
|
(
cval
->
id
<<
8
),
cval
->
val_type
);
return
-
EINVAL
;
}
...
...
@@ -331,6 +331,7 @@ static int set_ctl_value(usb_mixer_elem_info_t *cval, int request, int validx, i
validx
,
cval
->
ctrlif
|
(
cval
->
id
<<
8
),
buf
,
val_len
,
HZ
/
10
)
>=
0
)
return
0
;
snd_printdd
(
KERN_ERR
"cannot set ctl value: req = 0x%x, wValue = 0x%x, wIndex = 0x%x, type = %d, data = 0x%x/0x%x
\n
"
,
request
,
validx
,
cval
->
ctrlif
|
(
cval
->
id
<<
8
),
cval
->
val_type
,
buf
[
0
],
buf
[
1
]);
return
-
EINVAL
;
}
...
...
@@ -571,11 +572,11 @@ static void usb_mixer_elem_free(snd_kcontrol_t *kctl)
/*
* retrieve the minimum and maximum values for the specified control
*/
static
int
get_min_max
(
usb_mixer_elem_info_t
*
cval
)
static
int
get_min_max
(
usb_mixer_elem_info_t
*
cval
,
int
default_min
)
{
/* for failsafe */
cval
->
min
=
0
;
cval
->
max
=
1
;
cval
->
min
=
default_min
;
cval
->
max
=
cval
->
min
+
1
;
cval
->
res
=
1
;
if
(
cval
->
val_type
==
USB_MIXER_BOOLEAN
||
...
...
@@ -634,7 +635,7 @@ static int mixer_ctl_feature_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t
uinfo
->
value
.
integer
.
max
=
1
;
}
else
{
if
(
!
cval
->
initialized
)
get_min_max
(
cval
);
get_min_max
(
cval
,
0
);
uinfo
->
value
.
integer
.
min
=
0
;
uinfo
->
value
.
integer
.
max
=
(
cval
->
max
-
cval
->
min
)
/
cval
->
res
;
}
...
...
@@ -784,7 +785,7 @@ static void build_feature_ctl(mixer_build_t *state, unsigned char *desc,
}
/* get min/max values */
get_min_max
(
cval
);
get_min_max
(
cval
,
0
);
kctl
=
snd_ctl_new1
(
&
usb_feature_unit_ctl
,
cval
);
if
(
!
kctl
)
{
...
...
@@ -952,7 +953,7 @@ static void build_mixer_unit_ctl(mixer_build_t *state, unsigned char *desc,
}
/* get min/max values */
get_min_max
(
cval
);
get_min_max
(
cval
,
0
);
kctl
=
snd_ctl_new1
(
&
usb_feature_unit_ctl
,
cval
);
if
(
!
kctl
)
{
...
...
@@ -1060,6 +1061,7 @@ struct procunit_value_info {
int
control
;
char
*
suffix
;
int
val_type
;
int
min_value
;
};
struct
procunit_info
{
...
...
@@ -1070,12 +1072,12 @@ struct procunit_info {
static
struct
procunit_value_info
updown_proc_info
[]
=
{
{
USB_PROC_UPDOWN_SWITCH
,
"Switch"
,
USB_MIXER_BOOLEAN
},
{
USB_PROC_UPDOWN_MODE_SEL
,
"Mode Select"
,
USB_MIXER_U8
},
{
USB_PROC_UPDOWN_MODE_SEL
,
"Mode Select"
,
USB_MIXER_U8
,
1
},
{
0
}
};
static
struct
procunit_value_info
prologic_proc_info
[]
=
{
{
USB_PROC_PROLOGIC_SWITCH
,
"Switch"
,
USB_MIXER_BOOLEAN
},
{
USB_PROC_PROLOGIC_MODE_SEL
,
"Mode Select"
,
USB_MIXER_U8
},
{
USB_PROC_PROLOGIC_MODE_SEL
,
"Mode Select"
,
USB_MIXER_U8
,
1
},
{
0
}
};
static
struct
procunit_value_info
threed_enh_proc_info
[]
=
{
...
...
@@ -1173,7 +1175,7 @@ static int build_audio_procunit(mixer_build_t *state, int unitid, unsigned char
cval
->
channels
=
1
;
/* get min/max values */
get_min_max
(
cval
);
get_min_max
(
cval
,
valinfo
->
min_value
);
kctl
=
snd_ctl_new1
(
&
mixer_procunit_ctl
,
cval
);
if
(
!
kctl
)
{
...
...
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