Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181553
b: refs/heads/master
c: 4cb565c
h: refs/heads/master
i:
  181551: 95d7ea4
v: v3
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent b7afc05 commit b719a9b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d8e1d0637a4636b0c19c94ba633812421544d91
refs/heads/master: 4cb565cc2700e6fcd57243cacc4c2826956bc088
26 changes: 19 additions & 7 deletions trunk/drivers/media/video/cx18/cx18-alsa-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* ALSA interface to cx18 PCM capture streams
*
* Copyright (C) 2009 Andy Walls <awalls@radix.net>
* Copyright (C) 2009 Devin Heitmueller <dheitmueller@kernellabs.com>
*
* Portions of this work were sponsored by ONELAN Limited.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,11 +34,15 @@
#include <sound/initval.h>

#include "cx18-driver.h"
#include "cx18-version.h"
#include "cx18-alsa.h"
#include "cx18-alsa-mixer.h"
#include "cx18-alsa-pcm.h"

int cx18_alsa_debug;

#define CX18_DEBUG_ALSA_INFO(fmt, arg...) printk(KERN_INFO "%s: " fmt, "cx18-alsa", ## arg)

module_param_named(debug, cx18_alsa_debug, int, 0644);
MODULE_PARM_DESC(debug,
"Debug level (bitmask). Default: 0\n"
Expand Down Expand Up @@ -116,6 +123,8 @@ static int __init snd_cx18_card_set_names(struct snd_cx18_card *cxsc)
snprintf(sc->longname, sizeof(sc->longname),
"CX23418 #%d %s TV/FM Radio/Line-In Capture",
cx->instance, cx->card_name);

return 0;
}

static int __init snd_cx18_init(struct v4l2_device *v4l2_dev)
Expand Down Expand Up @@ -151,12 +160,6 @@ static int __init snd_cx18_init(struct v4l2_device *v4l2_dev)
/* (4) Set the driver ID and name strings */
snd_cx18_card_set_names(cxsc);

/* (5) Create other components: mixer, PCM, & proc files */
ret = snd_cx18_mixer_create(cxsc);
if (ret) {
CX18_ALSA_WARN("%s: snd_cx18_mixer_create() failed with err %d:"
"proceeding anyway\n", __func__, ret);
}

ret = snd_cx18_pcm_create(cxsc);
if (ret) {
Expand Down Expand Up @@ -201,6 +204,11 @@ static int __init cx18_alsa_init_callback(struct device *dev, void *data)
}

cx = to_cx18(v4l2_dev);
if (cx == NULL) {
printk(KERN_ERR "cx18-alsa cx is NULL\n");
return 0;
}

s = &cx->streams[CX18_ENC_STREAM_TYPE_PCM];
if (s->video_dev == NULL) {
CX18_DEBUG_ALSA_INFO("%s: PCM stream for card is disabled - "
Expand Down Expand Up @@ -234,6 +242,10 @@ static int __init cx18_alsa_init(void)
printk(KERN_INFO "cx18-alsa: module loading...\n");

drv = driver_find("cx18", &pci_bus_type);
if (drv == NULL) {
printk("cx18-alsa: drv was null\n");
return -ENODEV;
}
ret = driver_for_each_device(drv, NULL, &count,
cx18_alsa_init_callback);
put_driver(drv);
Expand All @@ -254,7 +266,7 @@ static int __init cx18_alsa_init(void)

static void snd_cx18_exit(struct snd_cx18_card *cxsc)
{
struct cx18 *cx = to_cx18(cxsc->4l2_dev);
struct cx18 *cx = to_cx18(cxsc->v4l2_dev);

/* FIXME - pointer checks & shutdown cxsc */

Expand Down

0 comments on commit b719a9b

Please sign in to comment.