Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
42768a12
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
42768a12
编写于
4月 22, 2009
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ASoC: Use DAPM supply widget for WM8903 charge pump
Signed-off-by:
N
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
上级
246d0a17
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
33 deletion
+20
-33
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8903.c
+20
-33
未找到文件。
sound/soc/codecs/wm8903.c
浏览文件 @
42768a12
...
...
@@ -217,7 +217,6 @@ struct wm8903_priv {
int
sysclk
;
/* Reference counts */
int
charge_pump_users
;
int
class_w_users
;
int
playback_active
;
int
capture_active
;
...
...
@@ -373,6 +372,15 @@ static void wm8903_reset(struct snd_soc_codec *codec)
#define WM8903_OUTPUT_INT 0x2
#define WM8903_OUTPUT_IN 0x1
static
int
wm8903_cp_event
(
struct
snd_soc_dapm_widget
*
w
,
struct
snd_kcontrol
*
kcontrol
,
int
event
)
{
WARN_ON
(
event
!=
SND_SOC_DAPM_POST_PMU
);
mdelay
(
4
);
return
0
;
}
/*
* Event for headphone and line out amplifier power changes. Special
* power up/down sequences are required in order to maximise pop/click
...
...
@@ -382,12 +390,9 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
struct
snd_kcontrol
*
kcontrol
,
int
event
)
{
struct
snd_soc_codec
*
codec
=
w
->
codec
;
struct
wm8903_priv
*
wm8903
=
codec
->
private_data
;
struct
i2c_client
*
i2c
=
codec
->
control_data
;
u16
val
;
u16
reg
;
int
shift
;
u16
cp_reg
=
wm8903_read
(
codec
,
WM8903_CHARGE_PUMP_0
);
switch
(
w
->
reg
)
{
case
WM8903_POWER_MANAGEMENT_2
:
...
...
@@ -419,18 +424,6 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
/* Short the output */
val
&=
~
(
WM8903_OUTPUT_SHORT
<<
shift
);
wm8903_write
(
codec
,
reg
,
val
);
wm8903
->
charge_pump_users
++
;
dev_dbg
(
&
i2c
->
dev
,
"Charge pump use count now %d
\n
"
,
wm8903
->
charge_pump_users
);
if
(
wm8903
->
charge_pump_users
==
1
)
{
dev_dbg
(
&
i2c
->
dev
,
"Enabling charge pump
\n
"
);
wm8903_write
(
codec
,
WM8903_CHARGE_PUMP_0
,
cp_reg
|
WM8903_CP_ENA
);
mdelay
(
4
);
}
}
if
(
event
&
SND_SOC_DAPM_POST_PMU
)
{
...
...
@@ -464,19 +457,6 @@ static int wm8903_output_event(struct snd_soc_dapm_widget *w,
wm8903_write
(
codec
,
reg
,
val
);
}
if
(
event
&
SND_SOC_DAPM_POST_PMD
)
{
wm8903
->
charge_pump_users
--
;
dev_dbg
(
&
i2c
->
dev
,
"Charge pump use count now %d
\n
"
,
wm8903
->
charge_pump_users
);
if
(
wm8903
->
charge_pump_users
==
0
)
{
dev_dbg
(
&
i2c
->
dev
,
"Disabling charge pump
\n
"
);
wm8903_write
(
codec
,
WM8903_CHARGE_PUMP_0
,
cp_reg
&
~
WM8903_CP_ENA
);
}
}
return
0
;
}
...
...
@@ -844,26 +824,28 @@ SND_SOC_DAPM_MIXER("Right Speaker Mixer", WM8903_POWER_MANAGEMENT_4, 0, 0,
SND_SOC_DAPM_PGA_E
(
"Left Headphone Output PGA"
,
WM8903_POWER_MANAGEMENT_2
,
1
,
0
,
NULL
,
0
,
wm8903_output_event
,
SND_SOC_DAPM_PRE_PMU
|
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_PRE_PMD
|
SND_SOC_DAPM_POST_PMD
),
SND_SOC_DAPM_PRE_PMD
),
SND_SOC_DAPM_PGA_E
(
"Right Headphone Output PGA"
,
WM8903_POWER_MANAGEMENT_2
,
0
,
0
,
NULL
,
0
,
wm8903_output_event
,
SND_SOC_DAPM_PRE_PMU
|
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_PRE_PMD
|
SND_SOC_DAPM_POST_PMD
),
SND_SOC_DAPM_PRE_PMD
),
SND_SOC_DAPM_PGA_E
(
"Left Line Output PGA"
,
WM8903_POWER_MANAGEMENT_3
,
1
,
0
,
NULL
,
0
,
wm8903_output_event
,
SND_SOC_DAPM_PRE_PMU
|
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_PRE_PMD
|
SND_SOC_DAPM_POST_PMD
),
SND_SOC_DAPM_PRE_PMD
),
SND_SOC_DAPM_PGA_E
(
"Right Line Output PGA"
,
WM8903_POWER_MANAGEMENT_3
,
0
,
0
,
NULL
,
0
,
wm8903_output_event
,
SND_SOC_DAPM_PRE_PMU
|
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_PRE_PMD
|
SND_SOC_DAPM_POST_PMD
),
SND_SOC_DAPM_PRE_PMD
),
SND_SOC_DAPM_PGA
(
"Left Speaker PGA"
,
WM8903_POWER_MANAGEMENT_5
,
1
,
0
,
NULL
,
0
),
SND_SOC_DAPM_PGA
(
"Right Speaker PGA"
,
WM8903_POWER_MANAGEMENT_5
,
0
,
0
,
NULL
,
0
),
SND_SOC_DAPM_SUPPLY
(
"Charge Pump"
,
WM8903_CHARGE_PUMP_0
,
0
,
0
,
wm8903_cp_event
,
SND_SOC_DAPM_POST_PMU
),
};
static
const
struct
snd_soc_dapm_route
intercon
[]
=
{
...
...
@@ -951,6 +933,11 @@ static const struct snd_soc_dapm_route intercon[] = {
{
"ROP"
,
NULL
,
"Right Speaker PGA"
},
{
"RON"
,
NULL
,
"Right Speaker PGA"
},
{
"Left Headphone Output PGA"
,
NULL
,
"Charge Pump"
},
{
"Right Headphone Output PGA"
,
NULL
,
"Charge Pump"
},
{
"Left Line Output PGA"
,
NULL
,
"Charge Pump"
},
{
"Right Line Output PGA"
,
NULL
,
"Charge Pump"
},
};
static
int
wm8903_add_widgets
(
struct
snd_soc_codec
*
codec
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录