Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0e19e7d2
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
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看板
提交
0e19e7d2
编写于
11月 25, 2008
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/fix/hda' into topic/hda
Conflicts: sound/pci/hda/patch_sigmatel.c
上级
82894b6f
f73d3585
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
27 deletion
+55
-27
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.c
+2
-2
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_sigmatel.c
+53
-25
未找到文件。
sound/pci/hda/hda_codec.c
浏览文件 @
0e19e7d2
...
@@ -1586,12 +1586,12 @@ static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,
...
@@ -1586,12 +1586,12 @@ static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,
{
{
hda_nid_t
*
d
;
hda_nid_t
*
d
;
snd_hda_codec_write
(
codec
,
nid
,
0
,
verb
,
val
);
snd_hda_codec_write
_cache
(
codec
,
nid
,
0
,
verb
,
val
);
d
=
codec
->
slave_dig_outs
;
d
=
codec
->
slave_dig_outs
;
if
(
!
d
)
if
(
!
d
)
return
;
return
;
for
(;
*
d
;
d
++
)
for
(;
*
d
;
d
++
)
snd_hda_codec_write
(
codec
,
*
d
,
0
,
verb
,
val
);
snd_hda_codec_write
_cache
(
codec
,
*
d
,
0
,
verb
,
val
);
}
}
static
inline
void
set_dig_out_convert
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
static
inline
void
set_dig_out_convert
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
...
...
sound/pci/hda/patch_sigmatel.c
浏览文件 @
0e19e7d2
...
@@ -3829,10 +3829,14 @@ static void stac92xx_power_down(struct hda_codec *codec)
...
@@ -3829,10 +3829,14 @@ static void stac92xx_power_down(struct hda_codec *codec)
AC_VERB_SET_POWER_STATE
,
AC_PWRST_D3
);
AC_VERB_SET_POWER_STATE
,
AC_PWRST_D3
);
}
}
static
void
stac_toggle_power_map
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
int
enable
);
static
int
stac92xx_init
(
struct
hda_codec
*
codec
)
static
int
stac92xx_init
(
struct
hda_codec
*
codec
)
{
{
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
struct
auto_pin_cfg
*
cfg
=
&
spec
->
autocfg
;
struct
auto_pin_cfg
*
cfg
=
&
spec
->
autocfg
;
unsigned
int
gpio
;
int
i
;
int
i
;
snd_hda_sequence_write
(
codec
,
spec
->
init
);
snd_hda_sequence_write
(
codec
,
spec
->
init
);
...
@@ -3843,6 +3847,16 @@ static int stac92xx_init(struct hda_codec *codec)
...
@@ -3843,6 +3847,16 @@ static int stac92xx_init(struct hda_codec *codec)
snd_hda_codec_write_cache
(
codec
,
snd_hda_codec_write_cache
(
codec
,
spec
->
adc_nids
[
i
],
0
,
spec
->
adc_nids
[
i
],
0
,
AC_VERB_SET_POWER_STATE
,
AC_PWRST_D3
);
AC_VERB_SET_POWER_STATE
,
AC_PWRST_D3
);
/* set up GPIO */
gpio
=
spec
->
gpio_data
;
/* turn on EAPD statically when spec->eapd_switch isn't set.
* otherwise, unsol event will turn it on/off dynamically
*/
if
(
!
spec
->
eapd_switch
)
gpio
|=
spec
->
eapd_mask
;
stac_gpio_set
(
codec
,
spec
->
gpio_mask
,
spec
->
gpio_dir
,
gpio
);
/* set up pins */
/* set up pins */
if
(
spec
->
hp_detect
)
{
if
(
spec
->
hp_detect
)
{
/* Enable unsolicited responses on the HP widget */
/* Enable unsolicited responses on the HP widget */
...
@@ -3884,39 +3898,43 @@ static int stac92xx_init(struct hda_codec *codec)
...
@@ -3884,39 +3898,43 @@ static int stac92xx_init(struct hda_codec *codec)
for
(
i
=
0
;
i
<
spec
->
num_dmics
;
i
++
)
for
(
i
=
0
;
i
<
spec
->
num_dmics
;
i
++
)
stac92xx_auto_set_pinctl
(
codec
,
spec
->
dmic_nids
[
i
],
stac92xx_auto_set_pinctl
(
codec
,
spec
->
dmic_nids
[
i
],
AC_PINCTL_IN_EN
);
AC_PINCTL_IN_EN
);
if
(
cfg
->
dig_out_pin
)
stac92xx_auto_set_pinctl
(
codec
,
cfg
->
dig_out_pin
,
AC_PINCTL_OUT_EN
);
if
(
cfg
->
dig_in_pin
)
stac92xx_auto_set_pinctl
(
codec
,
cfg
->
dig_in_pin
,
AC_PINCTL_IN_EN
);
for
(
i
=
0
;
i
<
spec
->
num_pwrs
;
i
++
)
{
for
(
i
=
0
;
i
<
spec
->
num_pwrs
;
i
++
)
{
int
event
=
is_nid_hp_pin
(
cfg
,
spec
->
pwr_nids
[
i
])
hda_nid_t
nid
=
spec
->
pwr_nids
[
i
];
?
STAC_HP_EVENT
:
STAC_PWR_EVENT
;
int
pinctl
,
def_conf
;
int
pinctl
=
snd_hda_codec_read
(
codec
,
spec
->
pwr_nids
[
i
],
int
event
=
STAC_PWR_EVENT
;
0
,
AC_VERB_GET_PIN_WIDGET_CONTROL
,
0
);
int
def_conf
=
snd_hda_codec_read
(
codec
,
spec
->
pwr_nids
[
i
],
if
(
is_nid_hp_pin
(
cfg
,
nid
)
&&
spec
->
hp_detect
)
0
,
AC_VERB_GET_CONFIG_DEFAULT
,
0
);
continue
;
/* already has an unsol event */
def_conf
=
get_defcfg_connect
(
def_conf
);
pinctl
=
snd_hda_codec_read
(
codec
,
nid
,
0
,
AC_VERB_GET_PIN_WIDGET_CONTROL
,
0
);
/* outputs are only ports capable of power management
/* outputs are only ports capable of power management
* any attempts on powering down a input port cause the
* any attempts on powering down a input port cause the
* referenced VREF to act quirky.
* referenced VREF to act quirky.
*/
*/
if
(
pinctl
&
AC_PINCTL_IN_EN
)
if
(
pinctl
&
AC_PINCTL_IN_EN
)
continue
;
continue
;
def_conf
=
snd_hda_codec_read
(
codec
,
nid
,
0
,
AC_VERB_GET_CONFIG_DEFAULT
,
0
);
def_conf
=
get_defcfg_connect
(
def_conf
);
/* skip any ports that don't have jacks since presence
/* skip any ports that don't have jacks since presence
* detection is useless */
* detection is useless */
if
(
def_conf
&&
def_conf
!=
AC_JACK_PORT_FIXED
)
if
(
def_conf
!=
AC_JACK_PORT_COMPLEX
)
{
if
(
def_conf
!=
AC_JACK_PORT_NONE
)
stac_toggle_power_map
(
codec
,
nid
,
1
);
continue
;
continue
;
}
enable_pin_detect
(
codec
,
spec
->
pwr_nids
[
i
],
event
|
i
);
enable_pin_detect
(
codec
,
spec
->
pwr_nids
[
i
],
event
|
i
);
codec
->
patch_ops
.
unsol_event
(
codec
,
(
event
|
i
)
<<
26
);
codec
->
patch_ops
.
unsol_event
(
codec
,
(
event
|
i
)
<<
26
);
}
}
if
(
spec
->
dac_list
)
if
(
spec
->
dac_list
)
stac92xx_power_down
(
codec
);
stac92xx_power_down
(
codec
);
if
(
cfg
->
dig_out_pin
)
stac92xx_auto_set_pinctl
(
codec
,
cfg
->
dig_out_pin
,
AC_PINCTL_OUT_EN
);
if
(
cfg
->
dig_in_pin
)
stac92xx_auto_set_pinctl
(
codec
,
cfg
->
dig_in_pin
,
AC_PINCTL_IN_EN
);
stac_gpio_set
(
codec
,
spec
->
gpio_mask
,
spec
->
gpio_dir
,
spec
->
gpio_data
);
return
0
;
return
0
;
}
}
...
@@ -4103,14 +4121,18 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
...
@@ -4103,14 +4121,18 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
}
}
}
}
static
void
stac92xx_pin_sense
(
struct
hda_codec
*
codec
,
int
idx
)
static
void
stac_toggle_power_map
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
,
int
enable
)
{
{
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
hda_nid_t
nid
=
spec
->
pwr_nids
[
idx
];
unsigned
int
idx
,
val
;
int
presence
,
val
;
val
=
snd_hda_codec_read
(
codec
,
codec
->
afg
,
0
,
0x0fec
,
0x0
)
for
(
idx
=
0
;
idx
<
spec
->
num_pwrs
;
idx
++
)
{
&
0x000000ff
;
if
(
spec
->
pwr_nids
[
idx
]
==
nid
)
presence
=
get_hp_pin_presence
(
codec
,
nid
);
break
;
}
if
(
idx
>=
spec
->
num_pwrs
)
return
;
/* several codecs have two power down bits */
/* several codecs have two power down bits */
if
(
spec
->
pwr_mapping
)
if
(
spec
->
pwr_mapping
)
...
@@ -4118,7 +4140,8 @@ static void stac92xx_pin_sense(struct hda_codec *codec, int idx)
...
@@ -4118,7 +4140,8 @@ static void stac92xx_pin_sense(struct hda_codec *codec, int idx)
else
else
idx
=
1
<<
idx
;
idx
=
1
<<
idx
;
if
(
presence
)
val
=
snd_hda_codec_read
(
codec
,
codec
->
afg
,
0
,
0x0fec
,
0x0
)
&
0xff
;
if
(
enable
)
val
&=
~
idx
;
val
&=
~
idx
;
else
else
val
|=
idx
;
val
|=
idx
;
...
@@ -4127,6 +4150,11 @@ static void stac92xx_pin_sense(struct hda_codec *codec, int idx)
...
@@ -4127,6 +4150,11 @@ static void stac92xx_pin_sense(struct hda_codec *codec, int idx)
snd_hda_codec_write
(
codec
,
codec
->
afg
,
0
,
0x7ec
,
val
);
snd_hda_codec_write
(
codec
,
codec
->
afg
,
0
,
0x7ec
,
val
);
}
}
static
void
stac92xx_pin_sense
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
)
{
stac_toggle_power_map
(
codec
,
nid
,
get_hp_pin_presence
(
codec
,
nid
));
}
static
void
stac92xx_report_jack
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
)
static
void
stac92xx_report_jack
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
)
{
{
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录