Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
e790245e
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e790245e
编写于
12年前
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/cs4271' into asoc-next
上级
d2893232
fd23fb9f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
0 deletion
+61
-0
Documentation/devicetree/bindings/sound/cs4271.txt
Documentation/devicetree/bindings/sound/cs4271.txt
+12
-0
include/sound/cs4271.h
include/sound/cs4271.h
+15
-0
sound/soc/codecs/cs4271.c
sound/soc/codecs/cs4271.c
+34
-0
未找到文件。
Documentation/devicetree/bindings/sound/cs4271.txt
浏览文件 @
e790245e
...
...
@@ -20,6 +20,18 @@ Optional properties:
!RESET pin
- cirrus,amuteb-eq-bmutec: When given, the Codec's AMUTEB=BMUTEC flag
is enabled.
- cirrus,enable-soft-reset:
The CS4271 requires its LRCLK and MCLK to be stable before its RESET
line is de-asserted. That also means that clocks cannot be changed
without putting the chip back into hardware reset, which also requires
a complete re-initialization of all registers.
One (undocumented) workaround is to assert and de-assert the PDN bit
in the MODE2 register. This workaround can be enabled with this DT
property.
Note that this is not needed in case the clocks are stable
throughout the entire runtime of the codec.
Examples:
...
...
This diff is collapsed.
Click to expand it.
include/sound/cs4271.h
浏览文件 @
e790245e
...
...
@@ -20,6 +20,21 @@
struct
cs4271_platform_data
{
int
gpio_nreset
;
/* GPIO driving Reset pin, if any */
bool
amutec_eq_bmutec
;
/* flag to enable AMUTEC=BMUTEC */
/*
* The CS4271 requires its LRCLK and MCLK to be stable before its RESET
* line is de-asserted. That also means that clocks cannot be changed
* without putting the chip back into hardware reset, which also requires
* a complete re-initialization of all registers.
*
* One (undocumented) workaround is to assert and de-assert the PDN bit
* in the MODE2 register. This workaround can be enabled with the
* following flag.
*
* Note that this is not needed in case the clocks are stable
* throughout the entire runtime of the codec.
*/
bool
enable_soft_reset
;
};
#endif
/* __CS4271_H */
This diff is collapsed.
Click to expand it.
sound/soc/codecs/cs4271.c
浏览文件 @
e790245e
...
...
@@ -167,6 +167,8 @@ struct cs4271_private {
int
gpio_nreset
;
/* GPIO that disable serial bus, if any */
int
gpio_disable
;
/* enable soft reset workaround */
bool
enable_soft_reset
;
};
/*
...
...
@@ -325,6 +327,33 @@ static int cs4271_hw_params(struct snd_pcm_substream *substream,
int
i
,
ret
;
unsigned
int
ratio
,
val
;
if
(
cs4271
->
enable_soft_reset
)
{
/*
* Put the codec in soft reset and back again in case it's not
* currently streaming data. This way of bringing the codec in
* sync to the current clocks is not explicitly documented in
* the data sheet, but it seems to work fine, and in contrast
* to a read hardware reset, we don't have to sync back all
* registers every time.
*/
if
((
substream
->
stream
==
SNDRV_PCM_STREAM_PLAYBACK
&&
!
dai
->
capture_active
)
||
(
substream
->
stream
==
SNDRV_PCM_STREAM_CAPTURE
&&
!
dai
->
playback_active
))
{
ret
=
snd_soc_update_bits
(
codec
,
CS4271_MODE2
,
CS4271_MODE2_PDN
,
CS4271_MODE2_PDN
);
if
(
ret
<
0
)
return
ret
;
ret
=
snd_soc_update_bits
(
codec
,
CS4271_MODE2
,
CS4271_MODE2_PDN
,
0
);
if
(
ret
<
0
)
return
ret
;
}
}
cs4271
->
rate
=
params_rate
(
params
);
/* Configure DAC */
...
...
@@ -484,6 +513,10 @@ static int cs4271_probe(struct snd_soc_codec *codec)
if
(
of_get_property
(
codec
->
dev
->
of_node
,
"cirrus,amutec-eq-bmutec"
,
NULL
))
amutec_eq_bmutec
=
true
;
if
(
of_get_property
(
codec
->
dev
->
of_node
,
"cirrus,enable-soft-reset"
,
NULL
))
cs4271
->
enable_soft_reset
=
true
;
}
#endif
...
...
@@ -492,6 +525,7 @@ static int cs4271_probe(struct snd_soc_codec *codec)
gpio_nreset
=
cs4271plat
->
gpio_nreset
;
amutec_eq_bmutec
=
cs4271plat
->
amutec_eq_bmutec
;
cs4271
->
enable_soft_reset
=
cs4271plat
->
enable_soft_reset
;
}
if
(
gpio_nreset
>=
0
)
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部