Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
5b56eec7
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b56eec7
编写于
3月 24, 2009
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/jack' into for-linus
上级
c2f43981
662c319a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
24 deletion
+30
-24
Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl
Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl
+3
-0
include/linux/input.h
include/linux/input.h
+1
-0
include/sound/jack.h
include/sound/jack.h
+5
-0
sound/core/jack.c
sound/core/jack.c
+21
-24
未找到文件。
Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl
浏览文件 @
5b56eec7
...
...
@@ -88,6 +88,9 @@
<chapter><title>
Miscellaneous Functions
</title>
<sect1><title>
Hardware-Dependent Devices API
</title>
!Esound/core/hwdep.c
</sect1>
<sect1><title>
Jack Abstraction Layer API
</title>
!Esound/core/jack.c
</sect1>
<sect1><title>
ISA DMA Helpers
</title>
!Esound/core/isadma.c
...
...
include/linux/input.h
浏览文件 @
5b56eec7
...
...
@@ -661,6 +661,7 @@ struct input_absinfo {
#define SW_DOCK 0x05
/* set = plugged into dock */
#define SW_LINEOUT_INSERT 0x06
/* set = inserted */
#define SW_JACK_PHYSICAL_INSERT 0x07
/* set = mechanical switch set */
#define SW_VIDEOOUT_INSERT 0x08
/* set = inserted */
#define SW_MAX 0x0f
#define SW_CNT (SW_MAX+1)
...
...
include/sound/jack.h
浏览文件 @
5b56eec7
...
...
@@ -30,6 +30,9 @@ struct input_dev;
/**
* Jack types which can be reported. These values are used as a
* bitmask.
*
* Note that this must be kept in sync with the lookup table in
* sound/core/jack.c.
*/
enum
snd_jack_types
{
SND_JACK_HEADPHONE
=
0x0001
,
...
...
@@ -37,6 +40,8 @@ enum snd_jack_types {
SND_JACK_HEADSET
=
SND_JACK_HEADPHONE
|
SND_JACK_MICROPHONE
,
SND_JACK_LINEOUT
=
0x0004
,
SND_JACK_MECHANICAL
=
0x0008
,
/* If detected separately */
SND_JACK_VIDEOOUT
=
0x0010
,
SND_JACK_AVOUT
=
SND_JACK_LINEOUT
|
SND_JACK_VIDEOOUT
,
};
struct
snd_jack
{
...
...
sound/core/jack.c
浏览文件 @
5b56eec7
...
...
@@ -23,6 +23,14 @@
#include <sound/jack.h>
#include <sound/core.h>
static
int
jack_types
[]
=
{
SW_HEADPHONE_INSERT
,
SW_MICROPHONE_INSERT
,
SW_LINEOUT_INSERT
,
SW_JACK_PHYSICAL_INSERT
,
SW_VIDEOOUT_INSERT
,
};
static
int
snd_jack_dev_free
(
struct
snd_device
*
device
)
{
struct
snd_jack
*
jack
=
device
->
device_data
;
...
...
@@ -79,6 +87,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
{
struct
snd_jack
*
jack
;
int
err
;
int
i
;
static
struct
snd_device_ops
ops
=
{
.
dev_free
=
snd_jack_dev_free
,
.
dev_register
=
snd_jack_dev_register
,
...
...
@@ -100,18 +109,10 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
jack
->
type
=
type
;
if
(
type
&
SND_JACK_HEADPHONE
)
input_set_capability
(
jack
->
input_dev
,
EV_SW
,
SW_HEADPHONE_INSERT
);
if
(
type
&
SND_JACK_LINEOUT
)
input_set_capability
(
jack
->
input_dev
,
EV_SW
,
SW_LINEOUT_INSERT
);
if
(
type
&
SND_JACK_MICROPHONE
)
input_set_capability
(
jack
->
input_dev
,
EV_SW
,
SW_MICROPHONE_INSERT
);
if
(
type
&
SND_JACK_MECHANICAL
)
input_set_capability
(
jack
->
input_dev
,
EV_SW
,
SW_JACK_PHYSICAL_INSERT
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
jack_types
);
i
++
)
if
(
type
&
(
1
<<
i
))
input_set_capability
(
jack
->
input_dev
,
EV_SW
,
jack_types
[
i
]);
err
=
snd_device_new
(
card
,
SNDRV_DEV_JACK
,
jack
,
&
ops
);
if
(
err
<
0
)
...
...
@@ -154,21 +155,17 @@ EXPORT_SYMBOL(snd_jack_set_parent);
*/
void
snd_jack_report
(
struct
snd_jack
*
jack
,
int
status
)
{
int
i
;
if
(
!
jack
)
return
;
if
(
jack
->
type
&
SND_JACK_HEADPHONE
)
input_report_switch
(
jack
->
input_dev
,
SW_HEADPHONE_INSERT
,
status
&
SND_JACK_HEADPHONE
);
if
(
jack
->
type
&
SND_JACK_LINEOUT
)
input_report_switch
(
jack
->
input_dev
,
SW_LINEOUT_INSERT
,
status
&
SND_JACK_LINEOUT
);
if
(
jack
->
type
&
SND_JACK_MICROPHONE
)
input_report_switch
(
jack
->
input_dev
,
SW_MICROPHONE_INSERT
,
status
&
SND_JACK_MICROPHONE
);
if
(
jack
->
type
&
SND_JACK_MECHANICAL
)
input_report_switch
(
jack
->
input_dev
,
SW_JACK_PHYSICAL_INSERT
,
status
&
SND_JACK_MECHANICAL
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
jack_types
);
i
++
)
{
int
testbit
=
1
<<
i
;
if
(
jack
->
type
&
testbit
)
input_report_switch
(
jack
->
input_dev
,
jack_types
[
i
],
status
&
testbit
);
}
input_sync
(
jack
->
input_dev
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录