Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
e2cb0d95
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
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,发现更多精彩内容 >>
提交
e2cb0d95
编写于
6月 29, 2009
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix/oxygen' into for-linus
* fix/oxygen: sound: oxygen: make mic volume control mono
上级
7d489c46
14744d7d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
18 addition
and
10 deletion
+18
-10
sound/pci/oxygen/oxygen_mixer.c
sound/pci/oxygen/oxygen_mixer.c
+18
-10
未找到文件。
sound/pci/oxygen/oxygen_mixer.c
浏览文件 @
e2cb0d95
...
...
@@ -575,8 +575,10 @@ static int ac97_switch_put(struct snd_kcontrol *ctl,
static
int
ac97_volume_info
(
struct
snd_kcontrol
*
ctl
,
struct
snd_ctl_elem_info
*
info
)
{
int
stereo
=
(
ctl
->
private_value
>>
16
)
&
1
;
info
->
type
=
SNDRV_CTL_ELEM_TYPE_INTEGER
;
info
->
count
=
2
;
info
->
count
=
stereo
?
2
:
1
;
info
->
value
.
integer
.
min
=
0
;
info
->
value
.
integer
.
max
=
0x1f
;
return
0
;
...
...
@@ -587,6 +589,7 @@ static int ac97_volume_get(struct snd_kcontrol *ctl,
{
struct
oxygen
*
chip
=
ctl
->
private_data
;
unsigned
int
codec
=
(
ctl
->
private_value
>>
24
)
&
1
;
int
stereo
=
(
ctl
->
private_value
>>
16
)
&
1
;
unsigned
int
index
=
ctl
->
private_value
&
0xff
;
u16
reg
;
...
...
@@ -594,6 +597,7 @@ static int ac97_volume_get(struct snd_kcontrol *ctl,
reg
=
oxygen_read_ac97
(
chip
,
codec
,
index
);
mutex_unlock
(
&
chip
->
mutex
);
value
->
value
.
integer
.
value
[
0
]
=
31
-
(
reg
&
0x1f
);
if
(
stereo
)
value
->
value
.
integer
.
value
[
1
]
=
31
-
((
reg
>>
8
)
&
0x1f
);
return
0
;
}
...
...
@@ -603,6 +607,7 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,
{
struct
oxygen
*
chip
=
ctl
->
private_data
;
unsigned
int
codec
=
(
ctl
->
private_value
>>
24
)
&
1
;
int
stereo
=
(
ctl
->
private_value
>>
16
)
&
1
;
unsigned
int
index
=
ctl
->
private_value
&
0xff
;
u16
oldreg
,
newreg
;
int
change
;
...
...
@@ -612,8 +617,11 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,
newreg
=
oldreg
;
newreg
=
(
newreg
&
~
0x1f
)
|
(
31
-
(
value
->
value
.
integer
.
value
[
0
]
&
0x1f
));
if
(
stereo
)
newreg
=
(
newreg
&
~
0x1f00
)
|
((
31
-
(
value
->
value
.
integer
.
value
[
0
]
&
0x1f
))
<<
8
);
((
31
-
(
value
->
value
.
integer
.
value
[
1
]
&
0x1f
))
<<
8
);
else
newreg
=
(
newreg
&
~
0x1f00
)
|
((
newreg
&
0x1f
)
<<
8
);
change
=
newreg
!=
oldreg
;
if
(
change
)
oxygen_write_ac97
(
chip
,
codec
,
index
,
newreg
);
...
...
@@ -673,7 +681,7 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl,
.private_value = ((codec) << 24) | ((invert) << 16) | \
((bitnr) << 8) | (index), \
}
#define AC97_VOLUME(xname, codec, index) { \
#define AC97_VOLUME(xname, codec, index
, stereo
) { \
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.name = xname, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
...
...
@@ -682,7 +690,7 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl,
.get = ac97_volume_get, \
.put = ac97_volume_put, \
.tlv = { .p = ac97_db_scale, }, \
.private_value = ((codec) << 24) | (index), \
.private_value = ((codec) << 24) | (
(stereo) << 16) | (
index), \
}
static
DECLARE_TLV_DB_SCALE
(
monitor_db_scale
,
-
1000
,
1000
,
0
);
...
...
@@ -882,18 +890,18 @@ static const struct {
};
static
const
struct
snd_kcontrol_new
ac97_controls
[]
=
{
AC97_VOLUME
(
"Mic Capture Volume"
,
0
,
AC97_MIC
),
AC97_VOLUME
(
"Mic Capture Volume"
,
0
,
AC97_MIC
,
0
),
AC97_SWITCH
(
"Mic Capture Switch"
,
0
,
AC97_MIC
,
15
,
1
),
AC97_SWITCH
(
"Mic Boost (+20dB)"
,
0
,
AC97_MIC
,
6
,
0
),
AC97_SWITCH
(
"Line Capture Switch"
,
0
,
AC97_LINE
,
15
,
1
),
AC97_VOLUME
(
"CD Capture Volume"
,
0
,
AC97_CD
),
AC97_VOLUME
(
"CD Capture Volume"
,
0
,
AC97_CD
,
1
),
AC97_SWITCH
(
"CD Capture Switch"
,
0
,
AC97_CD
,
15
,
1
),
AC97_VOLUME
(
"Aux Capture Volume"
,
0
,
AC97_AUX
),
AC97_VOLUME
(
"Aux Capture Volume"
,
0
,
AC97_AUX
,
1
),
AC97_SWITCH
(
"Aux Capture Switch"
,
0
,
AC97_AUX
,
15
,
1
),
};
static
const
struct
snd_kcontrol_new
ac97_fp_controls
[]
=
{
AC97_VOLUME
(
"Front Panel Playback Volume"
,
1
,
AC97_HEADPHONE
),
AC97_VOLUME
(
"Front Panel Playback Volume"
,
1
,
AC97_HEADPHONE
,
1
),
AC97_SWITCH
(
"Front Panel Playback Switch"
,
1
,
AC97_HEADPHONE
,
15
,
1
),
{
.
iface
=
SNDRV_CTL_ELEM_IFACE_MIXER
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录