Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
bd132ec5
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看板
提交
bd132ec5
编写于
10月 23, 2011
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ASoC: Convert wm5100 to direct regmap API usage
Signed-off-by:
N
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
上级
7b16f560
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
786 addition
and
758 deletion
+786
-758
sound/soc/codecs/wm5100-tables.c
sound/soc/codecs/wm5100-tables.c
+744
-744
sound/soc/codecs/wm5100.c
sound/soc/codecs/wm5100.c
+38
-11
sound/soc/codecs/wm5100.h
sound/soc/codecs/wm5100.h
+4
-3
未找到文件。
sound/soc/codecs/wm5100-tables.c
浏览文件 @
bd132ec5
此差异已折叠。
点击以展开。
sound/soc/codecs/wm5100.c
浏览文件 @
bd132ec5
...
...
@@ -51,6 +51,7 @@ struct wm5100_fll {
/* codec private data */
struct
wm5100_priv
{
struct
regmap
*
regmap
;
struct
snd_soc_codec
*
codec
;
struct
regulator_bulk_data
core_supplies
[
WM5100_NUM_CORE_SUPPLIES
];
...
...
@@ -1375,7 +1376,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec,
msleep
(
2
);
}
codec
->
cache_only
=
false
;
regcache_cache_only
(
wm5100
->
regmap
,
false
)
;
switch
(
wm5100
->
rev
)
{
case
0
:
...
...
@@ -1993,6 +1994,9 @@ static int wm5100_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
else
timeout
=
50
;
snd_soc_update_bits
(
codec
,
WM5100_CLOCKING_3
,
WM5100_SYSCLK_ENA
,
WM5100_SYSCLK_ENA
);
/* Poll for the lock; will use interrupt when we can test */
for
(
i
=
0
;
i
<
timeout
;
i
++
)
{
if
(
i2c
->
irq
)
{
...
...
@@ -2453,8 +2457,9 @@ static int wm5100_probe(struct snd_soc_codec *codec)
int
ret
,
i
,
irq_flags
;
wm5100
->
codec
=
codec
;
codec
->
control_data
=
wm5100
->
regmap
;
ret
=
snd_soc_codec_set_cache_io
(
codec
,
16
,
16
,
SND_SOC_
I2C
);
ret
=
snd_soc_codec_set_cache_io
(
codec
,
16
,
16
,
SND_SOC_
REGMAP
);
if
(
ret
!=
0
)
{
dev_err
(
codec
->
dev
,
"Failed to set cache I/O: %d
\n
"
,
ret
);
return
ret
;
...
...
@@ -2552,7 +2557,7 @@ static int wm5100_probe(struct snd_soc_codec *codec)
goto
err_reset
;
}
codec
->
cache_only
=
true
;
regcache_cache_only
(
wm5100
->
regmap
,
true
)
;
wm5100_init_gpio
(
codec
);
...
...
@@ -2733,14 +2738,18 @@ static struct snd_soc_codec_driver soc_codec_dev_wm5100 = {
.
num_dapm_widgets
=
ARRAY_SIZE
(
wm5100_dapm_widgets
),
.
dapm_routes
=
wm5100_dapm_routes
,
.
num_dapm_routes
=
ARRAY_SIZE
(
wm5100_dapm_routes
),
};
.
reg_cache_size
=
ARRAY_SIZE
(
wm5100_reg_defaults
),
.
reg_word_size
=
sizeof
(
u16
),
.
compress_type
=
SND_SOC_RBTREE_COMPRESSION
,
.
reg_cache_default
=
wm5100_reg_defaults
,
static
const
struct
regmap_config
wm5100_regmap
=
{
.
reg_bits
=
16
,
.
val_bits
=
16
,
.
volatile_register
=
wm5100_volatile_register
,
.
readable_register
=
wm5100_readable_register
,
.
max_register
=
WM5100_MAX_REGISTER
,
.
reg_defaults
=
wm5100_reg_defaults
,
.
num_reg_defaults
=
ARRAY_SIZE
(
wm5100_reg_defaults
),
.
volatile_reg
=
wm5100_volatile_register
,
.
readable_reg
=
wm5100_readable_register
,
.
cache_type
=
REGCACHE_RBTREE
,
};
static
__devinit
int
wm5100_i2c_probe
(
struct
i2c_client
*
i2c
,
...
...
@@ -2754,6 +2763,14 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c,
if
(
wm5100
==
NULL
)
return
-
ENOMEM
;
wm5100
->
regmap
=
regmap_init_i2c
(
i2c
,
&
wm5100_regmap
);
if
(
IS_ERR
(
wm5100
->
regmap
))
{
ret
=
PTR_ERR
(
wm5100
->
regmap
);
dev_err
(
&
i2c
->
dev
,
"Failed to allocate register map: %d
\n
"
,
ret
);
goto
err_alloc
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
wm5100
->
fll
);
i
++
)
init_completion
(
&
wm5100
->
fll
[
i
].
lock
);
...
...
@@ -2767,16 +2784,26 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c,
ARRAY_SIZE
(
wm5100_dai
));
if
(
ret
<
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to register WM5100: %d
\n
"
,
ret
);
kfree
(
wm5100
)
;
goto
err_regmap
;
}
return
ret
;
err_regmap:
regmap_exit
(
wm5100
->
regmap
);
err_alloc:
kfree
(
wm5100
);
return
ret
;
}
static
__devexit
int
wm5100_i2c_remove
(
struct
i2c_client
*
client
)
{
struct
wm5100_priv
*
wm5100
=
i2c_get_clientdata
(
client
);
snd_soc_unregister_codec
(
&
client
->
dev
);
kfree
(
i2c_get_clientdata
(
client
));
regmap_exit
(
wm5100
->
regmap
);
kfree
(
wm5100
);
return
0
;
}
...
...
sound/soc/codecs/wm5100.h
浏览文件 @
bd132ec5
...
...
@@ -15,6 +15,7 @@
#define WM5100_ASOC_H
#include <sound/soc.h>
#include <linux/regmap.h>
int
wm5100_detect
(
struct
snd_soc_codec
*
codec
,
struct
snd_soc_jack
*
jack
);
...
...
@@ -5147,9 +5148,9 @@ int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack);
#define WM5100_DSP3_ZM_END_SHIFT 0
/* DSP3_ZM_END - [15:0] */
#define WM5100_DSP3_ZM_END_WIDTH 16
/* DSP3_ZM_END - [15:0] */
int
wm5100_readable_register
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
);
int
wm5100_volatile_register
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
);
bool
wm5100_readable_register
(
struct
device
*
dev
,
unsigned
int
reg
);
bool
wm5100_volatile_register
(
struct
device
*
dev
,
unsigned
int
reg
);
extern
u16
wm5100_reg_defaults
[
WM5100_MAX_REGISTER
+
1
];
extern
struct
reg_default
wm5100_reg_defaults
[
WM5100_REGISTER_COUNT
];
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录