Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ac1cbbaa
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看板
提交
ac1cbbaa
编写于
8月 22, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/uda134x' into asoc-next
上级
dc52399b
113591e4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
35 deletion
+53
-35
sound/soc/codecs/uda134x.c
sound/soc/codecs/uda134x.c
+53
-35
未找到文件。
sound/soc/codecs/uda134x.c
浏览文件 @
ac1cbbaa
...
...
@@ -325,7 +325,6 @@ static int uda134x_set_dai_fmt(struct snd_soc_dai *codec_dai,
static
int
uda134x_set_bias_level
(
struct
snd_soc_codec
*
codec
,
enum
snd_soc_bias_level
level
)
{
u8
reg
;
struct
uda134x_platform_data
*
pd
=
codec
->
control_data
;
int
i
;
u8
*
cache
=
codec
->
reg_cache
;
...
...
@@ -334,23 +333,6 @@ static int uda134x_set_bias_level(struct snd_soc_codec *codec,
switch
(
level
)
{
case
SND_SOC_BIAS_ON
:
/* ADC, DAC on */
switch
(
pd
->
model
)
{
case
UDA134X_UDA1340
:
case
UDA134X_UDA1344
:
case
UDA134X_UDA1345
:
reg
=
uda134x_read_reg_cache
(
codec
,
UDA134X_DATA011
);
uda134x_write
(
codec
,
UDA134X_DATA011
,
reg
|
0x03
);
break
;
case
UDA134X_UDA1341
:
reg
=
uda134x_read_reg_cache
(
codec
,
UDA134X_STATUS1
);
uda134x_write
(
codec
,
UDA134X_STATUS1
,
reg
|
0x03
);
break
;
default:
printk
(
KERN_ERR
"UDA134X SoC codec: "
"unsupported model %d
\n
"
,
pd
->
model
);
return
-
EINVAL
;
}
break
;
case
SND_SOC_BIAS_PREPARE
:
/* power on */
...
...
@@ -362,23 +344,6 @@ static int uda134x_set_bias_level(struct snd_soc_codec *codec,
}
break
;
case
SND_SOC_BIAS_STANDBY
:
/* ADC, DAC power off */
switch
(
pd
->
model
)
{
case
UDA134X_UDA1340
:
case
UDA134X_UDA1344
:
case
UDA134X_UDA1345
:
reg
=
uda134x_read_reg_cache
(
codec
,
UDA134X_DATA011
);
uda134x_write
(
codec
,
UDA134X_DATA011
,
reg
&
~
(
0x03
));
break
;
case
UDA134X_UDA1341
:
reg
=
uda134x_read_reg_cache
(
codec
,
UDA134X_STATUS1
);
uda134x_write
(
codec
,
UDA134X_STATUS1
,
reg
&
~
(
0x03
));
break
;
default:
printk
(
KERN_ERR
"UDA134X SoC codec: "
"unsupported model %d
\n
"
,
pd
->
model
);
return
-
EINVAL
;
}
break
;
case
SND_SOC_BIAS_OFF
:
/* power off */
...
...
@@ -450,6 +415,37 @@ SOC_ENUM("PCM Playback De-emphasis", uda134x_mixer_enum[1]),
SOC_SINGLE
(
"DC Filter Enable Switch"
,
UDA134X_STATUS0
,
0
,
1
,
0
),
};
/* UDA1341 has the DAC/ADC power down in STATUS1 */
static
const
struct
snd_soc_dapm_widget
uda1341_dapm_widgets
[]
=
{
SND_SOC_DAPM_DAC
(
"DAC"
,
"Playback"
,
UDA134X_STATUS1
,
0
,
0
),
SND_SOC_DAPM_ADC
(
"ADC"
,
"Capture"
,
UDA134X_STATUS1
,
1
,
0
),
};
/* UDA1340/4/5 has the DAC/ADC pwoer down in DATA0 11 */
static
const
struct
snd_soc_dapm_widget
uda1340_dapm_widgets
[]
=
{
SND_SOC_DAPM_DAC
(
"DAC"
,
"Playback"
,
UDA134X_DATA011
,
0
,
0
),
SND_SOC_DAPM_ADC
(
"ADC"
,
"Capture"
,
UDA134X_DATA011
,
1
,
0
),
};
/* Common DAPM widgets */
static
const
struct
snd_soc_dapm_widget
uda134x_dapm_widgets
[]
=
{
SND_SOC_DAPM_INPUT
(
"VINL1"
),
SND_SOC_DAPM_INPUT
(
"VINR1"
),
SND_SOC_DAPM_INPUT
(
"VINL2"
),
SND_SOC_DAPM_INPUT
(
"VINR2"
),
SND_SOC_DAPM_OUTPUT
(
"VOUTL"
),
SND_SOC_DAPM_OUTPUT
(
"VOUTR"
),
};
static
const
struct
snd_soc_dapm_route
uda134x_dapm_routes
[]
=
{
{
"ADC"
,
NULL
,
"VINL1"
},
{
"ADC"
,
NULL
,
"VINR1"
},
{
"ADC"
,
NULL
,
"VINL2"
},
{
"ADC"
,
NULL
,
"VINR2"
},
{
"VOUTL"
,
NULL
,
"DAC"
},
{
"VOUTR"
,
NULL
,
"DAC"
},
};
static
const
struct
snd_soc_dai_ops
uda134x_dai_ops
=
{
.
startup
=
uda134x_startup
,
.
shutdown
=
uda134x_shutdown
,
...
...
@@ -485,6 +481,8 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec)
{
struct
uda134x_priv
*
uda134x
;
struct
uda134x_platform_data
*
pd
=
codec
->
card
->
dev
->
platform_data
;
const
struct
snd_soc_dapm_widget
*
widgets
;
unsigned
num_widgets
;
int
ret
;
...
...
@@ -526,6 +524,22 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec)
else
uda134x_set_bias_level
(
codec
,
SND_SOC_BIAS_STANDBY
);
if
(
pd
->
model
==
UDA134X_UDA1341
)
{
widgets
=
uda1341_dapm_widgets
;
num_widgets
=
ARRAY_SIZE
(
uda1341_dapm_widgets
);
}
else
{
widgets
=
uda1340_dapm_widgets
;
num_widgets
=
ARRAY_SIZE
(
uda1340_dapm_widgets
);
}
ret
=
snd_soc_dapm_new_controls
(
&
codec
->
dapm
,
widgets
,
num_widgets
);
if
(
ret
)
{
printk
(
KERN_ERR
"%s failed to register dapm controls: %d"
,
__func__
,
ret
);
kfree
(
uda134x
);
return
ret
;
}
switch
(
pd
->
model
)
{
case
UDA134X_UDA1340
:
case
UDA134X_UDA1344
:
...
...
@@ -599,6 +613,10 @@ static struct snd_soc_codec_driver soc_codec_dev_uda134x = {
.
read
=
uda134x_read_reg_cache
,
.
write
=
uda134x_write
,
.
set_bias_level
=
uda134x_set_bias_level
,
.
dapm_widgets
=
uda134x_dapm_widgets
,
.
num_dapm_widgets
=
ARRAY_SIZE
(
uda134x_dapm_widgets
),
.
dapm_routes
=
uda134x_dapm_routes
,
.
num_dapm_routes
=
ARRAY_SIZE
(
uda134x_dapm_routes
),
};
static
int
uda134x_codec_probe
(
struct
platform_device
*
pdev
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录