Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
315472d5
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看板
提交
315472d5
编写于
2月 11, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/tlv320aic3x' into asoc-next
上级
56b3f31f
e2e8bfdf
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
106 addition
and
15 deletion
+106
-15
Documentation/devicetree/bindings/sound/tlv320aic3x.txt
Documentation/devicetree/bindings/sound/tlv320aic3x.txt
+6
-0
include/sound/tlv320aic3x.h
include/sound/tlv320aic3x.h
+10
-0
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320aic3x.c
+77
-6
sound/soc/codecs/tlv320aic3x.h
sound/soc/codecs/tlv320aic3x.h
+4
-0
sound/soc/davinci/davinci-evm.c
sound/soc/davinci/davinci-evm.c
+3
-3
sound/soc/omap/n810.c
sound/soc/omap/n810.c
+2
-2
sound/soc/omap/rx51.c
sound/soc/omap/rx51.c
+4
-4
未找到文件。
Documentation/devicetree/bindings/sound/tlv320aic3x.txt
浏览文件 @
315472d5
...
...
@@ -11,6 +11,12 @@ Optional properties:
- gpio-reset - gpio pin number used for codec reset
- ai3x-gpio-func - <array of 2 int> - AIC3X_GPIO1 & AIC3X_GPIO2 Functionality
- ai3x-micbias-vg - MicBias Voltage required.
1 - MICBIAS output is powered to 2.0V,
2 - MICBIAS output is powered to 2.5V,
3 - MICBIAS output is connected to AVDD,
If this node is not mentioned or if the value is incorrect, then MicBias
is powered down.
Example:
...
...
include/sound/tlv320aic3x.h
浏览文件 @
315472d5
...
...
@@ -46,6 +46,13 @@ enum {
AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ
=
15
};
enum
aic3x_micbias_voltage
{
AIC3X_MICBIAS_OFF
=
0
,
AIC3X_MICBIAS_2_0V
=
1
,
AIC3X_MICBIAS_2_5V
=
2
,
AIC3X_MICBIAS_AVDDV
=
3
,
};
struct
aic3x_setup_data
{
unsigned
int
gpio_func
[
2
];
};
...
...
@@ -53,6 +60,9 @@ struct aic3x_setup_data {
struct
aic3x_pdata
{
int
gpio_reset
;
/* < 0 if not used */
struct
aic3x_setup_data
*
setup
;
/* Selects the micbias voltage */
enum
aic3x_micbias_voltage
micbias_vg
;
};
#endif
sound/soc/codecs/tlv320aic3x.c
浏览文件 @
315472d5
...
...
@@ -85,6 +85,9 @@ struct aic3x_priv {
#define AIC3X_MODEL_33 1
#define AIC3X_MODEL_3007 2
u16
model
;
/* Selects the micbias voltage */
enum
aic3x_micbias_voltage
micbias_vg
;
};
/*
...
...
@@ -195,6 +198,37 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
return
ret
;
}
/*
* mic bias power on/off share the same register bits with
* output voltage of mic bias. when power on mic bias, we
* need reclaim it to voltage value.
* 0x0 = Powered off
* 0x1 = MICBIAS output is powered to 2.0V,
* 0x2 = MICBIAS output is powered to 2.5V
* 0x3 = MICBIAS output is connected to AVDD
*/
static
int
mic_bias_event
(
struct
snd_soc_dapm_widget
*
w
,
struct
snd_kcontrol
*
kcontrol
,
int
event
)
{
struct
snd_soc_codec
*
codec
=
w
->
codec
;
struct
aic3x_priv
*
aic3x
=
snd_soc_codec_get_drvdata
(
codec
);
switch
(
event
)
{
case
SND_SOC_DAPM_POST_PMU
:
/* change mic bias voltage to user defined */
snd_soc_update_bits
(
codec
,
MICBIAS_CTRL
,
MICBIAS_LEVEL_MASK
,
aic3x
->
micbias_vg
<<
MICBIAS_LEVEL_SHIFT
);
break
;
case
SND_SOC_DAPM_PRE_PMD
:
snd_soc_update_bits
(
codec
,
MICBIAS_CTRL
,
MICBIAS_LEVEL_MASK
,
0
);
break
;
}
return
0
;
}
static
const
char
*
aic3x_left_dac_mux
[]
=
{
"DAC_L1"
,
"DAC_L3"
,
"DAC_L2"
};
static
const
char
*
aic3x_right_dac_mux
[]
=
{
"DAC_R1"
,
"DAC_R3"
,
"DAC_R2"
};
static
const
char
*
aic3x_left_hpcom_mux
[]
=
...
...
@@ -596,12 +630,9 @@ static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
AIC3X_ASD_INTF_CTRLA
,
0
,
3
,
3
,
0
),
/* Mic Bias */
SND_SOC_DAPM_REG
(
snd_soc_dapm_micbias
,
"Mic Bias 2V"
,
MICBIAS_CTRL
,
6
,
3
,
1
,
0
),
SND_SOC_DAPM_REG
(
snd_soc_dapm_micbias
,
"Mic Bias 2.5V"
,
MICBIAS_CTRL
,
6
,
3
,
2
,
0
),
SND_SOC_DAPM_REG
(
snd_soc_dapm_micbias
,
"Mic Bias AVDD"
,
MICBIAS_CTRL
,
6
,
3
,
3
,
0
),
SND_SOC_DAPM_SUPPLY
(
"Mic Bias"
,
MICBIAS_CTRL
,
6
,
0
,
mic_bias_event
,
SND_SOC_DAPM_POST_PMU
|
SND_SOC_DAPM_PRE_PMD
),
/* Output mixers */
SND_SOC_DAPM_MIXER
(
"Left Line Mixer"
,
SND_SOC_NOPM
,
0
,
0
,
...
...
@@ -1386,6 +1417,24 @@ static int aic3x_probe(struct snd_soc_codec *codec)
if
(
aic3x
->
model
==
AIC3X_MODEL_3007
)
snd_soc_add_codec_controls
(
codec
,
&
aic3x_classd_amp_gain_ctrl
,
1
);
/* set mic bias voltage */
switch
(
aic3x
->
micbias_vg
)
{
case
AIC3X_MICBIAS_2_0V
:
case
AIC3X_MICBIAS_2_5V
:
case
AIC3X_MICBIAS_AVDDV
:
snd_soc_update_bits
(
codec
,
MICBIAS_CTRL
,
MICBIAS_LEVEL_MASK
,
(
aic3x
->
micbias_vg
)
<<
MICBIAS_LEVEL_SHIFT
);
break
;
case
AIC3X_MICBIAS_OFF
:
/*
* noting to do. target won't enter here. This is just to avoid
* compile time warning "warning: enumeration value
* 'AIC3X_MICBIAS_OFF' not handled in switch"
*/
break
;
}
aic3x_add_widgets
(
codec
);
list_add
(
&
aic3x
->
list
,
&
reset_list
);
...
...
@@ -1461,6 +1510,7 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
struct
aic3x_setup_data
*
ai3x_setup
;
struct
device_node
*
np
=
i2c
->
dev
.
of_node
;
int
ret
;
u32
value
;
aic3x
=
devm_kzalloc
(
&
i2c
->
dev
,
sizeof
(
struct
aic3x_priv
),
GFP_KERNEL
);
if
(
aic3x
==
NULL
)
{
...
...
@@ -1474,6 +1524,7 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
if
(
pdata
)
{
aic3x
->
gpio_reset
=
pdata
->
gpio_reset
;
aic3x
->
setup
=
pdata
->
setup
;
aic3x
->
micbias_vg
=
pdata
->
micbias_vg
;
}
else
if
(
np
)
{
ai3x_setup
=
devm_kzalloc
(
&
i2c
->
dev
,
sizeof
(
*
ai3x_setup
),
GFP_KERNEL
);
...
...
@@ -1493,6 +1544,26 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
aic3x
->
setup
=
ai3x_setup
;
}
if
(
!
of_property_read_u32
(
np
,
"ai3x-micbias-vg"
,
&
value
))
{
switch
(
value
)
{
case
1
:
aic3x
->
micbias_vg
=
AIC3X_MICBIAS_2_0V
;
break
;
case
2
:
aic3x
->
micbias_vg
=
AIC3X_MICBIAS_2_5V
;
break
;
case
3
:
aic3x
->
micbias_vg
=
AIC3X_MICBIAS_AVDDV
;
break
;
default
:
aic3x
->
micbias_vg
=
AIC3X_MICBIAS_OFF
;
dev_err
(
&
i2c
->
dev
,
"Unsuitable MicBias voltage "
"found in DT
\n
"
);
}
}
else
{
aic3x
->
micbias_vg
=
AIC3X_MICBIAS_OFF
;
}
}
else
{
aic3x
->
gpio_reset
=
-
1
;
}
...
...
sound/soc/codecs/tlv320aic3x.h
浏览文件 @
315472d5
...
...
@@ -238,6 +238,10 @@
/* Default input volume */
#define DEFAULT_GAIN 0x20
/* MICBIAS Control Register */
#define MICBIAS_LEVEL_SHIFT (6)
#define MICBIAS_LEVEL_MASK (3 << 6)
/* headset detection / button API */
/* The AIC3x supports detection of stereo headsets (GND + left + right signal)
...
...
sound/soc/davinci/davinci-evm.c
浏览文件 @
315472d5
...
...
@@ -116,9 +116,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
{
"Line Out"
,
NULL
,
"RLOUT"
},
/* Mic connected to (MIC3L | MIC3R) */
{
"MIC3L"
,
NULL
,
"Mic Bias
2V
"
},
{
"MIC3R"
,
NULL
,
"Mic Bias
2V
"
},
{
"Mic Bias
2V
"
,
NULL
,
"Mic Jack"
},
{
"MIC3L"
,
NULL
,
"Mic Bias"
},
{
"MIC3R"
,
NULL
,
"Mic Bias"
},
{
"Mic Bias"
,
NULL
,
"Mic Jack"
},
/* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */
{
"LINE1L"
,
NULL
,
"Line In"
},
...
...
sound/soc/omap/n810.c
浏览文件 @
315472d5
...
...
@@ -230,8 +230,8 @@ static const struct snd_soc_dapm_route audio_map[] = {
{
"Ext Spk"
,
NULL
,
"LLOUT"
},
{
"Ext Spk"
,
NULL
,
"RLOUT"
},
{
"DMic Rate 64"
,
NULL
,
"Mic Bias
2V
"
},
{
"Mic Bias
2V
"
,
NULL
,
"DMic"
},
{
"DMic Rate 64"
,
NULL
,
"Mic Bias"
},
{
"Mic Bias"
,
NULL
,
"DMic"
},
};
static
const
char
*
spk_function
[]
=
{
"Off"
,
"On"
};
...
...
sound/soc/omap/rx51.c
浏览文件 @
315472d5
...
...
@@ -248,16 +248,16 @@ static const struct snd_soc_dapm_route audio_map[] = {
{
"FM Transmitter"
,
NULL
,
"LLOUT"
},
{
"FM Transmitter"
,
NULL
,
"RLOUT"
},
{
"DMic Rate 64"
,
NULL
,
"Mic Bias
2V
"
},
{
"Mic Bias
2V
"
,
NULL
,
"DMic"
},
{
"DMic Rate 64"
,
NULL
,
"Mic Bias"
},
{
"Mic Bias"
,
NULL
,
"DMic"
},
};
static
const
struct
snd_soc_dapm_route
audio_mapb
[]
=
{
{
"b LINE2R"
,
NULL
,
"MONO_LOUT"
},
{
"Earphone"
,
NULL
,
"b HPLOUT"
},
{
"LINE1L"
,
NULL
,
"b Mic Bias
2.5V
"
},
{
"b Mic Bias
2.5V
"
,
NULL
,
"HS Mic"
}
{
"LINE1L"
,
NULL
,
"b Mic Bias"
},
{
"b Mic Bias"
,
NULL
,
"HS Mic"
}
};
static
const
char
*
spk_function
[]
=
{
"Off"
,
"On"
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录