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
8e3392d3
Commit
8e3392d3
authored
Sep 20, 2022
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-linus' into for-next
parents
01a72aef
79764ec7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
28 deletions
+25
-28
sound/core/init.c
sound/core/init.c
+5
-5
sound/usb/endpoint.c
sound/usb/endpoint.c
+14
-9
sound/usb/endpoint.h
sound/usb/endpoint.h
+2
-4
sound/usb/pcm.c
sound/usb/pcm.c
+4
-10
No files found.
sound/core/init.c
View file @
8e3392d3
...
...
@@ -178,10 +178,8 @@ int snd_card_new(struct device *parent, int idx, const char *xid,
return
-
ENOMEM
;
err
=
snd_card_init
(
card
,
parent
,
idx
,
xid
,
module
,
extra_size
);
if
(
err
<
0
)
{
kfree
(
card
);
return
err
;
}
if
(
err
<
0
)
return
err
;
/* card is freed by error handler */
*
card_ret
=
card
;
return
0
;
...
...
@@ -233,7 +231,7 @@ int snd_devm_card_new(struct device *parent, int idx, const char *xid,
card
->
managed
=
true
;
err
=
snd_card_init
(
card
,
parent
,
idx
,
xid
,
module
,
extra_size
);
if
(
err
<
0
)
{
devres_free
(
card
);
devres_free
(
card
);
/* in managed mode, we need to free manually */
return
err
;
}
...
...
@@ -297,6 +295,8 @@ static int snd_card_init(struct snd_card *card, struct device *parent,
mutex_unlock
(
&
snd_card_mutex
);
dev_err
(
parent
,
"cannot find the slot for index %d (range 0-%i), error: %d
\n
"
,
idx
,
snd_ecards_limit
-
1
,
err
);
if
(
!
card
->
managed
)
kfree
(
card
);
/* manually free here, as no destructor called */
return
err
;
}
set_bit
(
idx
,
snd_cards_lock
);
/* lock it */
...
...
sound/usb/endpoint.c
View file @
8e3392d3
...
...
@@ -758,8 +758,7 @@ bool snd_usb_endpoint_compatible(struct snd_usb_audio *chip,
* The endpoint needs to be closed via snd_usb_endpoint_close() later.
*
* Note that this function doesn't configure the endpoint. The substream
* needs to set it up later via snd_usb_endpoint_set_params() and
* snd_usb_endpoint_prepare().
* needs to set it up later via snd_usb_endpoint_configure().
*/
struct
snd_usb_endpoint
*
snd_usb_endpoint_open
(
struct
snd_usb_audio
*
chip
,
...
...
@@ -1293,13 +1292,12 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep)
/*
* snd_usb_endpoint_set_params: configure an snd_usb_endpoint
*
* It's called either from hw_params callback.
* Determine the number of URBs to be used on this endpoint.
* An endpoint must be configured before it can be started.
* An endpoint that is already running can not be reconfigured.
*/
int
snd_usb_endpoint_set_params
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
)
static
int
snd_usb_endpoint_set_params
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
)
{
const
struct
audioformat
*
fmt
=
ep
->
cur_audiofmt
;
int
err
;
...
...
@@ -1382,18 +1380,18 @@ static int init_sample_rate(struct snd_usb_audio *chip,
}
/*
* snd_usb_endpoint_
prepare: Prepa
re the endpoint
* snd_usb_endpoint_
configure: Configu
re the endpoint
*
* This function sets up the EP to be fully usable state.
* It's called either from prepare callback.
* It's called either from
hw_params or
prepare callback.
* The function checks need_setup flag, and performs nothing unless needed,
* so it's safe to call this multiple times.
*
* This returns zero if unchanged, 1 if the configuration has changed,
* or a negative error code.
*/
int
snd_usb_endpoint_
prepa
re
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
)
int
snd_usb_endpoint_
configu
re
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
)
{
bool
iface_first
;
int
err
=
0
;
...
...
@@ -1414,6 +1412,9 @@ int snd_usb_endpoint_prepare(struct snd_usb_audio *chip,
if
(
err
<
0
)
goto
unlock
;
}
err
=
snd_usb_endpoint_set_params
(
chip
,
ep
);
if
(
err
<
0
)
goto
unlock
;
goto
done
;
}
...
...
@@ -1441,6 +1442,10 @@ int snd_usb_endpoint_prepare(struct snd_usb_audio *chip,
if
(
err
<
0
)
goto
unlock
;
err
=
snd_usb_endpoint_set_params
(
chip
,
ep
);
if
(
err
<
0
)
goto
unlock
;
err
=
snd_usb_select_mode_quirk
(
chip
,
ep
->
cur_audiofmt
);
if
(
err
<
0
)
goto
unlock
;
...
...
sound/usb/endpoint.h
View file @
8e3392d3
...
...
@@ -17,10 +17,8 @@ snd_usb_endpoint_open(struct snd_usb_audio *chip,
bool
is_sync_ep
);
void
snd_usb_endpoint_close
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
);
int
snd_usb_endpoint_set_params
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
);
int
snd_usb_endpoint_prepare
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
);
int
snd_usb_endpoint_configure
(
struct
snd_usb_audio
*
chip
,
struct
snd_usb_endpoint
*
ep
);
int
snd_usb_endpoint_get_clock_rate
(
struct
snd_usb_audio
*
chip
,
int
clock
);
bool
snd_usb_endpoint_compatible
(
struct
snd_usb_audio
*
chip
,
...
...
sound/usb/pcm.c
View file @
8e3392d3
...
...
@@ -443,17 +443,17 @@ static int configure_endpoints(struct snd_usb_audio *chip,
if
(
stop_endpoints
(
subs
,
false
))
sync_pending_stops
(
subs
);
if
(
subs
->
sync_endpoint
)
{
err
=
snd_usb_endpoint_
prepa
re
(
chip
,
subs
->
sync_endpoint
);
err
=
snd_usb_endpoint_
configu
re
(
chip
,
subs
->
sync_endpoint
);
if
(
err
<
0
)
return
err
;
}
err
=
snd_usb_endpoint_
prepa
re
(
chip
,
subs
->
data_endpoint
);
err
=
snd_usb_endpoint_
configu
re
(
chip
,
subs
->
data_endpoint
);
if
(
err
<
0
)
return
err
;
snd_usb_set_format_quirk
(
subs
,
subs
->
cur_audiofmt
);
}
else
{
if
(
subs
->
sync_endpoint
)
{
err
=
snd_usb_endpoint_
prepa
re
(
chip
,
subs
->
sync_endpoint
);
err
=
snd_usb_endpoint_
configu
re
(
chip
,
subs
->
sync_endpoint
);
if
(
err
<
0
)
return
err
;
}
...
...
@@ -551,13 +551,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
subs
->
cur_audiofmt
=
fmt
;
mutex_unlock
(
&
chip
->
mutex
);
if
(
subs
->
sync_endpoint
)
{
ret
=
snd_usb_endpoint_set_params
(
chip
,
subs
->
sync_endpoint
);
if
(
ret
<
0
)
goto
unlock
;
}
ret
=
snd_usb_endpoint_set_params
(
chip
,
subs
->
data_endpoint
);
ret
=
configure_endpoints
(
chip
,
subs
);
unlock:
if
(
ret
<
0
)
...
...
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