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
nexedi
linux
Commits
2fe12282
Commit
2fe12282
authored
Jan 20, 2004
by
Jaroslav Kysela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA CVS update - Jaroslav Kysela <perex@suse.cz>
USB generic driver Show proper ID for Creative Sound Blaster MP3+
parent
a6f4b5b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
29 deletions
+38
-29
sound/usb/usbaudio.c
sound/usb/usbaudio.c
+25
-28
sound/usb/usbaudio.h
sound/usb/usbaudio.h
+2
-1
sound/usb/usbquirks.h
sound/usb/usbquirks.h
+11
-0
No files found.
sound/usb/usbaudio.c
View file @
2fe12282
...
...
@@ -2717,6 +2717,7 @@ static int snd_usb_audio_create(snd_card_t *card, struct usb_device *dev,
{
snd_usb_audio_t
*
chip
;
int
err
,
len
;
char
component
[
14
];
static
snd_device_ops_t
ops
=
{
.
dev_free
=
snd_usb_audio_dev_free
,
};
...
...
@@ -2737,46 +2738,42 @@ static int snd_usb_audio_create(snd_card_t *card, struct usb_device *dev,
}
strcpy
(
card
->
driver
,
"USB-Audio"
);
sprintf
(
component
,
"USB%#04x:%#04x"
,
dev
->
descriptor
.
idVendor
,
dev
->
descriptor
.
idProduct
);
snd_component_add
(
card
,
component
);
/* retrieve the device string as shortname */
if
(
dev
->
descriptor
.
iProduct
)
len
=
usb_string
(
dev
,
dev
->
descriptor
.
iProduct
,
card
->
shortname
,
sizeof
(
card
->
shortname
));
else
len
=
0
;
if
(
quirk
&&
quirk
->
product_name
)
{
len
=
strlcpy
(
card
->
shortname
,
quirk
->
product_name
,
sizeof
(
card
->
shortname
));
}
else
{
if
(
dev
->
descriptor
.
iProduct
)
len
=
usb_string
(
dev
,
dev
->
descriptor
.
iProduct
,
card
->
shortname
,
sizeof
(
card
->
shortname
));
else
len
=
0
;
}
if
(
len
<=
0
)
{
if
(
quirk
&&
quirk
->
product_name
)
{
strlcpy
(
card
->
shortname
,
quirk
->
product_name
,
sizeof
(
card
->
shortname
));
}
else
{
sprintf
(
card
->
shortname
,
"USB Device %#04x:%#04x"
,
dev
->
descriptor
.
idVendor
,
dev
->
descriptor
.
idProduct
);
}
sprintf
(
card
->
shortname
,
"USB Device %#04x:%#04x"
,
dev
->
descriptor
.
idVendor
,
dev
->
descriptor
.
idProduct
);
}
/* retrieve the vendor and device strings as longname */
if
(
dev
->
descriptor
.
iManufacturer
)
len
=
usb_string
(
dev
,
dev
->
descriptor
.
iManufacturer
,
card
->
longname
,
sizeof
(
card
->
longname
));
else
len
=
0
;
if
(
len
<=
0
)
{
if
(
quirk
&&
quirk
->
vendor_name
)
{
len
=
strlcpy
(
card
->
longname
,
quirk
->
vendor_name
,
sizeof
(
card
->
longname
));
}
else
{
if
(
quirk
&&
quirk
->
vendor_name
)
{
len
=
strlcpy
(
card
->
longname
,
quirk
->
vendor_name
,
sizeof
(
card
->
longname
));
}
else
{
if
(
dev
->
descriptor
.
iManufacturer
)
len
=
usb_string
(
dev
,
dev
->
descriptor
.
iManufacturer
,
card
->
longname
,
sizeof
(
card
->
longname
));
else
len
=
0
;
}
}
if
(
len
>
0
)
strlcat
(
card
->
longname
,
" "
,
sizeof
(
card
->
longname
));
len
=
strlen
(
card
->
longname
);
if
((
!
dev
->
descriptor
.
iProduct
||
usb_string
(
dev
,
dev
->
descriptor
.
iProduct
,
card
->
longname
+
len
,
sizeof
(
card
->
longname
)
-
len
)
<=
0
)
&&
quirk
&&
quirk
->
product_name
)
{
if
(
quirk
&&
quirk
->
product_name
)
strlcat
(
card
->
longname
,
quirk
->
product_name
,
sizeof
(
card
->
longname
));
}
len
=
strlcat
(
card
->
longname
,
" at "
,
sizeof
(
card
->
longname
));
...
...
@@ -2815,7 +2812,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
alts
=
&
intf
->
altsetting
[
0
];
ifnum
=
get_iface_desc
(
alts
)
->
bInterfaceNumber
;
if
(
quirk
&&
quirk
->
ifnum
!=
QUIRK_ANY_INTERFACE
&&
ifnum
!=
quirk
->
ifnum
)
if
(
quirk
&&
quirk
->
ifnum
>=
0
&&
ifnum
!=
quirk
->
ifnum
)
goto
__err_val
;
/* SB Extigy needs special boot-up sequence */
...
...
@@ -2876,7 +2873,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
}
err
=
1
;
/* continue */
if
(
quirk
)
{
if
(
quirk
&&
quirk
->
ifnum
!=
QUIRK_NO_INTERFACE
)
{
/* need some special handlings */
if
((
err
=
snd_usb_create_quirk
(
chip
,
intf
,
quirk
))
<
0
)
goto
__error
;
...
...
sound/usb/usbaudio.h
View file @
2fe12282
...
...
@@ -142,7 +142,8 @@ struct snd_usb_audio {
* Information about devices with broken descriptors
*/
#define QUIRK_ANY_INTERFACE -1
#define QUIRK_NO_INTERFACE -2
#define QUIRK_ANY_INTERFACE -1
#define QUIRK_MIDI_FIXED_ENDPOINT 0
#define QUIRK_MIDI_YAMAHA 1
...
...
sound/usb/usbquirks.h
View file @
2fe12282
...
...
@@ -668,4 +668,15 @@ YAMAHA_DEVICE(0x5008, "01V96"),
}
},
{
/* Creative Sound Blaster MP3+ */
USB_DEVICE
(
0x041e
,
0x3010
),
.
driver_info
=
(
unsigned
long
)
&
(
const
snd_usb_audio_quirk_t
)
{
.
vendor_name
=
"Creative Labs"
,
.
product_name
=
"Sound Blaster MP3+"
,
.
ifnum
=
QUIRK_NO_INTERFACE
}
},
#undef USB_DEVICE_VENDOR_SPEC
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