Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a18a31a1
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a18a31a1
编写于
1月 10, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/fix/core' into tmp
上级
ae1abb0c
d3bf1561
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
7 deletion
+39
-7
include/sound/soc.h
include/sound/soc.h
+6
-4
sound/soc/soc-core.c
sound/soc/soc-core.c
+32
-3
sound/soc/soc-pcm.c
sound/soc/soc-pcm.c
+1
-0
未找到文件。
include/sound/soc.h
浏览文件 @
a18a31a1
...
...
@@ -58,8 +58,9 @@
.info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \
.put = snd_soc_put_volsw_range, \
.private_value = (unsigned long)&(struct soc_mixer_control) \
{.reg = xreg, .shift = xshift, .min = xmin,\
.max = xmax, .platform_max = xmax, .invert = xinvert} }
{.reg = xreg, .rreg = xreg, .shift = xshift, \
.rshift = xshift, .min = xmin, .max = xmax, \
.platform_max = xmax, .invert = xinvert} }
#define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
...
...
@@ -88,8 +89,9 @@
.info = snd_soc_info_volsw_range, \
.get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
.private_value = (unsigned long)&(struct soc_mixer_control) \
{.reg = xreg, .shift = xshift, .min = xmin,\
.max = xmax, .platform_max = xmax, .invert = xinvert} }
{.reg = xreg, .rreg = xreg, .shift = xshift, \
.rshift = xshift, .min = xmin, .max = xmax, \
.platform_max = xmax, .invert = xinvert} }
#define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
...
...
sound/soc/soc-core.c
浏览文件 @
a18a31a1
...
...
@@ -1255,6 +1255,8 @@ static int soc_post_component_init(struct snd_soc_card *card,
INIT_LIST_HEAD
(
&
rtd
->
dpcm
[
SNDRV_PCM_STREAM_CAPTURE
].
fe_clients
);
ret
=
device_add
(
rtd
->
dev
);
if
(
ret
<
0
)
{
/* calling put_device() here to free the rtd->dev */
put_device
(
rtd
->
dev
);
dev_err
(
card
->
dev
,
"ASoC: failed to register runtime device: %d
\n
"
,
ret
);
return
ret
;
...
...
@@ -1554,7 +1556,7 @@ static void soc_remove_aux_dev(struct snd_soc_card *card, int num)
/* unregister the rtd device */
if
(
rtd
->
dev_registered
)
{
device_remove_file
(
rtd
->
dev
,
&
dev_attr_codec_reg
);
device_
del
(
rtd
->
dev
);
device_
unregister
(
rtd
->
dev
);
rtd
->
dev_registered
=
0
;
}
...
...
@@ -2917,7 +2919,7 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
platform_max
=
mc
->
platform_max
;
uinfo
->
type
=
SNDRV_CTL_ELEM_TYPE_INTEGER
;
uinfo
->
count
=
1
;
uinfo
->
count
=
snd_soc_volsw_is_stereo
(
mc
)
?
2
:
1
;
uinfo
->
value
.
integer
.
min
=
0
;
uinfo
->
value
.
integer
.
max
=
platform_max
-
min
;
...
...
@@ -2941,12 +2943,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
(
struct
soc_mixer_control
*
)
kcontrol
->
private_value
;
struct
snd_soc_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
unsigned
int
reg
=
mc
->
reg
;
unsigned
int
rreg
=
mc
->
rreg
;
unsigned
int
shift
=
mc
->
shift
;
int
min
=
mc
->
min
;
int
max
=
mc
->
max
;
unsigned
int
mask
=
(
1
<<
fls
(
max
))
-
1
;
unsigned
int
invert
=
mc
->
invert
;
unsigned
int
val
,
val_mask
;
int
ret
;
val
=
((
ucontrol
->
value
.
integer
.
value
[
0
]
+
min
)
&
mask
);
if
(
invert
)
...
...
@@ -2954,7 +2958,21 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
val_mask
=
mask
<<
shift
;
val
=
val
<<
shift
;
return
snd_soc_update_bits_locked
(
codec
,
reg
,
val_mask
,
val
);
ret
=
snd_soc_update_bits_locked
(
codec
,
reg
,
val_mask
,
val
);
if
(
ret
!=
0
)
return
ret
;
if
(
snd_soc_volsw_is_stereo
(
mc
))
{
val
=
((
ucontrol
->
value
.
integer
.
value
[
1
]
+
min
)
&
mask
);
if
(
invert
)
val
=
max
-
val
;
val_mask
=
mask
<<
shift
;
val
=
val
<<
shift
;
ret
=
snd_soc_update_bits_locked
(
codec
,
rreg
,
val_mask
,
val
);
}
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_put_volsw_range
);
...
...
@@ -2974,6 +2992,7 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
(
struct
soc_mixer_control
*
)
kcontrol
->
private_value
;
struct
snd_soc_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
unsigned
int
reg
=
mc
->
reg
;
unsigned
int
rreg
=
mc
->
rreg
;
unsigned
int
shift
=
mc
->
shift
;
int
min
=
mc
->
min
;
int
max
=
mc
->
max
;
...
...
@@ -2988,6 +3007,16 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
ucontrol
->
value
.
integer
.
value
[
0
]
=
ucontrol
->
value
.
integer
.
value
[
0
]
-
min
;
if
(
snd_soc_volsw_is_stereo
(
mc
))
{
ucontrol
->
value
.
integer
.
value
[
1
]
=
(
snd_soc_read
(
codec
,
rreg
)
>>
shift
)
&
mask
;
if
(
invert
)
ucontrol
->
value
.
integer
.
value
[
1
]
=
max
-
ucontrol
->
value
.
integer
.
value
[
1
];
ucontrol
->
value
.
integer
.
value
[
1
]
=
ucontrol
->
value
.
integer
.
value
[
1
]
-
min
;
}
return
0
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_get_volsw_range
);
...
...
sound/soc/soc-pcm.c
浏览文件 @
a18a31a1
...
...
@@ -1243,6 +1243,7 @@ static int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream)
if
((
be
->
dpcm
[
stream
].
state
!=
SND_SOC_DPCM_STATE_HW_PARAMS
)
&&
(
be
->
dpcm
[
stream
].
state
!=
SND_SOC_DPCM_STATE_PREPARE
)
&&
(
be
->
dpcm
[
stream
].
state
!=
SND_SOC_DPCM_STATE_HW_FREE
)
&&
(
be
->
dpcm
[
stream
].
state
!=
SND_SOC_DPCM_STATE_PAUSED
)
&&
(
be
->
dpcm
[
stream
].
state
!=
SND_SOC_DPCM_STATE_STOP
))
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录