Skip to content

Commit 82fbb4f

Browse files
committed
ALSA: add DICE driver
As a start point for further development, this is an incomplete driver for DICE devices: - only playback (so no clock source except the bus clock) - only 44.1 kHz - no MIDI - recovery after bus reset is slow - hwdep device is created, but not actually implemented Contains compilation fixes by Stefan Richter. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
1 parent 6e46645 commit 82fbb4f

7 files changed

Lines changed: 1078 additions & 1 deletion

File tree

‎Documentation/ioctl/ioctl-number.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Code Seq#(hex) Include File Comments
138138
'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
139139
'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
140140
'H' F1 linux/hid-roccat.h <mailto:erazor_de@users.sourceforge.net>
141+
'H' F8-FA sound/firewire.h
141142
'I' all linux/isdn.h conflict!
142143
'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
143144
'I' 40-4F linux/mISDNif.h conflict!

‎include/uapi/sound/Kbuild‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ header-y += asound_fm.h
55
header-y += compress_offload.h
66
header-y += compress_params.h
77
header-y += emu10k1.h
8+
header-y += firewire.h
89
header-y += hdsp.h
910
header-y += hdspm.h
1011
header-y += sb16_csp.h

‎include/uapi/sound/asound.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ enum {
9393
SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
9494
SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
9595
SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
96+
SNDRV_HWDEP_IFACE_FW_DICE, /* TC DICE FireWire device */
9697

9798
/* Don't forget to change the following: */
98-
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
99+
SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_DICE
99100
};
100101

101102
struct snd_hwdep_info {

‎include/uapi/sound/firewire.h‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#ifndef UAPI_SOUND_FIREWIRE_H_INCLUDED
2+
#define UAPI_SOUND_FIREWIRE_H_INCLUDED
3+
4+
#include <linux/ioctl.h>
5+
6+
/* events can be read() from the hwdep device */
7+
8+
#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
9+
#define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
10+
11+
struct snd_firewire_event_common {
12+
unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
13+
};
14+
15+
struct snd_firewire_event_lock_status {
16+
unsigned int type;
17+
unsigned int status; /* 0/1 = unlocked/locked */
18+
};
19+
20+
struct snd_firewire_event_dice_notification {
21+
unsigned int type;
22+
unsigned int notification; /* DICE-specific bits */
23+
};
24+
25+
union snd_firewire_event {
26+
struct snd_firewire_event_common common;
27+
struct snd_firewire_event_lock_status lock_status;
28+
struct snd_firewire_event_dice_notification dice_notification;
29+
};
30+
31+
32+
#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
33+
#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
34+
#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
35+
36+
#define SNDRV_FIREWIRE_TYPE_DICE 1
37+
/* Fireworks, AV/C, RME, MOTU, ... */
38+
39+
struct snd_firewire_get_info {
40+
unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */
41+
unsigned int card; /* same as fw_cdev_get_info.card */
42+
unsigned char guid[8];
43+
char device_name[16]; /* device node in /dev */
44+
};
45+
46+
/*
47+
* SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming.
48+
* Returns -EBUSY if the driver is already streaming.
49+
*/
50+
51+
#endif

‎sound/firewire/Kconfig‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ config SND_FIREWIRE_LIB
1111
tristate
1212
depends on SND_PCM
1313

14+
config SND_DICE
15+
tristate "DICE devices (EXPERIMENTAL)"
16+
select SND_HWDEP
17+
select SND_PCM
18+
select SND_FIREWIRE_LIB
19+
help
20+
Say Y here to include support for many FireWire audio interfaces
21+
based on the DICE chip family (DICE-II/Jr/Mini) from TC Applied
22+
Technologies.
23+
24+
To compile this driver as a module, choose M here: the module
25+
will be called snd-dice.
26+
1427
config SND_FIREWIRE_SPEAKERS
1528
tristate "FireWire speakers"
1629
select SND_PCM

‎sound/firewire/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
snd-firewire-lib-objs := lib.o iso-resources.o packets-buffer.o \
22
fcp.o cmp.o amdtp.o
3+
snd-dice-objs := dice.o
34
snd-firewire-speakers-objs := speakers.o
45
snd-isight-objs := isight.o
56
snd-scs1x-objs := scs1x.o
67

78
obj-$(CONFIG_SND_FIREWIRE_LIB) += snd-firewire-lib.o
9+
obj-$(CONFIG_SND_DICE) += snd-dice.o
810
obj-$(CONFIG_SND_FIREWIRE_SPEAKERS) += snd-firewire-speakers.o
911
obj-$(CONFIG_SND_ISIGHT) += snd-isight.o
1012
obj-$(CONFIG_SND_SCS1X) += snd-scs1x.o

0 commit comments

Comments
 (0)