Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
de3bb2de
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
de3bb2de
编写于
10月 24, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/ab8500' into asoc-next
上级
cbf125e2
2245e3c3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
41 deletion
+37
-41
sound/soc/codecs/ab8500-codec.c
sound/soc/codecs/ab8500-codec.c
+37
-41
未找到文件。
sound/soc/codecs/ab8500-codec.c
浏览文件 @
de3bb2de
...
...
@@ -126,6 +126,8 @@ struct ab8500_codec_drvdata_dbg {
/* Private data for AB8500 device-driver */
struct
ab8500_codec_drvdata
{
struct
regmap
*
regmap
;
/* Sidetone */
long
*
sid_fir_values
;
enum
sid_state
sid_status
;
...
...
@@ -166,49 +168,35 @@ static inline const char *amic_type_str(enum amic_type type)
*/
/* Read a register from the audio-bank of AB8500 */
static
unsigned
int
ab8500_codec_read_reg
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
)
static
int
ab8500_codec_read_reg
(
void
*
context
,
unsigned
int
reg
,
unsigned
int
*
value
)
{
struct
device
*
dev
=
context
;
int
status
;
unsigned
int
value
=
0
;
u8
value8
;
status
=
abx500_get_register_interruptible
(
codec
->
dev
,
AB8500_AUDIO
,
reg
,
&
value8
);
if
(
status
<
0
)
{
dev_err
(
codec
->
dev
,
"%s: ERROR: Register (0x%02x:0x%02x) read failed (%d).
\n
"
,
__func__
,
(
u8
)
AB8500_AUDIO
,
(
u8
)
reg
,
status
);
}
else
{
dev_dbg
(
codec
->
dev
,
"%s: Read 0x%02x from register 0x%02x:0x%02x
\n
"
,
__func__
,
value8
,
(
u8
)
AB8500_AUDIO
,
(
u8
)
reg
);
value
=
(
unsigned
int
)
value8
;
}
status
=
abx500_get_register_interruptible
(
dev
,
AB8500_AUDIO
,
reg
,
&
value8
);
*
value
=
(
unsigned
int
)
value8
;
return
value
;
return
status
;
}
/* Write to a register in the audio-bank of AB8500 */
static
int
ab8500_codec_write_reg
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
,
unsigned
int
value
)
static
int
ab8500_codec_write_reg
(
void
*
context
,
unsigned
int
reg
,
unsigned
int
value
)
{
int
status
;
status
=
abx500_set_register_interruptible
(
codec
->
dev
,
AB8500_AUDIO
,
reg
,
value
);
if
(
status
<
0
)
dev_err
(
codec
->
dev
,
"%s: ERROR: Register (%02x:%02x) write failed (%d).
\n
"
,
__func__
,
(
u8
)
AB8500_AUDIO
,
(
u8
)
reg
,
status
);
else
dev_dbg
(
codec
->
dev
,
"%s: Wrote 0x%02x into register %02x:%02x
\n
"
,
__func__
,
(
u8
)
value
,
(
u8
)
AB8500_AUDIO
,
(
u8
)
reg
);
struct
device
*
dev
=
context
;
return
status
;
return
abx500_set_register_interruptible
(
dev
,
AB8500_AUDIO
,
reg
,
value
);
}
static
const
struct
regmap_config
ab8500_codec_regmap
=
{
.
reg_read
=
ab8500_codec_read_reg
,
.
reg_write
=
ab8500_codec_write_reg
,
};
/*
* Controls - DAPM
*/
...
...
@@ -2485,9 +2473,13 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
dev_dbg
(
dev
,
"%s: Enter.
\n
"
,
__func__
);
snd_soc_codec_set_cache_io
(
codec
,
0
,
0
,
SND_SOC_REGMAP
);
/* Setup AB8500 according to board-settings */
pdata
=
dev_get_platdata
(
dev
->
parent
);
codec
->
control_data
=
drvdata
->
regmap
;
if
(
np
)
{
if
(
!
pdata
)
pdata
=
devm_kzalloc
(
dev
,
...
...
@@ -2532,12 +2524,10 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
}
/* Override HW-defaults */
ab8500_codec_write_reg
(
codec
,
AB8500_ANACONF5
,
BIT
(
AB8500_ANACONF5_HSAUTOEN
));
ab8500_codec_write_reg
(
codec
,
AB8500_SHORTCIRCONF
,
BIT
(
AB8500_SHORTCIRCONF_HSZCDDIS
));
snd_soc_write
(
codec
,
AB8500_ANACONF5
,
BIT
(
AB8500_ANACONF5_HSAUTOEN
));
snd_soc_write
(
codec
,
AB8500_SHORTCIRCONF
,
BIT
(
AB8500_SHORTCIRCONF_HSZCDDIS
));
/* Add filter controls */
status
=
snd_soc_add_codec_controls
(
codec
,
ab8500_filter_controls
,
...
...
@@ -2567,9 +2557,6 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
static
struct
snd_soc_codec_driver
ab8500_codec_driver
=
{
.
probe
=
ab8500_codec_probe
,
.
read
=
ab8500_codec_read_reg
,
.
write
=
ab8500_codec_write_reg
,
.
reg_word_size
=
sizeof
(
u8
),
.
controls
=
ab8500_ctrls
,
.
num_controls
=
ARRAY_SIZE
(
ab8500_ctrls
),
.
dapm_widgets
=
ab8500_dapm_widgets
,
...
...
@@ -2592,6 +2579,15 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev)
drvdata
->
anc_status
=
ANC_UNCONFIGURED
;
dev_set_drvdata
(
&
pdev
->
dev
,
drvdata
);
drvdata
->
regmap
=
devm_regmap_init
(
&
pdev
->
dev
,
NULL
,
&
pdev
->
dev
,
&
ab8500_codec_regmap
);
if
(
IS_ERR
(
drvdata
->
regmap
))
{
status
=
PTR_ERR
(
drvdata
->
regmap
);
dev_err
(
&
pdev
->
dev
,
"%s: Failed to allocate regmap: %d
\n
"
,
__func__
,
status
);
return
status
;
}
dev_dbg
(
&
pdev
->
dev
,
"%s: Register codec.
\n
"
,
__func__
);
status
=
snd_soc_register_codec
(
&
pdev
->
dev
,
&
ab8500_codec_driver
,
ab8500_codec_dai
,
...
...
@@ -2606,7 +2602,7 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev)
static
int
ab8500_codec_driver_remove
(
struct
platform_device
*
pdev
)
{
dev_
info
(
&
pdev
->
dev
,
"%s Enter.
\n
"
,
__func__
);
dev_
dbg
(
&
pdev
->
dev
,
"%s Enter.
\n
"
,
__func__
);
snd_soc_unregister_codec
(
&
pdev
->
dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录