aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-06-24 06:26:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:42 -0500
commitf9b071c77ad3b97fce3d598d2d417c097369ccaf (patch)
tree562d66e3553aed148cafea26dff698c03a40d7d1 /drivers/media/video/cx18
parent9722c8f95a5bd51a3d392cb2f125c8240b745c48 (diff)
V4L/DVB: cx18-alsa: Add non-working cx18-alsa-pcm.[ch] files to avoid data loss
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r--drivers/media/video/cx18/cx18-alsa-pcm.c115
-rw-r--r--drivers/media/video/cx18/cx18-alsa-pcm.h23
2 files changed, 138 insertions, 0 deletions
diff --git a/drivers/media/video/cx18/cx18-alsa-pcm.c b/drivers/media/video/cx18/cx18-alsa-pcm.c
new file mode 100644
index 000000000000..e3157cec5ac3
--- /dev/null
+++ b/drivers/media/video/cx18/cx18-alsa-pcm.c
@@ -0,0 +1,115 @@
1/*
2 * ALSA PCM device for the
3 * ALSA interface to cx18 PCM capture streams
4 *
5 * Copyright (C) 2009 Andy Walls <awalls@radix.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 * 02111-1307 USA
21 */
22
23#include <linux/init.h>
24#include <linux/kernel.h>
25
26#include <media/v4l2-device.h>
27
28#include <sound/core.h>
29#include <sound/pcm.h>
30
31#include "cx18-driver.h"
32#include "cx18-alsa.h"
33
34static int snd_cx18_pcm_capture_open(struct snd_pcm_substream *substream)
35{
36 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream);
37 struct snd_pcm_runtime *runtime = substream->runtime;
38 struct v4l2_device *v4l2_dev = cxsc->v4l2_dev;
39 struct snd_card *sc = cxsc->sc;
40 struct cx18 *cx = to_cx18(v4l2_dev);
41 return 0;
42}
43
44static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream)
45{
46 return 0;
47}
48
49static int snd_cx18_pcm_ioctl(struct snd_pcm_substream *substream,
50 unsigned int cmd, void *arg)
51{
52 return snd_pcm_lib_ioctl(substream, cmd, arg);
53}
54
55static int snd_cx18_pcm_hw_params(struct snd_pcm_substream *substream,
56 struct snd_pcm_hw_params *params)
57{
58 return 0;
59}
60
61static int snd_cx18_pcm_hw_free(struct snd_pcm_substream *substream)
62{
63 return 0;
64}
65
66static int snd_cx18_pcm_prepare(struct snd_pcm_substream *substream)
67{
68 return 0;
69}
70
71static int snd_cx18_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
72{
73 return 0;
74}
75
76static
77snd_pcm_uframes_t snd_cx18_pcm_pointer(struct snd_pcm_substream *substream)
78{
79 return 0;
80}
81
82static struct snd_pcm_ops snd_cx18_pcm_capture_ops = {
83 .open = snd_cx18_pcm_capture_open,
84 .close = snd_cx18_pcm_capture_close,
85 .ioctl = snd_cx18_pcm_ioctl,
86 .hw_params = snd_cx18_pcm_hw_params,
87 .hw_free = snd_cx18_pcm_hw_free,
88 .prepare = snd_cx18_pcm_prepare,
89 .trigger = snd_cx18_pcm_trigger,
90 .pointer = snd_cx18_pcm_pointer,
91};
92
93int __init snd_cx18_pcm_create(struct snd_cx18_card *cxsc)
94{
95 struct snd_pcm *sp;
96 struct snd_card *sc = cxsc->sc;
97 struct v4l2_device *v4l2_dev = cxsc->v4l2_dev;
98 struct cx18 *cx = to_cx18(v4l2_dev);
99 int ret;
100
101 ret = snd_pcm_new(sc, "CX23418 PCM",
102 0, /* PCM device 0, the only one for this card */
103 0, /* 0 playback substreams */
104 1, /* 1 capture substream */
105 &sp);
106 if (ret) {
107 CX18_ALSA_ERR("%s: snd_cx18_pcm_create() failed with err %d\n",
108 __func__, ret);
109 goto err_exit;
110 }
111 return 0;
112
113err_exit:
114 return ret;
115}
diff --git a/drivers/media/video/cx18/cx18-alsa-pcm.h b/drivers/media/video/cx18/cx18-alsa-pcm.h
new file mode 100644
index 000000000000..ff47a1ebe800
--- /dev/null
+++ b/drivers/media/video/cx18/cx18-alsa-pcm.h
@@ -0,0 +1,23 @@
1/*
2 * ALSA PCM device for the
3 * ALSA interface to cx18 PCM capture streams
4 *
5 * Copyright (C) 2009 Andy Walls <awalls@radix.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 * 02111-1307 USA
21 */
22
23int __init snd_cx18_pcm_create(struct snd_cx18_card *cxsc);