30 #define VIDEOCODEC_VERSION "v0.2"
32 #include <linux/kernel.h>
33 #include <linux/module.h>
35 #include <linux/types.h>
36 #include <linux/slab.h>
43 #include <asm/uaccess.h>
52 #define dprintk(num, format, args...) \
55 printk(format, ##args); \
90 "videocodec_attach: '%s', flags %lx, magic %lx\n",
96 "videocodec_attach: no device available\n");
104 dprintk(4,
"videocodec_attach: try '%s'\n",
107 if (!try_module_get(h->
codec->owner))
115 "videocodec_attach: no mem\n");
122 res = codec->
setup(codec);
124 dprintk(3,
"videocodec_attach '%s'\n",
130 "videocodec_attach: no memory\n");
139 "videocodec: first element\n");
145 "videocodec: in after '%s'\n",
162 module_put(h->
codec->owner);
181 "videocodec_detach: '%s', type: %x, flags %lx, magic %lx\n",
186 KERN_ERR "videocodec_detach: no device left...\n");
194 if (codec == a->
codec) {
198 "videocodec_detach: '%s'\n",
204 "videocodec_detach: '%s'\n",
211 "videocodec: delete first\n");
215 "videocodec: delete middle\n");
217 module_put(a->
codec->owner);
244 "videocodec: register '%s', type: %x, flags %lx, magic %lx\n",
256 dprintk(4,
"videocodec: hooked in as first element\n");
261 dprintk(4,
"videocodec: hooked in after '%s'\n",
279 "videocodec: unregister '%s', type: %x, flags %lx, magic %lx\n",
285 "videocodec_unregister: no device left...\n");
290 if (codec == h->codec) {
294 "videocodec: '%s' is used\n",
298 dprintk(3,
"videocodec: unregister '%s' is ok.\n",
301 codeclist_top = h->
next;
303 "videocodec: delete first element\n");
305 prev->
next = h->next;
307 "videocodec: delete middle element\n");
318 "videocodec_unregister: given codec not found!\n");
322 #ifdef CONFIG_PROC_FS
323 static int proc_videocodecs_show(
struct seq_file *
m,
void *
v)
328 seq_printf(m,
"<S>lave or attached <M>aster name type flags magic ");
333 seq_printf(m,
"S %32s %04x %08lx %08lx (TEMPLATE)\n",
338 seq_printf(m,
"M %32s %04x %08lx %08lx (%s)\n",
339 a->
codec->master_data->name,
340 a->
codec->master_data->type,
341 a->
codec->master_data->flags,
342 a->
codec->master_data->magic,
359 .open = proc_videocodecs_open,
370 videocodec_init (
void)
372 #ifdef CONFIG_PROC_FS
379 #ifdef CONFIG_PROC_FS
380 videocodec_proc_entry = proc_create(
"videocodecs", 0,
NULL, &videocodecs_proc_fops);
381 if (!videocodec_proc_entry) {
389 videocodec_exit (
void)
391 #ifdef CONFIG_PROC_FS