1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18struct snd_card;
19
20struct snd_ivtv_card {
21 struct v4l2_device *v4l2_dev;
22 struct snd_card *sc;
23 unsigned int capture_transfer_done;
24 unsigned int hwptr_done_capture;
25 struct snd_pcm_substream *capture_pcm_substream;
26 spinlock_t slock;
27};
28
29extern int ivtv_alsa_debug;
30
31
32
33
34
35static inline void snd_ivtv_lock(struct snd_ivtv_card *itvsc)
36{
37 struct ivtv *itv = to_ivtv(itvsc->v4l2_dev);
38 mutex_lock(&itv->serialize_lock);
39}
40
41static inline void snd_ivtv_unlock(struct snd_ivtv_card *itvsc)
42{
43 struct ivtv *itv = to_ivtv(itvsc->v4l2_dev);
44 mutex_unlock(&itv->serialize_lock);
45}
46
47#define IVTV_ALSA_DBGFLG_WARN (1 << 0)
48#define IVTV_ALSA_DBGFLG_INFO (1 << 1)
49
50#define IVTV_ALSA_DEBUG(x, type, fmt, args...) \
51 do { \
52 if ((x) & ivtv_alsa_debug) \
53 pr_info("%s-alsa: " type ": " fmt, \
54 v4l2_dev->name , ## args); \
55 } while (0)
56
57#define IVTV_ALSA_DEBUG_WARN(fmt, args...) \
58 IVTV_ALSA_DEBUG(IVTV_ALSA_DBGFLG_WARN, "warning", fmt , ## args)
59
60#define IVTV_ALSA_DEBUG_INFO(fmt, args...) \
61 IVTV_ALSA_DEBUG(IVTV_ALSA_DBGFLG_INFO, "info", fmt , ## args)
62
63#define IVTV_ALSA_ERR(fmt, args...) \
64 pr_err("%s-alsa: " fmt, v4l2_dev->name , ## args)
65
66#define IVTV_ALSA_WARN(fmt, args...) \
67 pr_warn("%s-alsa: " fmt, v4l2_dev->name , ## args)
68
69#define IVTV_ALSA_INFO(fmt, args...) \
70 pr_info("%s-alsa: " fmt, v4l2_dev->name , ## args)
71