Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
3e0b33f7
K
Kernel
项目概览
openeuler
/
Kernel
12 个月 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3e0b33f7
编写于
2月 05, 2010
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'alsa/fixes' into for-linus
上级
a26a4088
9d4c7464
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
41 deletion
+32
-41
sound/pci/ctxfi/ctatc.c
sound/pci/ctxfi/ctatc.c
+2
-13
sound/pci/ctxfi/ctvmem.c
sound/pci/ctxfi/ctvmem.c
+18
-20
sound/pci/ctxfi/ctvmem.h
sound/pci/ctxfi/ctvmem.h
+5
-3
sound/pci/ice1712/aureon.c
sound/pci/ice1712/aureon.c
+7
-5
未找到文件。
sound/pci/ctxfi/ctatc.c
浏览文件 @
3e0b33f7
...
...
@@ -166,18 +166,7 @@ static void ct_unmap_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
static
unsigned
long
atc_get_ptp_phys
(
struct
ct_atc
*
atc
,
int
index
)
{
struct
ct_vm
*
vm
;
void
*
kvirt_addr
;
unsigned
long
phys_addr
;
vm
=
atc
->
vm
;
kvirt_addr
=
vm
->
get_ptp_virt
(
vm
,
index
);
if
(
kvirt_addr
==
NULL
)
phys_addr
=
(
~
0UL
);
else
phys_addr
=
virt_to_phys
(
kvirt_addr
);
return
phys_addr
;
return
atc
->
vm
->
get_ptp_phys
(
atc
->
vm
,
index
);
}
static
unsigned
int
convert_format
(
snd_pcm_format_t
snd_format
)
...
...
@@ -1669,7 +1658,7 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
}
/* Set up device virtual memory management object */
err
=
ct_vm_create
(
&
atc
->
vm
);
err
=
ct_vm_create
(
&
atc
->
vm
,
pci
);
if
(
err
<
0
)
goto
error1
;
...
...
sound/pci/ctxfi/ctvmem.c
浏览文件 @
3e0b33f7
...
...
@@ -138,7 +138,7 @@ ct_vm_map(struct ct_vm *vm, struct snd_pcm_substream *substream, int size)
return
NULL
;
}
ptp
=
vm
->
ptp
[
0
]
;
ptp
=
(
unsigned
long
*
)
vm
->
ptp
[
0
].
area
;
pte_start
=
(
block
->
addr
>>
CT_PAGE_SHIFT
);
pages
=
block
->
size
>>
CT_PAGE_SHIFT
;
for
(
i
=
0
;
i
<
pages
;
i
++
)
{
...
...
@@ -158,25 +158,25 @@ static void ct_vm_unmap(struct ct_vm *vm, struct ct_vm_block *block)
}
/* *
* return the host
(kmalloced)
addr of the @index-th device
* page ta
lbe page on success, or NUL
L on failure.
* The first returned
NUL
L indicates the termination.
* return the host
physical
addr of the @index-th device
* page ta
ble page on success, or ~0U
L on failure.
* The first returned
~0U
L indicates the termination.
* */
static
void
*
ct_get_ptp_
virt
(
struct
ct_vm
*
vm
,
int
index
)
static
dma_addr_t
ct_get_ptp_
phys
(
struct
ct_vm
*
vm
,
int
index
)
{
void
*
addr
;
dma_addr_t
addr
;
addr
=
(
index
>=
CT_PTP_NUM
)
?
NULL
:
vm
->
ptp
[
index
]
;
addr
=
(
index
>=
CT_PTP_NUM
)
?
~
0UL
:
vm
->
ptp
[
index
].
addr
;
return
addr
;
}
int
ct_vm_create
(
struct
ct_vm
**
rvm
)
int
ct_vm_create
(
struct
ct_vm
**
rvm
,
struct
pci_dev
*
pci
)
{
struct
ct_vm
*
vm
;
struct
ct_vm_block
*
block
;
int
i
;
int
i
,
err
=
0
;
*
rvm
=
NULL
;
...
...
@@ -188,23 +188,21 @@ int ct_vm_create(struct ct_vm **rvm)
/* Allocate page table pages */
for
(
i
=
0
;
i
<
CT_PTP_NUM
;
i
++
)
{
vm
->
ptp
[
i
]
=
kmalloc
(
PAGE_SIZE
,
GFP_KERNEL
);
if
(
!
vm
->
ptp
[
i
])
err
=
snd_dma_alloc_pages
(
SNDRV_DMA_TYPE_DEV
,
snd_dma_pci_data
(
pci
),
PAGE_SIZE
,
&
vm
->
ptp
[
i
]);
if
(
err
<
0
)
break
;
}
if
(
!
i
)
{
if
(
err
<
0
)
{
/* no page table pages are allocated */
kfree
(
vm
);
ct_vm_destroy
(
vm
);
return
-
ENOMEM
;
}
vm
->
size
=
CT_ADDRS_PER_PAGE
*
i
;
/* Initialise remaining ptps */
for
(;
i
<
CT_PTP_NUM
;
i
++
)
vm
->
ptp
[
i
]
=
NULL
;
vm
->
map
=
ct_vm_map
;
vm
->
unmap
=
ct_vm_unmap
;
vm
->
get_ptp_
virt
=
ct_get_ptp_virt
;
vm
->
get_ptp_
phys
=
ct_get_ptp_phys
;
INIT_LIST_HEAD
(
&
vm
->
unused
);
INIT_LIST_HEAD
(
&
vm
->
used
);
block
=
kzalloc
(
sizeof
(
*
block
),
GFP_KERNEL
);
...
...
@@ -242,7 +240,7 @@ void ct_vm_destroy(struct ct_vm *vm)
/* free allocated page table pages */
for
(
i
=
0
;
i
<
CT_PTP_NUM
;
i
++
)
kfree
(
vm
->
ptp
[
i
]);
snd_dma_free_pages
(
&
vm
->
ptp
[
i
]);
vm
->
size
=
0
;
...
...
sound/pci/ctxfi/ctvmem.h
浏览文件 @
3e0b33f7
...
...
@@ -22,6 +22,8 @@
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/pci.h>
#include <sound/memalloc.h>
/* The chip can handle the page table of 4k pages
* (emu20k1 can handle even 8k pages, but we don't use it right now)
...
...
@@ -41,7 +43,7 @@ struct snd_pcm_substream;
/* Virtual memory management object for card device */
struct
ct_vm
{
void
*
ptp
[
CT_PTP_NUM
];
/* Device page table pages */
struct
snd_dma_buffer
ptp
[
CT_PTP_NUM
];
/* Device page table pages */
unsigned
int
size
;
/* Available addr space in bytes */
struct
list_head
unused
;
/* List of unused blocks */
struct
list_head
used
;
/* List of used blocks */
...
...
@@ -52,10 +54,10 @@ struct ct_vm {
int
size
);
/* Unmap device logical addr area. */
void
(
*
unmap
)(
struct
ct_vm
*
,
struct
ct_vm_block
*
block
);
void
*
(
*
get_ptp_virt
)(
struct
ct_vm
*
vm
,
int
index
);
dma_addr_t
(
*
get_ptp_phys
)(
struct
ct_vm
*
vm
,
int
index
);
};
int
ct_vm_create
(
struct
ct_vm
**
rvm
);
int
ct_vm_create
(
struct
ct_vm
**
rvm
,
struct
pci_dev
*
pci
);
void
ct_vm_destroy
(
struct
ct_vm
*
vm
);
#endif
/* CTVMEM_H */
sound/pci/ice1712/aureon.c
浏览文件 @
3e0b33f7
...
...
@@ -703,11 +703,13 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned sho
{
unsigned
char
nvol
;
if
((
master
&
WM_VOL_MUTE
)
||
(
vol
&
WM_VOL_MUTE
))
if
((
master
&
WM_VOL_MUTE
)
||
(
vol
&
WM_VOL_MUTE
))
{
nvol
=
0
;
else
}
else
{
nvol
=
((
vol
%
WM_VOL_CNT
)
*
(
master
%
WM_VOL_CNT
))
/
WM_VOL_MAX
;
nvol
+=
0x1b
;
}
wm_put
(
ice
,
index
,
nvol
);
wm_put_nocache
(
ice
,
index
,
0x180
|
nvol
);
...
...
@@ -778,7 +780,7 @@ static int wm_master_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
for
(
ch
=
0
;
ch
<
2
;
ch
++
)
{
unsigned
int
vol
=
ucontrol
->
value
.
integer
.
value
[
ch
];
if
(
vol
>
WM_VOL_MAX
)
continue
;
vol
=
WM_VOL_MAX
;
vol
|=
spec
->
master
[
ch
]
&
WM_VOL_MUTE
;
if
(
vol
!=
spec
->
master
[
ch
])
{
int
dac
;
...
...
@@ -834,8 +836,8 @@ static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *
for
(
i
=
0
;
i
<
voices
;
i
++
)
{
unsigned
int
vol
=
ucontrol
->
value
.
integer
.
value
[
i
];
if
(
vol
>
WM_VOL_MAX
)
continue
;
vol
|=
spec
->
vol
[
ofs
+
i
];
vol
=
WM_VOL_MAX
;
vol
|=
spec
->
vol
[
ofs
+
i
]
&
WM_VOL_MUTE
;
if
(
vol
!=
spec
->
vol
[
ofs
+
i
])
{
spec
->
vol
[
ofs
+
i
]
=
vol
;
idx
=
WM_DAC_ATTEN
+
ofs
+
i
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录