Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
61710a65
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
61710a65
编写于
7月 24, 2015
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
上级
52721d9d
a798c24a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
17 deletion
+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
未找到文件。
sound/soc/soc-core.c
浏览文件 @
61710a65
...
@@ -1716,6 +1716,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
...
@@ -1716,6 +1716,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
if
(
card
->
remove
)
if
(
card
->
remove
)
card
->
remove
(
card
);
card
->
remove
(
card
);
snd_soc_dapm_free
(
&
card
->
dapm
);
soc_cleanup_card_debugfs
(
card
);
soc_cleanup_card_debugfs
(
card
);
snd_card_free
(
card
->
snd_card
);
snd_card_free
(
card
->
snd_card
);
...
...
sound/soc/soc-dapm.c
浏览文件 @
61710a65
...
@@ -358,9 +358,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
...
@@ -358,9 +358,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
data
->
widget
=
data
->
widget
=
snd_soc_dapm_new_control_unlocked
(
widget
->
dapm
,
snd_soc_dapm_new_control_unlocked
(
widget
->
dapm
,
&
template
);
&
template
);
kfree
(
name
);
if
(
!
data
->
widget
)
{
if
(
!
data
->
widget
)
{
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
err_
name
;
goto
err_
data
;
}
}
}
}
break
;
break
;
...
@@ -389,11 +390,12 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
...
@@ -389,11 +390,12 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
data
->
value
=
template
.
on_val
;
data
->
value
=
template
.
on_val
;
data
->
widget
=
snd_soc_dapm_new_control
(
widget
->
dapm
,
data
->
widget
=
snd_soc_dapm_new_control_unlocked
(
&
template
);
widget
->
dapm
,
&
template
);
kfree
(
name
);
if
(
!
data
->
widget
)
{
if
(
!
data
->
widget
)
{
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
err_
name
;
goto
err_
data
;
}
}
snd_soc_dapm_add_path
(
widget
->
dapm
,
data
->
widget
,
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,
...
@@ -408,8 +410,6 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
return
0
;
return
0
;
err_name:
kfree
(
name
);
err_data:
err_data:
kfree
(
data
);
kfree
(
data
);
return
ret
;
return
ret
;
...
@@ -418,8 +418,6 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
...
@@ -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
)
static
void
dapm_kcontrol_free
(
struct
snd_kcontrol
*
kctl
)
{
{
struct
dapm_kcontrol_data
*
data
=
snd_kcontrol_chip
(
kctl
);
struct
dapm_kcontrol_data
*
data
=
snd_kcontrol_chip
(
kctl
);
if
(
data
->
widget
)
kfree
(
data
->
widget
->
name
);
kfree
(
data
->
wlist
);
kfree
(
data
->
wlist
);
kfree
(
data
);
kfree
(
data
);
}
}
...
@@ -1952,6 +1950,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
...
@@ -1952,6 +1950,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
size_t
count
,
loff_t
*
ppos
)
size_t
count
,
loff_t
*
ppos
)
{
{
struct
snd_soc_dapm_widget
*
w
=
file
->
private_data
;
struct
snd_soc_dapm_widget
*
w
=
file
->
private_data
;
struct
snd_soc_card
*
card
=
w
->
dapm
->
card
;
char
*
buf
;
char
*
buf
;
int
in
,
out
;
int
in
,
out
;
ssize_t
ret
;
ssize_t
ret
;
...
@@ -1961,6 +1960,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
...
@@ -1961,6 +1960,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
if
(
!
buf
)
if
(
!
buf
)
return
-
ENOMEM
;
return
-
ENOMEM
;
mutex_lock
(
&
card
->
dapm_mutex
);
/* Supply widgets are not handled by is_connected_{input,output}_ep() */
/* Supply widgets are not handled by is_connected_{input,output}_ep() */
if
(
w
->
is_supply
)
{
if
(
w
->
is_supply
)
{
in
=
0
;
in
=
0
;
...
@@ -2007,6 +2008,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
...
@@ -2007,6 +2008,8 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
p
->
sink
->
name
);
p
->
sink
->
name
);
}
}
mutex_unlock
(
&
card
->
dapm_mutex
);
ret
=
simple_read_from_buffer
(
user_buf
,
count
,
ppos
,
buf
,
ret
);
ret
=
simple_read_from_buffer
(
user_buf
,
count
,
ppos
,
buf
,
ret
);
kfree
(
buf
);
kfree
(
buf
);
...
@@ -2281,11 +2284,15 @@ static ssize_t dapm_widget_show(struct device *dev,
...
@@ -2281,11 +2284,15 @@ static ssize_t dapm_widget_show(struct device *dev,
struct
snd_soc_pcm_runtime
*
rtd
=
dev_get_drvdata
(
dev
);
struct
snd_soc_pcm_runtime
*
rtd
=
dev_get_drvdata
(
dev
);
int
i
,
count
=
0
;
int
i
,
count
=
0
;
mutex_lock
(
&
rtd
->
card
->
dapm_mutex
);
for
(
i
=
0
;
i
<
rtd
->
num_codecs
;
i
++
)
{
for
(
i
=
0
;
i
<
rtd
->
num_codecs
;
i
++
)
{
struct
snd_soc_codec
*
codec
=
rtd
->
codec_dais
[
i
]
->
codec
;
struct
snd_soc_codec
*
codec
=
rtd
->
codec_dais
[
i
]
->
codec
;
count
+=
dapm_widget_show_codec
(
codec
,
buf
+
count
);
count
+=
dapm_widget_show_codec
(
codec
,
buf
+
count
);
}
}
mutex_unlock
(
&
rtd
->
card
->
dapm_mutex
);
return
count
;
return
count
;
}
}
...
@@ -3334,16 +3341,10 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
...
@@ -3334,16 +3341,10 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
}
}
prefix
=
soc_dapm_prefix
(
dapm
);
prefix
=
soc_dapm_prefix
(
dapm
);
if
(
prefix
)
{
if
(
prefix
)
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
prefix
,
widget
->
name
);
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
prefix
,
widget
->
name
);
if
(
widget
->
sname
)
else
w
->
sname
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
prefix
,
widget
->
sname
);
}
else
{
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s"
,
widget
->
name
);
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s"
,
widget
->
name
);
if
(
widget
->
sname
)
w
->
sname
=
kasprintf
(
GFP_KERNEL
,
"%s"
,
widget
->
sname
);
}
if
(
w
->
name
==
NULL
)
{
if
(
w
->
name
==
NULL
)
{
kfree
(
w
);
kfree
(
w
);
return
NULL
;
return
NULL
;
...
@@ -3792,7 +3793,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
...
@@ -3792,7 +3793,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
break
;
break
;
}
}
if
(
!
w
->
sname
||
!
strstr
(
w
->
sname
,
dai_w
->
name
))
if
(
!
w
->
sname
||
!
strstr
(
w
->
sname
,
dai_w
->
s
name
))
continue
;
continue
;
if
(
dai_w
->
id
==
snd_soc_dapm_dai_in
)
{
if
(
dai_w
->
id
==
snd_soc_dapm_dai_in
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录