~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/media/video/cx18/cx18-alsa.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  ALSA interface to cx18 PCM capture streams
 
3
 *
 
4
 *  Copyright (C) 2009  Andy Walls <awalls@md.metrocast.net>
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
19
 *  02111-1307  USA
 
20
 */
 
21
 
 
22
struct snd_card;
 
23
 
 
24
struct 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
 
 
33
extern int cx18_alsa_debug;
 
34
 
 
35
/*
 
36
 * File operations that manipulate the encoder or video or audio subdevices
 
37
 * need to be serialized.  Use the same lock we use for v4l2 file ops.
 
38
 */
 
39
static 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
 
 
45
static 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_WARN  (1 << 0)
 
53
#define CX18_ALSA_DBGFLG_INFO  (1 << 1)
 
54
 
 
55
#define CX18_ALSA_DEBUG(x, type, fmt, args...) \
 
56
        do { \
 
57
                if ((x) & cx18_alsa_debug) \
 
58
                        printk(KERN_INFO "%s-alsa: " type ": " fmt, \
 
59
                                v4l2_dev->name , ## args); \
 
60
        } while (0)
 
61
 
 
62
#define CX18_ALSA_DEBUG_WARN(fmt, args...) \
 
63
        CX18_ALSA_DEBUG(CX18_ALSA_DBGFLG_WARN, "warning", fmt , ## args)
 
64
 
 
65
#define CX18_ALSA_DEBUG_INFO(fmt, args...) \
 
66
        CX18_ALSA_DEBUG(CX18_ALSA_DBGFLG_INFO, "info", fmt , ## args)
 
67
 
 
68
#define CX18_ALSA_ERR(fmt, args...) \
 
69
        printk(KERN_ERR "%s-alsa: " fmt, v4l2_dev->name , ## args)
 
70
 
 
71
#define CX18_ALSA_WARN(fmt, args...) \
 
72
        printk(KERN_WARNING "%s-alsa: " fmt, v4l2_dev->name , ## args)
 
73
 
 
74
#define CX18_ALSA_INFO(fmt, args...) \
 
75
        printk(KERN_INFO "%s-alsa: " fmt, v4l2_dev->name , ## args)