Lines Matching +full:module +full:- +full:instance

1 // SPDX-License-Identifier: GPL-2.0-or-later
13 #include <linux/module.h>
18 #include <media/v4l2-device.h>
23 #include "cx18-driver.h"
24 #include "cx18-version.h"
25 #include "cx18-alsa.h"
26 #include "cx18-alsa-pcm.h"
33 printk(KERN_INFO "%s: " fmt, "cx18-alsa", ## arg); \
51 return to_cx18(v4l2_dev)->alsa; in to_snd_cx18_card()
59 if (cxsc->v4l2_dev != NULL) in snd_cx18_card_free()
60 to_cx18(cxsc->v4l2_dev)->alsa = NULL; in snd_cx18_card_free()
62 /* FIXME - take any other stopping actions needed */ in snd_cx18_card_free()
71 snd_cx18_card_free(sc->private_data); in snd_cx18_card_private_free()
72 sc->private_data = NULL; in snd_cx18_card_private_free()
73 sc->private_free = NULL; in snd_cx18_card_private_free()
82 return -ENOMEM; in snd_cx18_card_create()
84 (*cxsc)->v4l2_dev = v4l2_dev; in snd_cx18_card_create()
85 (*cxsc)->sc = sc; in snd_cx18_card_create()
87 sc->private_data = *cxsc; in snd_cx18_card_create()
88 sc->private_free = snd_cx18_card_private_free; in snd_cx18_card_create()
95 struct cx18 *cx = to_cx18(cxsc->v4l2_dev); in snd_cx18_card_set_names()
96 struct snd_card *sc = cxsc->sc; in snd_cx18_card_set_names()
98 /* sc->driver is used by alsa-lib's configurator: simple, unique */ in snd_cx18_card_set_names()
99 strscpy(sc->driver, "CX23418", sizeof(sc->driver)); in snd_cx18_card_set_names()
101 /* sc->shortname is a symlink in /proc/asound: CX18-M -> cardN */ in snd_cx18_card_set_names()
102 snprintf(sc->shortname, sizeof(sc->shortname), "CX18-%d", in snd_cx18_card_set_names()
103 cx->instance); in snd_cx18_card_set_names()
105 /* sc->longname is read from /proc/asound/cards */ in snd_cx18_card_set_names()
106 snprintf(sc->longname, sizeof(sc->longname), in snd_cx18_card_set_names()
107 "CX23418 #%d %s TV/FM Radio/Line-In Capture", in snd_cx18_card_set_names()
108 cx->instance, cx->card_name); in snd_cx18_card_set_names()
123 /* This is a no-op for us. We'll use the cx->instance */ in snd_cx18_init()
125 /* (2) Create a card instance */ in snd_cx18_init()
126 ret = snd_card_new(&cx->pci_dev->dev, in snd_cx18_init()
154 /* FIXME - proc files */ in snd_cx18_init()
158 cx->alsa = cxsc; in snd_cx18_init()
160 /* (6) Register the card instance */ in snd_cx18_init()
163 cx->alsa = NULL; in snd_cx18_init()
181 struct v4l2_device *v4l2_dev = &cx->v4l2_dev; in cx18_alsa_load()
185 printk(KERN_ERR "cx18-alsa: %s: struct v4l2_device * is NULL\n", in cx18_alsa_load()
192 printk(KERN_ERR "cx18-alsa cx is NULL\n"); in cx18_alsa_load()
196 s = &cx->streams[CX18_ENC_STREAM_TYPE_PCM]; in cx18_alsa_load()
197 if (s->video_dev.v4l2_dev == NULL) { in cx18_alsa_load()
198 CX18_DEBUG_ALSA_INFO("%s: PCM stream for card is disabled - skipping\n", in cx18_alsa_load()
203 if (cx->alsa != NULL) { in cx18_alsa_load()
213 CX18_DEBUG_ALSA_INFO("%s: created cx18 ALSA interface instance\n", in cx18_alsa_load()
221 printk(KERN_INFO "cx18-alsa: module loading...\n"); in cx18_alsa_init()
228 struct cx18 *cx = to_cx18(cxsc->v4l2_dev); in snd_cx18_exit()
230 /* FIXME - pointer checks & shutdown cxsc */ in snd_cx18_exit()
232 snd_card_free(cxsc->sc); in snd_cx18_exit()
233 cx->alsa = NULL; in snd_cx18_exit()
242 printk(KERN_ERR "cx18-alsa: %s: struct v4l2_device * is NULL\n", in cx18_alsa_exit_callback()
263 printk(KERN_INFO "cx18-alsa: module unloading...\n"); in cx18_alsa_exit()
270 printk(KERN_INFO "cx18-alsa: module unload complete\n"); in cx18_alsa_exit()