Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
cd80bc6f
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看板
提交
cd80bc6f
编写于
11月 13, 2008
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/fix/hda' into topic/hda
Conflicts: sound/pci/hda/patch_sigmatel.c
上级
c4da29ca
6a12afb5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
72 addition
and
6 deletion
+72
-6
sound/pci/hda/hda_beep.c
sound/pci/hda/hda_beep.c
+8
-0
sound/pci/hda/hda_beep.h
sound/pci/hda/hda_beep.h
+1
-0
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_sigmatel.c
+63
-6
未找到文件。
sound/pci/hda/hda_beep.c
浏览文件 @
cd80bc6f
...
...
@@ -37,6 +37,9 @@ static void snd_hda_generate_beep(struct work_struct *work)
container_of
(
work
,
struct
hda_beep
,
beep_work
);
struct
hda_codec
*
codec
=
beep
->
codec
;
if
(
!
beep
->
enabled
)
return
;
/* generate tone */
snd_hda_codec_write_cache
(
codec
,
beep
->
nid
,
0
,
AC_VERB_SET_BEEP_CONTROL
,
beep
->
tone
);
...
...
@@ -85,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
snprintf
(
beep
->
phys
,
sizeof
(
beep
->
phys
),
"card%d/codec#%d/beep0"
,
codec
->
bus
->
card
->
number
,
codec
->
addr
);
input_dev
=
input_allocate_device
();
if
(
!
input_dev
)
{
kfree
(
beep
);
return
-
ENOMEM
;
}
/* setup digital beep device */
input_dev
->
name
=
"HDA Digital PCBeep"
;
...
...
@@ -115,6 +122,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
beep
->
nid
=
nid
;
beep
->
dev
=
input_dev
;
beep
->
codec
=
codec
;
beep
->
enabled
=
1
;
codec
->
beep
=
beep
;
INIT_WORK
(
&
beep
->
beep_work
,
&
snd_hda_generate_beep
);
...
...
sound/pci/hda/hda_beep.h
浏览文件 @
cd80bc6f
...
...
@@ -31,6 +31,7 @@ struct hda_beep {
char
phys
[
32
];
int
tone
;
int
nid
;
int
enabled
;
struct
work_struct
beep_work
;
/* scheduled task for beep event */
};
...
...
sound/pci/hda/patch_sigmatel.c
浏览文件 @
cd80bc6f
...
...
@@ -2608,8 +2608,10 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
};
/* add dynamic controls */
static
int
stac92xx_add_control_idx
(
struct
sigmatel_spec
*
spec
,
int
type
,
int
idx
,
const
char
*
name
,
unsigned
long
val
)
static
int
stac92xx_add_control_temp
(
struct
sigmatel_spec
*
spec
,
struct
snd_kcontrol_new
*
ktemp
,
int
idx
,
const
char
*
name
,
unsigned
long
val
)
{
struct
snd_kcontrol_new
*
knew
;
...
...
@@ -2617,19 +2619,28 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
knew
=
snd_array_new
(
&
spec
->
kctls
);
if
(
!
knew
)
return
-
ENOMEM
;
*
knew
=
stac92xx_control_templates
[
type
]
;
*
knew
=
*
ktemp
;
knew
->
index
=
idx
;
knew
->
name
=
kstrdup
(
name
,
GFP_KERNEL
);
if
(
!
knew
->
name
)
if
(
!
knew
->
name
)
return
-
ENOMEM
;
knew
->
private_value
=
val
;
return
0
;
}
static
inline
int
stac92xx_add_control_idx
(
struct
sigmatel_spec
*
spec
,
int
type
,
int
idx
,
const
char
*
name
,
unsigned
long
val
)
{
return
stac92xx_add_control_temp
(
spec
,
&
stac92xx_control_templates
[
type
],
idx
,
name
,
val
);
}
/* add dynamic controls */
static
int
stac92xx_add_control
(
struct
sigmatel_spec
*
spec
,
int
type
,
const
char
*
name
,
unsigned
long
val
)
static
in
line
in
t
stac92xx_add_control
(
struct
sigmatel_spec
*
spec
,
int
type
,
const
char
*
name
,
unsigned
long
val
)
{
return
stac92xx_add_control_idx
(
spec
,
type
,
0
,
name
,
val
);
}
...
...
@@ -3071,6 +3082,43 @@ static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec,
return
0
;
}
#ifdef CONFIG_SND_HDA_INPUT_BEEP
#define stac92xx_dig_beep_switch_info snd_ctl_boolean_mono_info
static
int
stac92xx_dig_beep_switch_get
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
hda_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
ucontrol
->
value
.
integer
.
value
[
0
]
=
codec
->
beep
->
enabled
;
return
0
;
}
static
int
stac92xx_dig_beep_switch_put
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
hda_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
int
enabled
=
!!
ucontrol
->
value
.
integer
.
value
[
0
];
if
(
codec
->
beep
->
enabled
!=
enabled
)
{
codec
->
beep
->
enabled
=
enabled
;
return
1
;
}
return
0
;
}
static
struct
snd_kcontrol_new
stac92xx_dig_beep_ctrl
=
{
.
iface
=
SNDRV_CTL_ELEM_IFACE_MIXER
,
.
info
=
stac92xx_dig_beep_switch_info
,
.
get
=
stac92xx_dig_beep_switch_get
,
.
put
=
stac92xx_dig_beep_switch_put
,
};
static
int
stac92xx_beep_switch_ctl
(
struct
hda_codec
*
codec
)
{
return
stac92xx_add_control_temp
(
codec
->
spec
,
&
stac92xx_dig_beep_ctrl
,
0
,
"PC Beep Playback Switch"
,
0
);
}
#endif
static
int
stac92xx_auto_create_mux_input_ctls
(
struct
hda_codec
*
codec
)
{
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
...
...
@@ -3377,6 +3425,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
#ifdef CONFIG_SND_HDA_INPUT_BEEP
if
(
spec
->
digbeep_nid
>
0
)
{
hda_nid_t
nid
=
spec
->
digbeep_nid
;
unsigned
int
caps
;
err
=
stac92xx_auto_create_beep_ctls
(
codec
,
nid
);
if
(
err
<
0
)
...
...
@@ -3384,6 +3433,14 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
err
=
snd_hda_attach_beep_device
(
codec
,
nid
);
if
(
err
<
0
)
return
err
;
/* if no beep switch is available, make its own one */
caps
=
query_amp_caps
(
codec
,
nid
,
HDA_OUTPUT
);
if
(
codec
->
beep
&&
!
((
caps
&
AC_AMPCAP_MUTE
)
>>
AC_AMPCAP_MUTE_SHIFT
))
{
err
=
stac92xx_beep_switch_ctl
(
codec
);
if
(
err
<
0
)
return
err
;
}
}
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录