Merge branch 'v6v7' into devel
[linux/fpc-iii.git] / drivers / media / video / cx231xx / cx231xx-audio.c
blob30d13c15739a7d32a3a66636f90cb9aa4edde2df
1 /*
2 * Conexant Cx231xx audio extension
4 * Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
5 * Based on em28xx driver
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <linux/kernel.h>
24 #include <linux/usb.h>
25 #include <linux/init.h>
26 #include <linux/sound.h>
27 #include <linux/spinlock.h>
28 #include <linux/soundcard.h>
29 #include <linux/slab.h>
30 #include <linux/vmalloc.h>
31 #include <linux/proc_fs.h>
32 #include <linux/module.h>
33 #include <sound/core.h>
34 #include <sound/pcm.h>
35 #include <sound/pcm_params.h>
36 #include <sound/info.h>
37 #include <sound/initval.h>
38 #include <sound/control.h>
39 #include <media/v4l2-common.h>
40 #include "cx231xx.h"
42 static int debug;
43 module_param(debug, int, 0644);
44 MODULE_PARM_DESC(debug, "activates debug info");
46 #define dprintk(fmt, arg...) do { \
47 if (debug) \
48 printk(KERN_INFO "cx231xx-audio %s: " fmt, \
49 __func__, ##arg); \
50 } while (0)
52 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
54 static int cx231xx_isoc_audio_deinit(struct cx231xx *dev)
56 int i;
58 dprintk("Stopping isoc\n");
60 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
61 if (dev->adev.urb[i]) {
62 if (!irqs_disabled())
63 usb_kill_urb(dev->adev.urb[i]);
64 else
65 usb_unlink_urb(dev->adev.urb[i]);
67 usb_free_urb(dev->adev.urb[i]);
68 dev->adev.urb[i] = NULL;
70 kfree(dev->adev.transfer_buffer[i]);
71 dev->adev.transfer_buffer[i] = NULL;
75 return 0;
78 static int cx231xx_bulk_audio_deinit(struct cx231xx *dev)
80 int i;
82 dprintk("Stopping bulk\n");
84 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
85 if (dev->adev.urb[i]) {
86 if (!irqs_disabled())
87 usb_kill_urb(dev->adev.urb[i]);
88 else
89 usb_unlink_urb(dev->adev.urb[i]);
91 usb_free_urb(dev->adev.urb[i]);
92 dev->adev.urb[i] = NULL;
94 kfree(dev->adev.transfer_buffer[i]);
95 dev->adev.transfer_buffer[i] = NULL;
99 return 0;
102 static void cx231xx_audio_isocirq(struct urb *urb)
104 struct cx231xx *dev = urb->context;
105 int i;
106 unsigned int oldptr;
107 int period_elapsed = 0;
108 int status;
109 unsigned char *cp;
110 unsigned int stride;
111 struct snd_pcm_substream *substream;
112 struct snd_pcm_runtime *runtime;
114 switch (urb->status) {
115 case 0: /* success */
116 case -ETIMEDOUT: /* NAK */
117 break;
118 case -ECONNRESET: /* kill */
119 case -ENOENT:
120 case -ESHUTDOWN:
121 return;
122 default: /* error */
123 dprintk("urb completition error %d.\n", urb->status);
124 break;
127 if (atomic_read(&dev->stream_started) == 0)
128 return;
130 if (dev->adev.capture_pcm_substream) {
131 substream = dev->adev.capture_pcm_substream;
132 runtime = substream->runtime;
133 stride = runtime->frame_bits >> 3;
135 for (i = 0; i < urb->number_of_packets; i++) {
136 int length = urb->iso_frame_desc[i].actual_length /
137 stride;
138 cp = (unsigned char *)urb->transfer_buffer +
139 urb->iso_frame_desc[i].offset;
141 if (!length)
142 continue;
144 oldptr = dev->adev.hwptr_done_capture;
145 if (oldptr + length >= runtime->buffer_size) {
146 unsigned int cnt;
148 cnt = runtime->buffer_size - oldptr;
149 memcpy(runtime->dma_area + oldptr * stride, cp,
150 cnt * stride);
151 memcpy(runtime->dma_area, cp + cnt * stride,
152 length * stride - cnt * stride);
153 } else {
154 memcpy(runtime->dma_area + oldptr * stride, cp,
155 length * stride);
158 snd_pcm_stream_lock(substream);
160 dev->adev.hwptr_done_capture += length;
161 if (dev->adev.hwptr_done_capture >=
162 runtime->buffer_size)
163 dev->adev.hwptr_done_capture -=
164 runtime->buffer_size;
166 dev->adev.capture_transfer_done += length;
167 if (dev->adev.capture_transfer_done >=
168 runtime->period_size) {
169 dev->adev.capture_transfer_done -=
170 runtime->period_size;
171 period_elapsed = 1;
173 snd_pcm_stream_unlock(substream);
175 if (period_elapsed)
176 snd_pcm_period_elapsed(substream);
178 urb->status = 0;
180 status = usb_submit_urb(urb, GFP_ATOMIC);
181 if (status < 0) {
182 cx231xx_errdev("resubmit of audio urb failed (error=%i)\n",
183 status);
185 return;
188 static void cx231xx_audio_bulkirq(struct urb *urb)
190 struct cx231xx *dev = urb->context;
191 unsigned int oldptr;
192 int period_elapsed = 0;
193 int status;
194 unsigned char *cp;
195 unsigned int stride;
196 struct snd_pcm_substream *substream;
197 struct snd_pcm_runtime *runtime;
199 switch (urb->status) {
200 case 0: /* success */
201 case -ETIMEDOUT: /* NAK */
202 break;
203 case -ECONNRESET: /* kill */
204 case -ENOENT:
205 case -ESHUTDOWN:
206 return;
207 default: /* error */
208 dprintk("urb completition error %d.\n", urb->status);
209 break;
212 if (atomic_read(&dev->stream_started) == 0)
213 return;
215 if (dev->adev.capture_pcm_substream) {
216 substream = dev->adev.capture_pcm_substream;
217 runtime = substream->runtime;
218 stride = runtime->frame_bits >> 3;
220 if (1) {
221 int length = urb->actual_length /
222 stride;
223 cp = (unsigned char *)urb->transfer_buffer;
225 oldptr = dev->adev.hwptr_done_capture;
226 if (oldptr + length >= runtime->buffer_size) {
227 unsigned int cnt;
229 cnt = runtime->buffer_size - oldptr;
230 memcpy(runtime->dma_area + oldptr * stride, cp,
231 cnt * stride);
232 memcpy(runtime->dma_area, cp + cnt * stride,
233 length * stride - cnt * stride);
234 } else {
235 memcpy(runtime->dma_area + oldptr * stride, cp,
236 length * stride);
239 snd_pcm_stream_lock(substream);
241 dev->adev.hwptr_done_capture += length;
242 if (dev->adev.hwptr_done_capture >=
243 runtime->buffer_size)
244 dev->adev.hwptr_done_capture -=
245 runtime->buffer_size;
247 dev->adev.capture_transfer_done += length;
248 if (dev->adev.capture_transfer_done >=
249 runtime->period_size) {
250 dev->adev.capture_transfer_done -=
251 runtime->period_size;
252 period_elapsed = 1;
254 snd_pcm_stream_unlock(substream);
256 if (period_elapsed)
257 snd_pcm_period_elapsed(substream);
259 urb->status = 0;
261 status = usb_submit_urb(urb, GFP_ATOMIC);
262 if (status < 0) {
263 cx231xx_errdev("resubmit of audio urb failed (error=%i)\n",
264 status);
266 return;
269 static int cx231xx_init_audio_isoc(struct cx231xx *dev)
271 int i, errCode;
272 int sb_size;
274 cx231xx_info("%s: Starting ISO AUDIO transfers\n", __func__);
276 sb_size = CX231XX_ISO_NUM_AUDIO_PACKETS * dev->adev.max_pkt_size;
278 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
279 struct urb *urb;
280 int j, k;
282 dev->adev.transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC);
283 if (!dev->adev.transfer_buffer[i])
284 return -ENOMEM;
286 memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
287 urb = usb_alloc_urb(CX231XX_ISO_NUM_AUDIO_PACKETS, GFP_ATOMIC);
288 if (!urb) {
289 cx231xx_errdev("usb_alloc_urb failed!\n");
290 for (j = 0; j < i; j++) {
291 usb_free_urb(dev->adev.urb[j]);
292 kfree(dev->adev.transfer_buffer[j]);
294 return -ENOMEM;
297 urb->dev = dev->udev;
298 urb->context = dev;
299 urb->pipe = usb_rcvisocpipe(dev->udev,
300 dev->adev.end_point_addr);
301 urb->transfer_flags = URB_ISO_ASAP;
302 urb->transfer_buffer = dev->adev.transfer_buffer[i];
303 urb->interval = 1;
304 urb->complete = cx231xx_audio_isocirq;
305 urb->number_of_packets = CX231XX_ISO_NUM_AUDIO_PACKETS;
306 urb->transfer_buffer_length = sb_size;
308 for (j = k = 0; j < CX231XX_ISO_NUM_AUDIO_PACKETS;
309 j++, k += dev->adev.max_pkt_size) {
310 urb->iso_frame_desc[j].offset = k;
311 urb->iso_frame_desc[j].length = dev->adev.max_pkt_size;
313 dev->adev.urb[i] = urb;
316 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
317 errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
318 if (errCode < 0) {
319 cx231xx_isoc_audio_deinit(dev);
320 return errCode;
324 return errCode;
327 static int cx231xx_init_audio_bulk(struct cx231xx *dev)
329 int i, errCode;
330 int sb_size;
332 cx231xx_info("%s: Starting BULK AUDIO transfers\n", __func__);
334 sb_size = CX231XX_NUM_AUDIO_PACKETS * dev->adev.max_pkt_size;
336 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
337 struct urb *urb;
338 int j;
340 dev->adev.transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC);
341 if (!dev->adev.transfer_buffer[i])
342 return -ENOMEM;
344 memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
345 urb = usb_alloc_urb(CX231XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
346 if (!urb) {
347 cx231xx_errdev("usb_alloc_urb failed!\n");
348 for (j = 0; j < i; j++) {
349 usb_free_urb(dev->adev.urb[j]);
350 kfree(dev->adev.transfer_buffer[j]);
352 return -ENOMEM;
355 urb->dev = dev->udev;
356 urb->context = dev;
357 urb->pipe = usb_rcvbulkpipe(dev->udev,
358 dev->adev.end_point_addr);
359 urb->transfer_flags = 0;
360 urb->transfer_buffer = dev->adev.transfer_buffer[i];
361 urb->complete = cx231xx_audio_bulkirq;
362 urb->transfer_buffer_length = sb_size;
364 dev->adev.urb[i] = urb;
368 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
369 errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
370 if (errCode < 0) {
371 cx231xx_bulk_audio_deinit(dev);
372 return errCode;
376 return errCode;
379 static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
380 size_t size)
382 struct snd_pcm_runtime *runtime = subs->runtime;
384 dprintk("Allocating vbuffer\n");
385 if (runtime->dma_area) {
386 if (runtime->dma_bytes > size)
387 return 0;
389 vfree(runtime->dma_area);
391 runtime->dma_area = vmalloc(size);
392 if (!runtime->dma_area)
393 return -ENOMEM;
395 runtime->dma_bytes = size;
397 return 0;
400 static struct snd_pcm_hardware snd_cx231xx_hw_capture = {
401 .info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
402 SNDRV_PCM_INFO_MMAP |
403 SNDRV_PCM_INFO_INTERLEAVED |
404 SNDRV_PCM_INFO_MMAP_VALID,
406 .formats = SNDRV_PCM_FMTBIT_S16_LE,
408 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT,
410 .rate_min = 48000,
411 .rate_max = 48000,
412 .channels_min = 2,
413 .channels_max = 2,
414 .buffer_bytes_max = 62720 * 8, /* just about the value in usbaudio.c */
415 .period_bytes_min = 64, /* 12544/2, */
416 .period_bytes_max = 12544,
417 .periods_min = 2,
418 .periods_max = 98, /* 12544, */
421 static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
423 struct cx231xx *dev = snd_pcm_substream_chip(substream);
424 struct snd_pcm_runtime *runtime = substream->runtime;
425 int ret = 0;
427 dprintk("opening device and trying to acquire exclusive lock\n");
429 if (!dev) {
430 cx231xx_errdev("BUG: cx231xx can't find device struct."
431 " Can't proceed with open\n");
432 return -ENODEV;
435 /* Sets volume, mute, etc */
436 dev->mute = 0;
438 /* set alternate setting for audio interface */
439 /* 1 - 48000 samples per sec */
440 mutex_lock(&dev->lock);
441 if (dev->USE_ISO)
442 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 1);
443 else
444 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
445 mutex_unlock(&dev->lock);
446 if (ret < 0) {
447 cx231xx_errdev("failed to set alternate setting !\n");
449 return ret;
452 runtime->hw = snd_cx231xx_hw_capture;
454 mutex_lock(&dev->lock);
455 /* inform hardware to start streaming */
456 ret = cx231xx_capture_start(dev, 1, Audio);
458 dev->adev.users++;
459 mutex_unlock(&dev->lock);
461 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
462 dev->adev.capture_pcm_substream = substream;
463 runtime->private_data = dev;
465 return 0;
468 static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
470 int ret;
471 struct cx231xx *dev = snd_pcm_substream_chip(substream);
473 dprintk("closing device\n");
475 /* inform hardware to stop streaming */
476 mutex_lock(&dev->lock);
477 ret = cx231xx_capture_start(dev, 0, Audio);
479 /* set alternate setting for audio interface */
480 /* 1 - 48000 samples per sec */
481 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
482 if (ret < 0) {
483 cx231xx_errdev("failed to set alternate setting !\n");
485 mutex_unlock(&dev->lock);
486 return ret;
489 dev->mute = 1;
490 dev->adev.users--;
491 mutex_unlock(&dev->lock);
493 if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
494 dprintk("audio users: %d\n", dev->adev.users);
495 dprintk("disabling audio stream!\n");
496 dev->adev.shutdown = 0;
497 dprintk("released lock\n");
498 if (atomic_read(&dev->stream_started) > 0) {
499 atomic_set(&dev->stream_started, 0);
500 schedule_work(&dev->wq_trigger);
503 return 0;
506 static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream,
507 struct snd_pcm_hw_params *hw_params)
509 unsigned int channels, rate, format;
510 int ret;
512 dprintk("Setting capture parameters\n");
514 ret = snd_pcm_alloc_vmalloc_buffer(substream,
515 params_buffer_bytes(hw_params));
516 format = params_format(hw_params);
517 rate = params_rate(hw_params);
518 channels = params_channels(hw_params);
520 /* TODO: set up cx231xx audio chip to deliver the correct audio format,
521 current default is 48000hz multiplexed => 96000hz mono
522 which shouldn't matter since analogue TV only supports mono */
523 return 0;
526 static int snd_cx231xx_hw_capture_free(struct snd_pcm_substream *substream)
528 struct cx231xx *dev = snd_pcm_substream_chip(substream);
530 dprintk("Stop capture, if needed\n");
532 if (atomic_read(&dev->stream_started) > 0) {
533 atomic_set(&dev->stream_started, 0);
534 schedule_work(&dev->wq_trigger);
537 return 0;
540 static int snd_cx231xx_prepare(struct snd_pcm_substream *substream)
542 struct cx231xx *dev = snd_pcm_substream_chip(substream);
544 dev->adev.hwptr_done_capture = 0;
545 dev->adev.capture_transfer_done = 0;
547 return 0;
550 static void audio_trigger(struct work_struct *work)
552 struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger);
554 if (atomic_read(&dev->stream_started)) {
555 dprintk("starting capture");
556 if (is_fw_load(dev) == 0)
557 cx25840_call(dev, core, load_fw);
558 if (dev->USE_ISO)
559 cx231xx_init_audio_isoc(dev);
560 else
561 cx231xx_init_audio_bulk(dev);
562 } else {
563 dprintk("stopping capture");
564 cx231xx_isoc_audio_deinit(dev);
568 static int snd_cx231xx_capture_trigger(struct snd_pcm_substream *substream,
569 int cmd)
571 struct cx231xx *dev = snd_pcm_substream_chip(substream);
572 int retval;
574 spin_lock(&dev->adev.slock);
575 switch (cmd) {
576 case SNDRV_PCM_TRIGGER_START:
577 atomic_set(&dev->stream_started, 1);
578 break;
579 case SNDRV_PCM_TRIGGER_STOP:
580 atomic_set(&dev->stream_started, 0);
581 break;
582 default:
583 retval = -EINVAL;
585 spin_unlock(&dev->adev.slock);
587 schedule_work(&dev->wq_trigger);
589 return 0;
592 static snd_pcm_uframes_t snd_cx231xx_capture_pointer(struct snd_pcm_substream
593 *substream)
595 struct cx231xx *dev;
596 unsigned long flags;
597 snd_pcm_uframes_t hwptr_done;
599 dev = snd_pcm_substream_chip(substream);
601 spin_lock_irqsave(&dev->adev.slock, flags);
602 hwptr_done = dev->adev.hwptr_done_capture;
603 spin_unlock_irqrestore(&dev->adev.slock, flags);
605 return hwptr_done;
608 static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
609 unsigned long offset)
611 void *pageptr = subs->runtime->dma_area + offset;
613 return vmalloc_to_page(pageptr);
616 static struct snd_pcm_ops snd_cx231xx_pcm_capture = {
617 .open = snd_cx231xx_capture_open,
618 .close = snd_cx231xx_pcm_close,
619 .ioctl = snd_pcm_lib_ioctl,
620 .hw_params = snd_cx231xx_hw_capture_params,
621 .hw_free = snd_cx231xx_hw_capture_free,
622 .prepare = snd_cx231xx_prepare,
623 .trigger = snd_cx231xx_capture_trigger,
624 .pointer = snd_cx231xx_capture_pointer,
625 .page = snd_pcm_get_vmalloc_page,
628 static int cx231xx_audio_init(struct cx231xx *dev)
630 struct cx231xx_audio *adev = &dev->adev;
631 struct snd_pcm *pcm;
632 struct snd_card *card;
633 static int devnr;
634 int err;
635 struct usb_interface *uif;
636 int i, isoc_pipe = 0;
638 if (dev->has_alsa_audio != 1) {
639 /* This device does not support the extension (in this case
640 the device is expecting the snd-usb-audio module or
641 doesn't have analog audio support at all) */
642 return 0;
645 cx231xx_info("cx231xx-audio.c: probing for cx231xx "
646 "non standard usbaudio\n");
648 err = snd_card_create(index[devnr], "Cx231xx Audio", THIS_MODULE,
649 0, &card);
650 if (err < 0)
651 return err;
653 spin_lock_init(&adev->slock);
654 err = snd_pcm_new(card, "Cx231xx Audio", 0, 0, 1, &pcm);
655 if (err < 0) {
656 snd_card_free(card);
657 return err;
660 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
661 &snd_cx231xx_pcm_capture);
662 pcm->info_flags = 0;
663 pcm->private_data = dev;
664 strcpy(pcm->name, "Conexant cx231xx Capture");
665 snd_card_set_dev(card, &dev->udev->dev);
666 strcpy(card->driver, "Cx231xx-Audio");
667 strcpy(card->shortname, "Cx231xx Audio");
668 strcpy(card->longname, "Conexant cx231xx Audio");
670 INIT_WORK(&dev->wq_trigger, audio_trigger);
672 err = snd_card_register(card);
673 if (err < 0) {
674 snd_card_free(card);
675 return err;
677 adev->sndcard = card;
678 adev->udev = dev->udev;
680 /* compute alternate max packet sizes for Audio */
681 uif =
682 dev->udev->actconfig->interface[dev->current_pcb_config.
683 hs_config_info[0].interface_info.
684 audio_index + 1];
686 adev->end_point_addr =
687 le16_to_cpu(uif->altsetting[0].endpoint[isoc_pipe].desc.
688 bEndpointAddress);
690 adev->num_alt = uif->num_altsetting;
691 cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
692 adev->end_point_addr, adev->num_alt);
693 adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL);
695 if (adev->alt_max_pkt_size == NULL) {
696 cx231xx_errdev("out of memory!\n");
697 return -ENOMEM;
700 for (i = 0; i < adev->num_alt; i++) {
701 u16 tmp =
702 le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.
703 wMaxPacketSize);
704 adev->alt_max_pkt_size[i] =
705 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
706 cx231xx_info("Alternate setting %i, max size= %i\n", i,
707 adev->alt_max_pkt_size[i]);
710 return 0;
713 static int cx231xx_audio_fini(struct cx231xx *dev)
715 if (dev == NULL)
716 return 0;
718 if (dev->has_alsa_audio != 1) {
719 /* This device does not support the extension (in this case
720 the device is expecting the snd-usb-audio module or
721 doesn't have analog audio support at all) */
722 return 0;
725 if (dev->adev.sndcard) {
726 snd_card_free(dev->adev.sndcard);
727 kfree(dev->adev.alt_max_pkt_size);
728 dev->adev.sndcard = NULL;
731 return 0;
734 static struct cx231xx_ops audio_ops = {
735 .id = CX231XX_AUDIO,
736 .name = "Cx231xx Audio Extension",
737 .init = cx231xx_audio_init,
738 .fini = cx231xx_audio_fini,
741 static int __init cx231xx_alsa_register(void)
743 return cx231xx_register_extension(&audio_ops);
746 static void __exit cx231xx_alsa_unregister(void)
748 cx231xx_unregister_extension(&audio_ops);
751 MODULE_LICENSE("GPL");
752 MODULE_AUTHOR("Srinivasa Deevi <srinivasa.deevi@conexant.com>");
753 MODULE_DESCRIPTION("Cx231xx Audio driver");
755 module_init(cx231xx_alsa_register);
756 module_exit(cx231xx_alsa_unregister);