Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
856de815
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
856de815
编写于
10月 24, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/tpa6130a2' into asoc-next
上级
3caa2827
f95a4883
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
9 deletion
+50
-9
Documentation/devicetree/bindings/sound/tpa6130a2.txt
Documentation/devicetree/bindings/sound/tpa6130a2.txt
+27
-0
sound/soc/codecs/tpa6130a2.c
sound/soc/codecs/tpa6130a2.c
+23
-9
未找到文件。
Documentation/devicetree/bindings/sound/tpa6130a2.txt
0 → 100644
浏览文件 @
856de815
Texas Instruments - tpa6130a2 Codec module
The tpa6130a2 serial control bus communicates through I2C protocols
Required properties:
- compatible - "string" - One of:
"ti,tpa6130a2" - TPA6130A2
"ti,tpa6140a2" - TPA6140A2
- reg - <int> - I2C slave address
- Vdd-supply - <phandle> - power supply regulator
Optional properties:
- power-gpio - gpio pin to power the device
Example:
tpa6130a2: tpa6130a2@60 {
compatible = "ti,tpa6130a2";
reg = <0x60>;
Vdd-supply = <&vmmc2>;
power-gpio = <&gpio4 2 GPIO_ACTIVE_HIGH>;
};
sound/soc/codecs/tpa6130a2.c
浏览文件 @
856de815
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <sound/tpa6130a2-plat.h>
#include <sound/tpa6130a2-plat.h>
#include <sound/soc.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <sound/tlv.h>
#include <linux/of_gpio.h>
#include "tpa6130a2.h"
#include "tpa6130a2.h"
...
@@ -364,30 +365,33 @@ static int tpa6130a2_probe(struct i2c_client *client,
...
@@ -364,30 +365,33 @@ static int tpa6130a2_probe(struct i2c_client *client,
{
{
struct
device
*
dev
;
struct
device
*
dev
;
struct
tpa6130a2_data
*
data
;
struct
tpa6130a2_data
*
data
;
struct
tpa6130a2_platform_data
*
pdata
;
struct
tpa6130a2_platform_data
*
pdata
=
client
->
dev
.
platform_data
;
struct
device_node
*
np
=
client
->
dev
.
of_node
;
const
char
*
regulator
;
const
char
*
regulator
;
int
ret
;
int
ret
;
dev
=
&
client
->
dev
;
dev
=
&
client
->
dev
;
if
(
client
->
dev
.
platform_data
==
NULL
)
{
dev_err
(
dev
,
"Platform data not set
\n
"
);
dump_stack
();
return
-
ENODEV
;
}
data
=
devm_kzalloc
(
&
client
->
dev
,
sizeof
(
*
data
),
GFP_KERNEL
);
data
=
devm_kzalloc
(
&
client
->
dev
,
sizeof
(
*
data
),
GFP_KERNEL
);
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
dev_err
(
dev
,
"Can not allocate memory
\n
"
);
dev_err
(
dev
,
"Can not allocate memory
\n
"
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
if
(
pdata
)
{
data
->
power_gpio
=
pdata
->
power_gpio
;
}
else
if
(
np
)
{
data
->
power_gpio
=
of_get_named_gpio
(
np
,
"power-gpio"
,
0
);
}
else
{
dev_err
(
dev
,
"Platform data not set
\n
"
);
dump_stack
();
return
-
ENODEV
;
}
tpa6130a2_client
=
client
;
tpa6130a2_client
=
client
;
i2c_set_clientdata
(
tpa6130a2_client
,
data
);
i2c_set_clientdata
(
tpa6130a2_client
,
data
);
pdata
=
client
->
dev
.
platform_data
;
data
->
power_gpio
=
pdata
->
power_gpio
;
data
->
id
=
id
->
driver_data
;
data
->
id
=
id
->
driver_data
;
mutex_init
(
&
data
->
mutex
);
mutex_init
(
&
data
->
mutex
);
...
@@ -466,10 +470,20 @@ static const struct i2c_device_id tpa6130a2_id[] = {
...
@@ -466,10 +470,20 @@ static const struct i2c_device_id tpa6130a2_id[] = {
};
};
MODULE_DEVICE_TABLE
(
i2c
,
tpa6130a2_id
);
MODULE_DEVICE_TABLE
(
i2c
,
tpa6130a2_id
);
#if IS_ENABLED(CONFIG_OF)
static
const
struct
of_device_id
tpa6130a2_of_match
[]
=
{
{
.
compatible
=
"ti,tpa6130a2"
,
},
{
.
compatible
=
"ti,tpa6140a2"
},
{},
};
MODULE_DEVICE_TABLE
(
of
,
tpa6130a2_of_match
);
#endif
static
struct
i2c_driver
tpa6130a2_i2c_driver
=
{
static
struct
i2c_driver
tpa6130a2_i2c_driver
=
{
.
driver
=
{
.
driver
=
{
.
name
=
"tpa6130a2"
,
.
name
=
"tpa6130a2"
,
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
of_match_table
=
of_match_ptr
(
tpa6130a2_of_match
),
},
},
.
probe
=
tpa6130a2_probe
,
.
probe
=
tpa6130a2_probe
,
.
remove
=
tpa6130a2_remove
,
.
remove
=
tpa6130a2_remove
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录