Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
278d064b
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,发现更多精彩内容 >>
提交
278d064b
编写于
2月 11, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/ak4642' into asoc-next
上级
c331a23b
c890caee
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
48 addition
and
2 deletion
+48
-2
Documentation/devicetree/bindings/sound/ak4642.txt
Documentation/devicetree/bindings/sound/ak4642.txt
+17
-0
sound/soc/codecs/ak4642.c
sound/soc/codecs/ak4642.c
+31
-2
未找到文件。
Documentation/devicetree/bindings/sound/ak4642.txt
0 → 100644
浏览文件 @
278d064b
AK4642 I2C transmitter
This device supports I2C mode only.
Required properties:
- compatible : "asahi-kasei,ak4642" or "asahi-kasei,ak4643" or "asahi-kasei,ak4648"
- reg : The chip select number on the I2C bus
Example:
&i2c {
ak4648: ak4648@0x12 {
compatible = "asahi-kasei,ak4642";
reg = <0x12>;
};
};
sound/soc/codecs/ak4642.c
浏览文件 @
278d064b
...
...
@@ -26,6 +26,7 @@
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/of_device.h>
#include <linux/module.h>
#include <sound/soc.h>
#include <sound/initval.h>
...
...
@@ -513,12 +514,31 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4648 = {
};
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
static
struct
of_device_id
ak4642_of_match
[];
static
int
ak4642_i2c_probe
(
struct
i2c_client
*
i2c
,
const
struct
i2c_device_id
*
id
)
{
struct
device_node
*
np
=
i2c
->
dev
.
of_node
;
const
struct
snd_soc_codec_driver
*
driver
;
driver
=
NULL
;
if
(
np
)
{
const
struct
of_device_id
*
of_id
;
of_id
=
of_match_device
(
ak4642_of_match
,
&
i2c
->
dev
);
if
(
of_id
)
driver
=
of_id
->
data
;
}
else
{
driver
=
(
struct
snd_soc_codec_driver
*
)
id
->
driver_data
;
}
if
(
!
driver
)
{
dev_err
(
&
i2c
->
dev
,
"no driver
\n
"
);
return
-
EINVAL
;
}
return
snd_soc_register_codec
(
&
i2c
->
dev
,
(
struct
snd_soc_codec_driver
*
)
id
->
driver_data
,
&
ak4642_dai
,
1
);
driver
,
&
ak4642_dai
,
1
);
}
static
int
ak4642_i2c_remove
(
struct
i2c_client
*
client
)
...
...
@@ -527,6 +547,14 @@ static int ak4642_i2c_remove(struct i2c_client *client)
return
0
;
}
static
struct
of_device_id
ak4642_of_match
[]
=
{
{
.
compatible
=
"asahi-kasei,ak4642"
,
.
data
=
&
soc_codec_dev_ak4642
},
{
.
compatible
=
"asahi-kasei,ak4643"
,
.
data
=
&
soc_codec_dev_ak4642
},
{
.
compatible
=
"asahi-kasei,ak4648"
,
.
data
=
&
soc_codec_dev_ak4648
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
ak4642_of_match
);
static
const
struct
i2c_device_id
ak4642_i2c_id
[]
=
{
{
"ak4642"
,
(
kernel_ulong_t
)
&
soc_codec_dev_ak4642
},
{
"ak4643"
,
(
kernel_ulong_t
)
&
soc_codec_dev_ak4642
},
...
...
@@ -539,6 +567,7 @@ static struct i2c_driver ak4642_i2c_driver = {
.
driver
=
{
.
name
=
"ak4642-codec"
,
.
owner
=
THIS_MODULE
,
.
of_match_table
=
ak4642_of_match
,
},
.
probe
=
ak4642_i2c_probe
,
.
remove
=
ak4642_i2c_remove
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录