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
61710a65
Commit
61710a65
authored
Jul 24, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
parents
52721d9d
a798c24a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
17 deletions
+19
-17
sound/soc/soc-core.c
sound/soc/soc-core.c
+1
-0
sound/soc/soc-dapm.c
sound/soc/soc-dapm.c
+18
-17
No files found.
sound/soc/soc-core.c
View file @
61710a65
...
...
@@ -1716,6 +1716,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
if
(
card
->
remove
)
card
->
remove
(
card
);
snd_soc_dapm_free
(
&
card
->
dapm
);
soc_cleanup_card_debugfs
(
card
);
snd_card_free
(
card
->
snd_card
);
...
...
sound/soc/soc-dapm.c
View file @
61710a65
...
...
@@ -358,9 +358,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
data
->
widget
=
snd_soc_dapm_new_control_unlocked
(
widget
->
dapm
,
&
template
);
kfree
(
name
);
if
(
!
data
->
widget
)
{
ret
=
-
ENOMEM
;
goto
err_
name
;
goto
err_
data
;
}
}
break
;
...
...
@@ -389,11 +390,12 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
data
->
value
=
template
.
on_val
;
data
->
widget
=
snd_soc_dapm_new_control
(
widget
->
dapm
,
&
template
);
data
->
widget
=
snd_soc_dapm_new_control_unlocked
(
widget
->
dapm
,
&
template
);
kfree
(
name
);
if
(
!
data
->
widget
)
{
ret
=
-
ENOMEM
;
goto
err_
name
;
goto
err_
data
;
}
snd_soc_dapm_add_path
(
widget
->
dapm
,
data
->
widget
,
...
...
@@ -408,8 +410,6 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
return
0
;
err_name:
kfree
(
name
);
err_data:
kfree
(
data
);
return
ret
;
...
...
@@ -418,8 +418,6 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
static
void
dapm_kcontrol_free
(
struct
snd_kcontrol
*
kctl
)
{
struct
dapm_kcontrol_data
*
data
=
snd_kcontrol_chip
(
kctl
);
if
(
data
->
widget
)
kfree
(
data
->
widget
->
name
);
kfree
(
data
->
wlist
);
kfree
(
data
);
}
...
...
@@ -1952,6 +1950,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
size_t
count
,
loff_t
*
ppos
)
{
struct
snd_soc_dapm_widget
*
w
=
file
->
private_data
;
struct
snd_soc_card
*
card
=
w
->
dapm
->
card
;
char
*
buf
;
int
in
,
out
;
ssize_t
ret
;
...
...
@@ -1961,6 +1960,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
if
(
!
buf
)
return
-
ENOMEM
;
mutex_lock
(
&
card
->
dapm_mutex
);
/* Supply widgets are not handled by is_connected_{input,output}_ep() */
if
(
w
->
is_supply
)
{
in
=
0
;
...
...
@@ -2007,6 +2008,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
p
->
sink
->
name
);
}
mutex_unlock
(
&
card
->
dapm_mutex
);
ret
=
simple_read_from_buffer
(
user_buf
,
count
,
ppos
,
buf
,
ret
);
kfree
(
buf
);
...
...
@@ -2281,11 +2284,15 @@ static ssize_t dapm_widget_show(struct device *dev,
struct
snd_soc_pcm_runtime
*
rtd
=
dev_get_drvdata
(
dev
);
int
i
,
count
=
0
;
mutex_lock
(
&
rtd
->
card
->
dapm_mutex
);
for
(
i
=
0
;
i
<
rtd
->
num_codecs
;
i
++
)
{
struct
snd_soc_codec
*
codec
=
rtd
->
codec_dais
[
i
]
->
codec
;
count
+=
dapm_widget_show_codec
(
codec
,
buf
+
count
);
}
mutex_unlock
(
&
rtd
->
card
->
dapm_mutex
);
return
count
;
}
...
...
@@ -3334,16 +3341,10 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
}
prefix
=
soc_dapm_prefix
(
dapm
);
if
(
prefix
)
{
if
(
prefix
)
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
prefix
,
widget
->
name
);
if
(
widget
->
sname
)
w
->
sname
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
prefix
,
widget
->
sname
);
}
else
{
else
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s"
,
widget
->
name
);
if
(
widget
->
sname
)
w
->
sname
=
kasprintf
(
GFP_KERNEL
,
"%s"
,
widget
->
sname
);
}
if
(
w
->
name
==
NULL
)
{
kfree
(
w
);
return
NULL
;
...
...
@@ -3792,7 +3793,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
break
;
}
if
(
!
w
->
sname
||
!
strstr
(
w
->
sname
,
dai_w
->
name
))
if
(
!
w
->
sname
||
!
strstr
(
w
->
sname
,
dai_w
->
s
name
))
continue
;
if
(
dai_w
->
id
==
snd_soc_dapm_dai_in
)
{
...
...
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