Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5ce442fe
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看板
提交
5ce442fe
编写于
12月 25, 2008
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/udev-id-rename' into to-push
上级
60cda2b5
2af75293
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
146 addition
and
52 deletion
+146
-52
include/sound/info.h
include/sound/info.h
+57
-49
sound/core/info.c
sound/core/info.c
+17
-0
sound/core/init.c
sound/core/init.c
+70
-1
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/hdsp.c
+1
-1
sound/pci/rme9652/hdspm.c
sound/pci/rme9652/hdspm.c
+1
-1
未找到文件。
include/sound/info.h
浏览文件 @
5ce442fe
...
...
@@ -40,30 +40,34 @@ struct snd_info_buffer {
struct
snd_info_entry
;
struct
snd_info_entry_text
{
void
(
*
read
)
(
struct
snd_info_entry
*
entry
,
struct
snd_info_buffer
*
buffer
);
void
(
*
write
)
(
struct
snd_info_entry
*
entry
,
struct
snd_info_buffer
*
buffer
);
void
(
*
read
)(
struct
snd_info_entry
*
entry
,
struct
snd_info_buffer
*
buffer
);
void
(
*
write
)(
struct
snd_info_entry
*
entry
,
struct
snd_info_buffer
*
buffer
);
};
struct
snd_info_entry_ops
{
int
(
*
open
)
(
struct
snd_info_entry
*
entry
,
unsigned
short
mode
,
void
**
file_private_data
);
int
(
*
release
)
(
struct
snd_info_entry
*
entry
,
unsigned
short
mode
,
void
*
file_private_data
);
long
(
*
read
)
(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
int
(
*
open
)(
struct
snd_info_entry
*
entry
,
unsigned
short
mode
,
void
**
file_private_data
);
int
(
*
release
)(
struct
snd_info_entry
*
entry
,
unsigned
short
mode
,
void
*
file_private_data
);
long
(
*
read
)(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
);
long
(
*
write
)(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
const
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
);
long
(
*
write
)
(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
const
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
);
long
long
(
*
llseek
)
(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
long
long
offset
,
int
orig
);
unsigned
int
(
*
poll
)
(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
poll_table
*
wait
);
int
(
*
ioctl
)
(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
int
(
*
mmap
)
(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
inode
*
inode
,
struct
file
*
file
,
struct
vm_area_struct
*
vma
);
long
long
(
*
llseek
)(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
long
long
offset
,
int
orig
);
unsigned
int
(
*
poll
)(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
poll_table
*
wait
);
int
(
*
ioctl
)(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
int
(
*
mmap
)(
struct
snd_info_entry
*
entry
,
void
*
file_private_data
,
struct
inode
*
inode
,
struct
file
*
file
,
struct
vm_area_struct
*
vma
);
};
struct
snd_info_entry
{
...
...
@@ -106,34 +110,37 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer);
static
inline
void
snd_card_info_read_oss
(
struct
snd_info_buffer
*
buffer
)
{}
#endif
int
snd_iprintf
(
struct
snd_info_buffer
*
buffer
,
char
*
fmt
,...)
__attribute__
((
format
(
printf
,
2
,
3
)));
int
snd_iprintf
(
struct
snd_info_buffer
*
buffer
,
char
*
fmt
,
...)
\
__attribute__
((
format
(
printf
,
2
,
3
)));
int
snd_info_init
(
void
);
int
snd_info_done
(
void
);
int
snd_info_get_line
(
struct
snd_info_buffer
*
buffer
,
char
*
line
,
int
len
);
int
snd_info_get_line
(
struct
snd_info_buffer
*
buffer
,
char
*
line
,
int
len
);
char
*
snd_info_get_str
(
char
*
dest
,
char
*
src
,
int
len
);
struct
snd_info_entry
*
snd_info_create_module_entry
(
struct
module
*
module
,
struct
snd_info_entry
*
snd_info_create_module_entry
(
struct
module
*
module
,
const
char
*
name
,
struct
snd_info_entry
*
parent
);
struct
snd_info_entry
*
snd_info_create_card_entry
(
struct
snd_card
*
card
,
struct
snd_info_entry
*
parent
);
struct
snd_info_entry
*
snd_info_create_card_entry
(
struct
snd_card
*
card
,
const
char
*
name
,
struct
snd_info_entry
*
parent
);
void
snd_info_free_entry
(
struct
snd_info_entry
*
entry
);
int
snd_info_store_text
(
struct
snd_info_entry
*
entry
);
int
snd_info_restore_text
(
struct
snd_info_entry
*
entry
);
int
snd_info_card_create
(
struct
snd_card
*
card
);
int
snd_info_card_register
(
struct
snd_card
*
card
);
int
snd_info_card_free
(
struct
snd_card
*
card
);
void
snd_info_card_disconnect
(
struct
snd_card
*
card
);
int
snd_info_register
(
struct
snd_info_entry
*
entry
);
struct
snd_info_entry
*
parent
);
void
snd_info_free_entry
(
struct
snd_info_entry
*
entry
);
int
snd_info_store_text
(
struct
snd_info_entry
*
entry
);
int
snd_info_restore_text
(
struct
snd_info_entry
*
entry
);
int
snd_info_card_create
(
struct
snd_card
*
card
);
int
snd_info_card_register
(
struct
snd_card
*
card
);
int
snd_info_card_free
(
struct
snd_card
*
card
);
void
snd_info_card_disconnect
(
struct
snd_card
*
card
);
void
snd_info_card_id_change
(
struct
snd_card
*
card
);
int
snd_info_register
(
struct
snd_info_entry
*
entry
);
/* for card drivers */
int
snd_card_proc_new
(
struct
snd_card
*
card
,
const
char
*
name
,
struct
snd_info_entry
**
entryp
);
int
snd_card_proc_new
(
struct
snd_card
*
card
,
const
char
*
name
,
struct
snd_info_entry
**
entryp
);
static
inline
void
snd_info_set_text_ops
(
struct
snd_info_entry
*
entry
,
void
*
private_data
,
void
(
*
read
)(
struct
snd_info_entry
*
,
struct
snd_info_buffer
*
))
void
*
private_data
,
void
(
*
read
)(
struct
snd_info_entry
*
,
struct
snd_info_buffer
*
))
{
entry
->
private_data
=
private_data
;
entry
->
c
.
text
.
read
=
read
;
...
...
@@ -146,21 +153,22 @@ int snd_info_check_reserved_words(const char *str);
#define snd_seq_root NULL
#define snd_oss_root NULL
static
inline
int
snd_iprintf
(
struct
snd_info_buffer
*
buffer
,
char
*
fmt
,
...)
{
return
0
;
}
static
inline
int
snd_iprintf
(
struct
snd_info_buffer
*
buffer
,
char
*
fmt
,
...)
{
return
0
;
}
static
inline
int
snd_info_init
(
void
)
{
return
0
;
}
static
inline
int
snd_info_done
(
void
)
{
return
0
;
}
static
inline
int
snd_info_get_line
(
struct
snd_info_buffer
*
buffer
,
char
*
line
,
int
len
)
{
return
0
;
}
static
inline
int
snd_info_get_line
(
struct
snd_info_buffer
*
buffer
,
char
*
line
,
int
len
)
{
return
0
;
}
static
inline
char
*
snd_info_get_str
(
char
*
dest
,
char
*
src
,
int
len
)
{
return
NULL
;
}
static
inline
struct
snd_info_entry
*
snd_info_create_module_entry
(
struct
module
*
module
,
const
char
*
name
,
struct
snd_info_entry
*
parent
)
{
return
NULL
;
}
static
inline
struct
snd_info_entry
*
snd_info_create_card_entry
(
struct
snd_card
*
card
,
const
char
*
name
,
struct
snd_info_entry
*
parent
)
{
return
NULL
;
}
static
inline
void
snd_info_free_entry
(
struct
snd_info_entry
*
entry
)
{
;
}
static
inline
int
snd_info_card_create
(
struct
snd_card
*
card
)
{
return
0
;
}
static
inline
int
snd_info_card_register
(
struct
snd_card
*
card
)
{
return
0
;
}
static
inline
int
snd_info_card_free
(
struct
snd_card
*
card
)
{
return
0
;
}
static
inline
void
snd_info_card_disconnect
(
struct
snd_card
*
card
)
{
}
static
inline
int
snd_info_register
(
struct
snd_info_entry
*
entry
)
{
return
0
;
}
static
inline
struct
snd_info_entry
*
snd_info_create_module_entry
(
struct
module
*
module
,
const
char
*
name
,
struct
snd_info_entry
*
parent
)
{
return
NULL
;
}
static
inline
struct
snd_info_entry
*
snd_info_create_card_entry
(
struct
snd_card
*
card
,
const
char
*
name
,
struct
snd_info_entry
*
parent
)
{
return
NULL
;
}
static
inline
void
snd_info_free_entry
(
struct
snd_info_entry
*
entry
)
{
;
}
static
inline
int
snd_info_card_create
(
struct
snd_card
*
card
)
{
return
0
;
}
static
inline
int
snd_info_card_register
(
struct
snd_card
*
card
)
{
return
0
;
}
static
inline
int
snd_info_card_free
(
struct
snd_card
*
card
)
{
return
0
;
}
static
inline
void
snd_info_card_disconnect
(
struct
snd_card
*
card
)
{
}
static
inline
void
snd_info_card_id_change
(
struct
snd_card
*
card
)
{
}
static
inline
int
snd_info_register
(
struct
snd_info_entry
*
entry
)
{
return
0
;
}
static
inline
int
snd_card_proc_new
(
struct
snd_card
*
card
,
const
char
*
name
,
struct
snd_info_entry
**
entryp
)
{
return
-
EINVAL
;
}
...
...
sound/core/info.c
浏览文件 @
5ce442fe
...
...
@@ -652,6 +652,23 @@ int snd_info_card_register(struct snd_card *card)
return
0
;
}
/*
* called on card->id change
*/
void
snd_info_card_id_change
(
struct
snd_card
*
card
)
{
mutex_lock
(
&
info_mutex
);
if
(
card
->
proc_root_link
)
{
snd_remove_proc_entry
(
snd_proc_root
,
card
->
proc_root_link
);
card
->
proc_root_link
=
NULL
;
}
if
(
strcmp
(
card
->
id
,
card
->
proc_root
->
name
))
card
->
proc_root_link
=
proc_symlink
(
card
->
id
,
snd_proc_root
,
card
->
proc_root
->
name
);
mutex_unlock
(
&
info_mutex
);
}
/*
* de-register the card proc file
* called from init.c
...
...
sound/core/init.c
浏览文件 @
5ce442fe
...
...
@@ -533,6 +533,65 @@ static void choose_default_id(struct snd_card *card)
}
}
#ifndef CONFIG_SYSFS_DEPRECATED
static
ssize_t
card_id_show_attr
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
snd_card
*
card
=
dev_get_drvdata
(
dev
);
return
snprintf
(
buf
,
PAGE_SIZE
,
"%s
\n
"
,
card
?
card
->
id
:
"(null)"
);
}
static
ssize_t
card_id_store_attr
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
const
char
*
buf
,
size_t
count
)
{
struct
snd_card
*
card
=
dev_get_drvdata
(
dev
);
char
buf1
[
sizeof
(
card
->
id
)];
size_t
copy
=
count
>
sizeof
(
card
->
id
)
-
1
?
sizeof
(
card
->
id
)
-
1
:
count
;
size_t
idx
;
int
c
;
for
(
idx
=
0
;
idx
<
copy
;
idx
++
)
{
c
=
buf
[
idx
];
if
(
!
isalnum
(
c
)
&&
c
!=
'_'
&&
c
!=
'-'
)
return
-
EINVAL
;
}
memcpy
(
buf1
,
buf
,
copy
);
buf1
[
copy
]
=
'\0'
;
mutex_lock
(
&
snd_card_mutex
);
if
(
!
snd_info_check_reserved_words
(
buf1
))
{
__exist:
mutex_unlock
(
&
snd_card_mutex
);
return
-
EEXIST
;
}
for
(
idx
=
0
;
idx
<
snd_ecards_limit
;
idx
++
)
{
if
(
snd_cards
[
idx
]
&&
!
strcmp
(
snd_cards
[
idx
]
->
id
,
buf1
))
goto
__exist
;
}
strcpy
(
card
->
id
,
buf1
);
snd_info_card_id_change
(
card
);
mutex_unlock
(
&
snd_card_mutex
);
return
count
;
}
static
struct
device_attribute
card_id_attrs
=
__ATTR
(
id
,
S_IRUGO
|
S_IWUSR
,
card_id_show_attr
,
card_id_store_attr
);
static
ssize_t
card_number_show_attr
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
snd_card
*
card
=
dev_get_drvdata
(
dev
);
return
snprintf
(
buf
,
PAGE_SIZE
,
"%i
\n
"
,
card
?
card
->
number
:
-
1
);
}
static
struct
device_attribute
card_number_attrs
=
__ATTR
(
number
,
S_IRUGO
,
card_number_show_attr
,
NULL
);
#endif
/* CONFIG_SYSFS_DEPRECATED */
/**
* snd_card_register - register the soundcard
* @card: soundcard structure
...
...
@@ -553,7 +612,7 @@ int snd_card_register(struct snd_card *card)
#ifndef CONFIG_SYSFS_DEPRECATED
if
(
!
card
->
card_dev
)
{
card
->
card_dev
=
device_create
(
sound_class
,
card
->
dev
,
MKDEV
(
0
,
0
),
NULL
,
MKDEV
(
0
,
0
),
card
,
"card%i"
,
card
->
number
);
if
(
IS_ERR
(
card
->
card_dev
))
card
->
card_dev
=
NULL
;
...
...
@@ -575,6 +634,16 @@ int snd_card_register(struct snd_card *card)
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
if
(
snd_mixer_oss_notify_callback
)
snd_mixer_oss_notify_callback
(
card
,
SND_MIXER_OSS_NOTIFY_REGISTER
);
#endif
#ifndef CONFIG_SYSFS_DEPRECATED
if
(
card
->
card_dev
)
{
err
=
device_create_file
(
card
->
card_dev
,
&
card_id_attrs
);
if
(
err
<
0
)
return
err
;
err
=
device_create_file
(
card
->
card_dev
,
&
card_number_attrs
);
if
(
err
<
0
)
return
err
;
}
#endif
return
0
;
}
...
...
sound/pci/rme9652/hdsp.c
浏览文件 @
5ce442fe
...
...
@@ -1452,7 +1452,7 @@ static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int i
if
(
snd_rawmidi_new
(
card
,
buf
,
id
,
1
,
1
,
&
hdsp
->
midi
[
id
].
rmidi
)
<
0
)
return
-
1
;
sprintf
(
hdsp
->
midi
[
id
].
rmidi
->
name
,
"%s MIDI %d"
,
card
->
id
,
id
+
1
);
sprintf
(
hdsp
->
midi
[
id
].
rmidi
->
name
,
"HDSP MIDI %d"
,
id
+
1
);
hdsp
->
midi
[
id
].
rmidi
->
private_data
=
&
hdsp
->
midi
[
id
];
snd_rawmidi_set_ops
(
hdsp
->
midi
[
id
].
rmidi
,
SNDRV_RAWMIDI_STREAM_OUTPUT
,
&
snd_hdsp_midi_output
);
...
...
sound/pci/rme9652/hdspm.c
浏览文件 @
5ce442fe
...
...
@@ -1293,7 +1293,7 @@ static int __devinit snd_hdspm_create_midi (struct snd_card *card,
if
(
err
<
0
)
return
err
;
sprintf
(
hdspm
->
midi
[
id
].
rmidi
->
name
,
"%s MIDI %d"
,
card
->
id
,
id
+
1
);
sprintf
(
hdspm
->
midi
[
id
].
rmidi
->
name
,
"HDSPM MIDI %d"
,
id
+
1
);
hdspm
->
midi
[
id
].
rmidi
->
private_data
=
&
hdspm
->
midi
[
id
];
snd_rawmidi_set_ops
(
hdspm
->
midi
[
id
].
rmidi
,
SNDRV_RAWMIDI_STREAM_OUTPUT
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录