1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22struct snd_card;
23
24struct snd_cx18_card {
25 struct v4l2_device *v4l2_dev;
26 struct snd_card *sc;
27 unsigned int capture_transfer_done;
28 unsigned int hwptr_done_capture;
29 struct snd_pcm_substream *capture_pcm_substream;
30 spinlock_t slock;
31};
32
33extern int cx18_alsa_debug;
34
35
36
37
38
39static inline void snd_cx18_lock(struct snd_cx18_card *cxsc)
40{
41 struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
42 mutex_lock(&cx->serialize_lock);
43}
44
45static inline void snd_cx18_unlock(struct snd_cx18_card *cxsc)
46{
47 struct cx18 *cx = to_cx18(cxsc->v4l2_dev);
48 mutex_unlock(&cx->serialize_lock);
49}
50
51#define CX18_ALSA_DBGFLG_WARN (1 << 0)
52#define CX18_ALSA_DBGFLG_INFO (1 << 1)
53
54#define CX18_ALSA_DEBUG(x, type, fmt, args...) \
55 do { \
56 if ((x) & cx18_alsa_debug) \
57 printk(KERN_INFO "%s-alsa: " type ": " fmt, \
58 v4l2_dev->name , ## args); \
59 } while (0)
60
61#define CX18_ALSA_DEBUG_WARN(fmt, args...) \
62 CX18_ALSA_DEBUG(CX18_ALSA_DBGFLG_WARN, "warning", fmt , ## args)
63
64#define CX18_ALSA_DEBUG_INFO(fmt, args...) \
65 CX18_ALSA_DEBUG(CX18_ALSA_DBGFLG_INFO, "info", fmt , ## args)
66
67#define CX18_ALSA_ERR(fmt, args...) \
68 printk(KERN_ERR "%s-alsa: " fmt, v4l2_dev->name , ## args)
69
70#define CX18_ALSA_WARN(fmt, args...) \
71 printk(KERN_WARNING "%s-alsa: " fmt, v4l2_dev->name , ## args)
72
73#define CX18_ALSA_INFO(fmt, args...) \
74 printk(KERN_INFO "%s-alsa: " fmt, v4l2_dev->name , ## args)
75