Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
c441c297
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看板
提交
c441c297
编写于
3月 24, 2009
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/usb-caiaq' into for-linus
上级
afad17c0
28514fe5
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
79 addition
and
11 deletion
+79
-11
sound/usb/Kconfig
sound/usb/Kconfig
+3
-0
sound/usb/caiaq/caiaq-audio.c
sound/usb/caiaq/caiaq-audio.c
+12
-3
sound/usb/caiaq/caiaq-control.c
sound/usb/caiaq/caiaq-control.c
+38
-4
sound/usb/caiaq/caiaq-device.c
sound/usb/caiaq/caiaq-device.c
+22
-2
sound/usb/caiaq/caiaq-device.h
sound/usb/caiaq/caiaq-device.h
+4
-2
未找到文件。
sound/usb/Kconfig
浏览文件 @
c441c297
...
@@ -48,7 +48,10 @@ config SND_USB_CAIAQ
...
@@ -48,7 +48,10 @@ config SND_USB_CAIAQ
* Native Instruments Kore Controller
* Native Instruments Kore Controller
* Native Instruments Kore Controller 2
* Native Instruments Kore Controller 2
* Native Instruments Audio Kontrol 1
* Native Instruments Audio Kontrol 1
* Native Instruments Audio 4 DJ
* Native Instruments Audio 8 DJ
* Native Instruments Audio 8 DJ
* Native Instruments Guitar Rig Session I/O
* Native Instruments Guitar Rig mobile
To compile this driver as a module, choose M here: the module
To compile this driver as a module, choose M here: the module
will be called snd-usb-caiaq.
will be called snd-usb-caiaq.
...
...
sound/usb/caiaq/caiaq-audio.c
浏览文件 @
c441c297
...
@@ -114,6 +114,7 @@ static int stream_start(struct snd_usb_caiaqdev *dev)
...
@@ -114,6 +114,7 @@ static int stream_start(struct snd_usb_caiaqdev *dev)
dev
->
output_panic
=
0
;
dev
->
output_panic
=
0
;
dev
->
first_packet
=
1
;
dev
->
first_packet
=
1
;
dev
->
streaming
=
1
;
dev
->
streaming
=
1
;
dev
->
warned
=
0
;
for
(
i
=
0
;
i
<
N_URBS
;
i
++
)
{
for
(
i
=
0
;
i
<
N_URBS
;
i
++
)
{
ret
=
usb_submit_urb
(
dev
->
data_urbs_in
[
i
],
GFP_ATOMIC
);
ret
=
usb_submit_urb
(
dev
->
data_urbs_in
[
i
],
GFP_ATOMIC
);
...
@@ -376,6 +377,9 @@ static void read_in_urb_mode2(struct snd_usb_caiaqdev *dev,
...
@@ -376,6 +377,9 @@ static void read_in_urb_mode2(struct snd_usb_caiaqdev *dev,
for
(
stream
=
0
;
stream
<
dev
->
n_streams
;
stream
++
,
i
++
)
{
for
(
stream
=
0
;
stream
<
dev
->
n_streams
;
stream
++
,
i
++
)
{
sub
=
dev
->
sub_capture
[
stream
];
sub
=
dev
->
sub_capture
[
stream
];
if
(
dev
->
input_panic
)
usb_buf
[
i
]
=
0
;
if
(
sub
)
{
if
(
sub
)
{
struct
snd_pcm_runtime
*
rt
=
sub
->
runtime
;
struct
snd_pcm_runtime
*
rt
=
sub
->
runtime
;
char
*
audio_buf
=
rt
->
dma_area
;
char
*
audio_buf
=
rt
->
dma_area
;
...
@@ -397,6 +401,9 @@ static void read_in_urb(struct snd_usb_caiaqdev *dev,
...
@@ -397,6 +401,9 @@ static void read_in_urb(struct snd_usb_caiaqdev *dev,
if
(
!
dev
->
streaming
)
if
(
!
dev
->
streaming
)
return
;
return
;
if
(
iso
->
actual_length
<
dev
->
bpp
)
return
;
switch
(
dev
->
spec
.
data_alignment
)
{
switch
(
dev
->
spec
.
data_alignment
)
{
case
0
:
case
0
:
read_in_urb_mode0
(
dev
,
urb
,
iso
);
read_in_urb_mode0
(
dev
,
urb
,
iso
);
...
@@ -406,10 +413,11 @@ static void read_in_urb(struct snd_usb_caiaqdev *dev,
...
@@ -406,10 +413,11 @@ static void read_in_urb(struct snd_usb_caiaqdev *dev,
break
;
break
;
}
}
if
(
dev
->
input_panic
||
dev
->
output_panic
)
{
if
(
(
dev
->
input_panic
||
dev
->
output_panic
)
&&
!
dev
->
warned
)
{
debug
(
"streaming error detected %s %s
\n
"
,
debug
(
"streaming error detected %s %s
\n
"
,
dev
->
input_panic
?
"(input)"
:
""
,
dev
->
input_panic
?
"(input)"
:
""
,
dev
->
output_panic
?
"(output)"
:
""
);
dev
->
output_panic
?
"(output)"
:
""
);
dev
->
warned
=
1
;
}
}
}
}
...
@@ -638,9 +646,10 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
...
@@ -638,9 +646,10 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AK1
):
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AK1
):
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_RIGKONTROL3
):
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_RIGKONTROL3
):
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_SESSIONIO
):
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_SESSIONIO
):
dev
->
samplerates
|=
SNDRV_PCM_RATE_88200
;
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_GUITARRIGMOBILE
):
dev
->
samplerates
|=
SNDRV_PCM_RATE_192000
;
dev
->
samplerates
|=
SNDRV_PCM_RATE_192000
;
break
;
/* fall thru */
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO4DJ
):
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO8DJ
):
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO8DJ
):
dev
->
samplerates
|=
SNDRV_PCM_RATE_88200
;
dev
->
samplerates
|=
SNDRV_PCM_RATE_88200
;
break
;
break
;
...
...
sound/usb/caiaq/caiaq-control.c
浏览文件 @
c441c297
...
@@ -39,12 +39,12 @@ static int control_info(struct snd_kcontrol *kcontrol,
...
@@ -39,12 +39,12 @@ static int control_info(struct snd_kcontrol *kcontrol,
struct
snd_usb_caiaqdev
*
dev
=
caiaqdev
(
chip
->
card
);
struct
snd_usb_caiaqdev
*
dev
=
caiaqdev
(
chip
->
card
);
int
pos
=
kcontrol
->
private_value
;
int
pos
=
kcontrol
->
private_value
;
int
is_intval
=
pos
&
CNT_INTVAL
;
int
is_intval
=
pos
&
CNT_INTVAL
;
unsigned
int
id
=
dev
->
chip
.
usb_id
;
uinfo
->
count
=
1
;
uinfo
->
count
=
1
;
pos
&=
~
CNT_INTVAL
;
pos
&=
~
CNT_INTVAL
;
if
(
dev
->
chip
.
usb_id
==
if
(
id
==
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO8DJ
)
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO8DJ
)
&&
(
pos
==
0
))
{
&&
(
pos
==
0
))
{
/* current input mode of A8DJ */
/* current input mode of A8DJ */
uinfo
->
type
=
SNDRV_CTL_ELEM_TYPE_INTEGER
;
uinfo
->
type
=
SNDRV_CTL_ELEM_TYPE_INTEGER
;
...
@@ -53,6 +53,15 @@ static int control_info(struct snd_kcontrol *kcontrol,
...
@@ -53,6 +53,15 @@ static int control_info(struct snd_kcontrol *kcontrol,
return
0
;
return
0
;
}
}
if
(
id
==
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO4DJ
)
&&
(
pos
==
0
))
{
/* current input mode of A4DJ */
uinfo
->
type
=
SNDRV_CTL_ELEM_TYPE_INTEGER
;
uinfo
->
value
.
integer
.
min
=
0
;
uinfo
->
value
.
integer
.
max
=
1
;
return
0
;
}
if
(
is_intval
)
{
if
(
is_intval
)
{
uinfo
->
type
=
SNDRV_CTL_ELEM_TYPE_INTEGER
;
uinfo
->
type
=
SNDRV_CTL_ELEM_TYPE_INTEGER
;
uinfo
->
value
.
integer
.
min
=
0
;
uinfo
->
value
.
integer
.
min
=
0
;
...
@@ -73,6 +82,14 @@ static int control_get(struct snd_kcontrol *kcontrol,
...
@@ -73,6 +82,14 @@ static int control_get(struct snd_kcontrol *kcontrol,
struct
snd_usb_caiaqdev
*
dev
=
caiaqdev
(
chip
->
card
);
struct
snd_usb_caiaqdev
*
dev
=
caiaqdev
(
chip
->
card
);
int
pos
=
kcontrol
->
private_value
;
int
pos
=
kcontrol
->
private_value
;
if
(
dev
->
chip
.
usb_id
==
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO4DJ
))
{
/* A4DJ has only one control */
/* do not expose hardware input mode 0 */
ucontrol
->
value
.
integer
.
value
[
0
]
=
dev
->
control_state
[
0
]
-
1
;
return
0
;
}
if
(
pos
&
CNT_INTVAL
)
if
(
pos
&
CNT_INTVAL
)
ucontrol
->
value
.
integer
.
value
[
0
]
ucontrol
->
value
.
integer
.
value
[
0
]
=
dev
->
control_state
[
pos
&
~
CNT_INTVAL
];
=
dev
->
control_state
[
pos
&
~
CNT_INTVAL
];
...
@@ -90,10 +107,20 @@ static int control_put(struct snd_kcontrol *kcontrol,
...
@@ -90,10 +107,20 @@ static int control_put(struct snd_kcontrol *kcontrol,
struct
snd_usb_caiaqdev
*
dev
=
caiaqdev
(
chip
->
card
);
struct
snd_usb_caiaqdev
*
dev
=
caiaqdev
(
chip
->
card
);
int
pos
=
kcontrol
->
private_value
;
int
pos
=
kcontrol
->
private_value
;
if
(
dev
->
chip
.
usb_id
==
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO4DJ
))
{
/* A4DJ has only one control */
/* do not expose hardware input mode 0 */
dev
->
control_state
[
0
]
=
ucontrol
->
value
.
integer
.
value
[
0
]
+
1
;
snd_usb_caiaq_send_command
(
dev
,
EP1_CMD_WRITE_IO
,
dev
->
control_state
,
sizeof
(
dev
->
control_state
));
return
1
;
}
if
(
pos
&
CNT_INTVAL
)
{
if
(
pos
&
CNT_INTVAL
)
{
dev
->
control_state
[
pos
&
~
CNT_INTVAL
]
dev
->
control_state
[
pos
&
~
CNT_INTVAL
]
=
ucontrol
->
value
.
integer
.
value
[
0
];
=
ucontrol
->
value
.
integer
.
value
[
0
];
snd_usb_caiaq_send_command
(
dev
,
EP1_CMD_
DIMM_LEDS
,
snd_usb_caiaq_send_command
(
dev
,
EP1_CMD_
WRITE_IO
,
dev
->
control_state
,
sizeof
(
dev
->
control_state
));
dev
->
control_state
,
sizeof
(
dev
->
control_state
));
}
else
{
}
else
{
if
(
ucontrol
->
value
.
integer
.
value
[
0
])
if
(
ucontrol
->
value
.
integer
.
value
[
0
])
...
@@ -243,10 +270,13 @@ static struct caiaq_controller a8dj_controller[] = {
...
@@ -243,10 +270,13 @@ static struct caiaq_controller a8dj_controller[] = {
{
"GND lift for TC Vinyl mode"
,
24
+
0
},
{
"GND lift for TC Vinyl mode"
,
24
+
0
},
{
"GND lift for TC CD/Line mode"
,
24
+
1
},
{
"GND lift for TC CD/Line mode"
,
24
+
1
},
{
"GND lift for phono mode"
,
24
+
2
},
{
"GND lift for phono mode"
,
24
+
2
},
{
"GND lift for TC Vinyl mode"
,
24
+
3
},
{
"Software lock"
,
40
}
{
"Software lock"
,
40
}
};
};
static
struct
caiaq_controller
a4dj_controller
[]
=
{
{
"Current input mode"
,
0
|
CNT_INTVAL
}
};
static
int
__devinit
add_controls
(
struct
caiaq_controller
*
c
,
int
num
,
static
int
__devinit
add_controls
(
struct
caiaq_controller
*
c
,
int
num
,
struct
snd_usb_caiaqdev
*
dev
)
struct
snd_usb_caiaqdev
*
dev
)
{
{
...
@@ -295,6 +325,10 @@ int __devinit snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *dev)
...
@@ -295,6 +325,10 @@ int __devinit snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *dev)
ret
=
add_controls
(
a8dj_controller
,
ret
=
add_controls
(
a8dj_controller
,
ARRAY_SIZE
(
a8dj_controller
),
dev
);
ARRAY_SIZE
(
a8dj_controller
),
dev
);
break
;
break
;
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO4DJ
):
ret
=
add_controls
(
a4dj_controller
,
ARRAY_SIZE
(
a4dj_controller
),
dev
);
break
;
}
}
return
ret
;
return
ret
;
...
...
sound/usb/caiaq/caiaq-device.c
浏览文件 @
c441c297
...
@@ -42,15 +42,17 @@
...
@@ -42,15 +42,17 @@
#endif
#endif
MODULE_AUTHOR
(
"Daniel Mack <daniel@caiaq.de>"
);
MODULE_AUTHOR
(
"Daniel Mack <daniel@caiaq.de>"
);
MODULE_DESCRIPTION
(
"caiaq USB audio, version 1.3.1
0
"
);
MODULE_DESCRIPTION
(
"caiaq USB audio, version 1.3.1
3
"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_SUPPORTED_DEVICE
(
"{{Native Instruments, RigKontrol2},"
MODULE_SUPPORTED_DEVICE
(
"{{Native Instruments, RigKontrol2},"
"{Native Instruments, RigKontrol3},"
"{Native Instruments, RigKontrol3},"
"{Native Instruments, Kore Controller},"
"{Native Instruments, Kore Controller},"
"{Native Instruments, Kore Controller 2},"
"{Native Instruments, Kore Controller 2},"
"{Native Instruments, Audio Kontrol 1},"
"{Native Instruments, Audio Kontrol 1},"
"{Native Instruments, Audio 4 DJ},"
"{Native Instruments, Audio 8 DJ},"
"{Native Instruments, Audio 8 DJ},"
"{Native Instruments, Session I/O}}"
);
"{Native Instruments, Session I/O},"
"{Native Instruments, GuitarRig mobile}"
);
static
int
index
[
SNDRV_CARDS
]
=
SNDRV_DEFAULT_IDX
;
/* Index 0-max */
static
int
index
[
SNDRV_CARDS
]
=
SNDRV_DEFAULT_IDX
;
/* Index 0-max */
static
char
*
id
[
SNDRV_CARDS
]
=
SNDRV_DEFAULT_STR
;
/* Id for this card */
static
char
*
id
[
SNDRV_CARDS
]
=
SNDRV_DEFAULT_STR
;
/* Id for this card */
...
@@ -116,6 +118,16 @@ static struct usb_device_id snd_usb_id_table[] = {
...
@@ -116,6 +118,16 @@ static struct usb_device_id snd_usb_id_table[] = {
.
idVendor
=
USB_VID_NATIVEINSTRUMENTS
,
.
idVendor
=
USB_VID_NATIVEINSTRUMENTS
,
.
idProduct
=
USB_PID_SESSIONIO
.
idProduct
=
USB_PID_SESSIONIO
},
},
{
.
match_flags
=
USB_DEVICE_ID_MATCH_DEVICE
,
.
idVendor
=
USB_VID_NATIVEINSTRUMENTS
,
.
idProduct
=
USB_PID_GUITARRIGMOBILE
},
{
.
match_flags
=
USB_DEVICE_ID_MATCH_DEVICE
,
.
idVendor
=
USB_VID_NATIVEINSTRUMENTS
,
.
idProduct
=
USB_PID_AUDIO4DJ
},
{
/* terminator */
}
{
/* terminator */
}
};
};
...
@@ -239,6 +251,8 @@ int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *dev,
...
@@ -239,6 +251,8 @@ int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *dev,
if
(
dev
->
audio_parm_answer
!=
1
)
if
(
dev
->
audio_parm_answer
!=
1
)
debug
(
"unable to set the device's audio params
\n
"
);
debug
(
"unable to set the device's audio params
\n
"
);
else
dev
->
bpp
=
bpp
;
return
dev
->
audio_parm_answer
==
1
?
0
:
-
EINVAL
;
return
dev
->
audio_parm_answer
==
1
?
0
:
-
EINVAL
;
}
}
...
@@ -300,6 +314,12 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
...
@@ -300,6 +314,12 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
}
}
break
;
break
;
case
USB_ID
(
USB_VID_NATIVEINSTRUMENTS
,
USB_PID_AUDIO4DJ
):
/* Audio 4 DJ - default input mode to phono */
dev
->
control_state
[
0
]
=
2
;
snd_usb_caiaq_send_command
(
dev
,
EP1_CMD_WRITE_IO
,
dev
->
control_state
,
1
);
break
;
}
}
if
(
dev
->
spec
.
num_analog_audio_out
+
if
(
dev
->
spec
.
num_analog_audio_out
+
...
...
sound/usb/caiaq/caiaq-device.h
浏览文件 @
c441c297
...
@@ -10,8 +10,10 @@
...
@@ -10,8 +10,10 @@
#define USB_PID_KORECONTROLLER 0x4711
#define USB_PID_KORECONTROLLER 0x4711
#define USB_PID_KORECONTROLLER2 0x4712
#define USB_PID_KORECONTROLLER2 0x4712
#define USB_PID_AK1 0x0815
#define USB_PID_AK1 0x0815
#define USB_PID_AUDIO4DJ 0x0839
#define USB_PID_AUDIO8DJ 0x1978
#define USB_PID_AUDIO8DJ 0x1978
#define USB_PID_SESSIONIO 0x1915
#define USB_PID_SESSIONIO 0x1915
#define USB_PID_GUITARRIGMOBILE 0x0d8d
#define EP1_BUFSIZE 64
#define EP1_BUFSIZE 64
#define CAIAQ_USB_STR_LEN 0xff
#define CAIAQ_USB_STR_LEN 0xff
...
@@ -87,9 +89,9 @@ struct snd_usb_caiaqdev {
...
@@ -87,9 +89,9 @@ struct snd_usb_caiaqdev {
int
audio_out_buf_pos
[
MAX_STREAMS
];
int
audio_out_buf_pos
[
MAX_STREAMS
];
int
period_in_count
[
MAX_STREAMS
];
int
period_in_count
[
MAX_STREAMS
];
int
period_out_count
[
MAX_STREAMS
];
int
period_out_count
[
MAX_STREAMS
];
int
input_panic
,
output_panic
;
int
input_panic
,
output_panic
,
warned
;
char
*
audio_in_buf
,
*
audio_out_buf
;
char
*
audio_in_buf
,
*
audio_out_buf
;
unsigned
int
samplerates
;
unsigned
int
samplerates
,
bpp
;
struct
snd_pcm_substream
*
sub_playback
[
MAX_STREAMS
];
struct
snd_pcm_substream
*
sub_playback
[
MAX_STREAMS
];
struct
snd_pcm_substream
*
sub_capture
[
MAX_STREAMS
];
struct
snd_pcm_substream
*
sub_capture
[
MAX_STREAMS
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录