net: qmi_wwan: add Olivetti Olicard 500
[linux/fpc-iii.git] / drivers / media / usb / cx231xx / cx231xx-audio.c
blob9b925874d392de05a7c44e3192aa8953e68c5a27
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 if (dev->state & DEV_DISCONNECTED)
115 return;
117 switch (urb->status) {
118 case 0: /* success */
119 case -ETIMEDOUT: /* NAK */
120 break;
121 case -ECONNRESET: /* kill */
122 case -ENOENT:
123 case -ESHUTDOWN:
124 return;
125 default: /* error */
126 dprintk("urb completition error %d.\n", urb->status);
127 break;
130 if (atomic_read(&dev->stream_started) == 0)
131 return;
133 if (dev->adev.capture_pcm_substream) {
134 substream = dev->adev.capture_pcm_substream;
135 runtime = substream->runtime;
136 stride = runtime->frame_bits >> 3;
138 for (i = 0; i < urb->number_of_packets; i++) {
139 int length = urb->iso_frame_desc[i].actual_length /
140 stride;
141 cp = (unsigned char *)urb->transfer_buffer +
142 urb->iso_frame_desc[i].offset;
144 if (!length)
145 continue;
147 oldptr = dev->adev.hwptr_done_capture;
148 if (oldptr + length >= runtime->buffer_size) {
149 unsigned int cnt;
151 cnt = runtime->buffer_size - oldptr;
152 memcpy(runtime->dma_area + oldptr * stride, cp,
153 cnt * stride);
154 memcpy(runtime->dma_area, cp + cnt * stride,
155 length * stride - cnt * stride);
156 } else {
157 memcpy(runtime->dma_area + oldptr * stride, cp,
158 length * stride);
161 snd_pcm_stream_lock(substream);
163 dev->adev.hwptr_done_capture += length;
164 if (dev->adev.hwptr_done_capture >=
165 runtime->buffer_size)
166 dev->adev.hwptr_done_capture -=
167 runtime->buffer_size;
169 dev->adev.capture_transfer_done += length;
170 if (dev->adev.capture_transfer_done >=
171 runtime->period_size) {
172 dev->adev.capture_transfer_done -=
173 runtime->period_size;
174 period_elapsed = 1;
176 snd_pcm_stream_unlock(substream);
178 if (period_elapsed)
179 snd_pcm_period_elapsed(substream);
181 urb->status = 0;
183 status = usb_submit_urb(urb, GFP_ATOMIC);
184 if (status < 0) {
185 cx231xx_errdev("resubmit of audio urb failed (error=%i)\n",
186 status);
188 return;
191 static void cx231xx_audio_bulkirq(struct urb *urb)
193 struct cx231xx *dev = urb->context;
194 unsigned int oldptr;
195 int period_elapsed = 0;
196 int status;
197 unsigned char *cp;
198 unsigned int stride;
199 struct snd_pcm_substream *substream;
200 struct snd_pcm_runtime *runtime;
202 if (dev->state & DEV_DISCONNECTED)
203 return;
205 switch (urb->status) {
206 case 0: /* success */
207 case -ETIMEDOUT: /* NAK */
208 break;
209 case -ECONNRESET: /* kill */
210 case -ENOENT:
211 case -ESHUTDOWN:
212 return;
213 default: /* error */
214 dprintk("urb completition error %d.\n", urb->status);
215 break;
218 if (atomic_read(&dev->stream_started) == 0)
219 return;
221 if (dev->adev.capture_pcm_substream) {
222 substream = dev->adev.capture_pcm_substream;
223 runtime = substream->runtime;
224 stride = runtime->frame_bits >> 3;
226 if (1) {
227 int length = urb->actual_length /
228 stride;
229 cp = (unsigned char *)urb->transfer_buffer;
231 oldptr = dev->adev.hwptr_done_capture;
232 if (oldptr + length >= runtime->buffer_size) {
233 unsigned int cnt;
235 cnt = runtime->buffer_size - oldptr;
236 memcpy(runtime->dma_area + oldptr * stride, cp,
237 cnt * stride);
238 memcpy(runtime->dma_area, cp + cnt * stride,
239 length * stride - cnt * stride);
240 } else {
241 memcpy(runtime->dma_area + oldptr * stride, cp,
242 length * stride);
245 snd_pcm_stream_lock(substream);
247 dev->adev.hwptr_done_capture += length;
248 if (dev->adev.hwptr_done_capture >=
249 runtime->buffer_size)
250 dev->adev.hwptr_done_capture -=
251 runtime->buffer_size;
253 dev->adev.capture_transfer_done += length;
254 if (dev->adev.capture_transfer_done >=
255 runtime->period_size) {
256 dev->adev.capture_transfer_done -=
257 runtime->period_size;
258 period_elapsed = 1;
260 snd_pcm_stream_unlock(substream);
262 if (period_elapsed)
263 snd_pcm_period_elapsed(substream);
265 urb->status = 0;
267 status = usb_submit_urb(urb, GFP_ATOMIC);
268 if (status < 0) {
269 cx231xx_errdev("resubmit of audio urb failed (error=%i)\n",
270 status);
272 return;
275 static int cx231xx_init_audio_isoc(struct cx231xx *dev)
277 int i, errCode;
278 int sb_size;
280 cx231xx_info("%s: Starting ISO AUDIO transfers\n", __func__);
282 if (dev->state & DEV_DISCONNECTED)
283 return -ENODEV;
285 sb_size = CX231XX_ISO_NUM_AUDIO_PACKETS * dev->adev.max_pkt_size;
287 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
288 struct urb *urb;
289 int j, k;
291 dev->adev.transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC);
292 if (!dev->adev.transfer_buffer[i])
293 return -ENOMEM;
295 memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
296 urb = usb_alloc_urb(CX231XX_ISO_NUM_AUDIO_PACKETS, GFP_ATOMIC);
297 if (!urb) {
298 cx231xx_errdev("usb_alloc_urb failed!\n");
299 for (j = 0; j < i; j++) {
300 usb_free_urb(dev->adev.urb[j]);
301 kfree(dev->adev.transfer_buffer[j]);
303 return -ENOMEM;
306 urb->dev = dev->udev;
307 urb->context = dev;
308 urb->pipe = usb_rcvisocpipe(dev->udev,
309 dev->adev.end_point_addr);
310 urb->transfer_flags = URB_ISO_ASAP;
311 urb->transfer_buffer = dev->adev.transfer_buffer[i];
312 urb->interval = 1;
313 urb->complete = cx231xx_audio_isocirq;
314 urb->number_of_packets = CX231XX_ISO_NUM_AUDIO_PACKETS;
315 urb->transfer_buffer_length = sb_size;
317 for (j = k = 0; j < CX231XX_ISO_NUM_AUDIO_PACKETS;
318 j++, k += dev->adev.max_pkt_size) {
319 urb->iso_frame_desc[j].offset = k;
320 urb->iso_frame_desc[j].length = dev->adev.max_pkt_size;
322 dev->adev.urb[i] = urb;
325 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
326 errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
327 if (errCode < 0) {
328 cx231xx_isoc_audio_deinit(dev);
329 return errCode;
333 return errCode;
336 static int cx231xx_init_audio_bulk(struct cx231xx *dev)
338 int i, errCode;
339 int sb_size;
341 cx231xx_info("%s: Starting BULK AUDIO transfers\n", __func__);
343 if (dev->state & DEV_DISCONNECTED)
344 return -ENODEV;
346 sb_size = CX231XX_NUM_AUDIO_PACKETS * dev->adev.max_pkt_size;
348 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
349 struct urb *urb;
350 int j;
352 dev->adev.transfer_buffer[i] = kmalloc(sb_size, GFP_ATOMIC);
353 if (!dev->adev.transfer_buffer[i])
354 return -ENOMEM;
356 memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
357 urb = usb_alloc_urb(CX231XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
358 if (!urb) {
359 cx231xx_errdev("usb_alloc_urb failed!\n");
360 for (j = 0; j < i; j++) {
361 usb_free_urb(dev->adev.urb[j]);
362 kfree(dev->adev.transfer_buffer[j]);
364 return -ENOMEM;
367 urb->dev = dev->udev;
368 urb->context = dev;
369 urb->pipe = usb_rcvbulkpipe(dev->udev,
370 dev->adev.end_point_addr);
371 urb->transfer_flags = 0;
372 urb->transfer_buffer = dev->adev.transfer_buffer[i];
373 urb->complete = cx231xx_audio_bulkirq;
374 urb->transfer_buffer_length = sb_size;
376 dev->adev.urb[i] = urb;
380 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
381 errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
382 if (errCode < 0) {
383 cx231xx_bulk_audio_deinit(dev);
384 return errCode;
388 return errCode;
391 static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
392 size_t size)
394 struct snd_pcm_runtime *runtime = subs->runtime;
396 dprintk("Allocating vbuffer\n");
397 if (runtime->dma_area) {
398 if (runtime->dma_bytes > size)
399 return 0;
401 vfree(runtime->dma_area);
403 runtime->dma_area = vmalloc(size);
404 if (!runtime->dma_area)
405 return -ENOMEM;
407 runtime->dma_bytes = size;
409 return 0;
412 static struct snd_pcm_hardware snd_cx231xx_hw_capture = {
413 .info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
414 SNDRV_PCM_INFO_MMAP |
415 SNDRV_PCM_INFO_INTERLEAVED |
416 SNDRV_PCM_INFO_MMAP_VALID,
418 .formats = SNDRV_PCM_FMTBIT_S16_LE,
420 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT,
422 .rate_min = 48000,
423 .rate_max = 48000,
424 .channels_min = 2,
425 .channels_max = 2,
426 .buffer_bytes_max = 62720 * 8, /* just about the value in usbaudio.c */
427 .period_bytes_min = 64, /* 12544/2, */
428 .period_bytes_max = 12544,
429 .periods_min = 2,
430 .periods_max = 98, /* 12544, */
433 static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
435 struct cx231xx *dev = snd_pcm_substream_chip(substream);
436 struct snd_pcm_runtime *runtime = substream->runtime;
437 int ret = 0;
439 dprintk("opening device and trying to acquire exclusive lock\n");
441 if (!dev) {
442 cx231xx_errdev("BUG: cx231xx can't find device struct."
443 " Can't proceed with open\n");
444 return -ENODEV;
447 if (dev->state & DEV_DISCONNECTED) {
448 cx231xx_errdev("Can't open. the device was removed.\n");
449 return -ENODEV;
452 /* set alternate setting for audio interface */
453 /* 1 - 48000 samples per sec */
454 mutex_lock(&dev->lock);
455 if (dev->USE_ISO)
456 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 1);
457 else
458 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
459 mutex_unlock(&dev->lock);
460 if (ret < 0) {
461 cx231xx_errdev("failed to set alternate setting !\n");
463 return ret;
466 runtime->hw = snd_cx231xx_hw_capture;
468 mutex_lock(&dev->lock);
469 /* inform hardware to start streaming */
470 ret = cx231xx_capture_start(dev, 1, Audio);
472 dev->adev.users++;
473 mutex_unlock(&dev->lock);
475 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
476 dev->adev.capture_pcm_substream = substream;
477 runtime->private_data = dev;
479 return 0;
482 static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
484 int ret;
485 struct cx231xx *dev = snd_pcm_substream_chip(substream);
487 dprintk("closing device\n");
489 /* inform hardware to stop streaming */
490 mutex_lock(&dev->lock);
491 ret = cx231xx_capture_start(dev, 0, Audio);
493 /* set alternate setting for audio interface */
494 /* 1 - 48000 samples per sec */
495 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
496 if (ret < 0) {
497 cx231xx_errdev("failed to set alternate setting !\n");
499 mutex_unlock(&dev->lock);
500 return ret;
503 dev->adev.users--;
504 mutex_unlock(&dev->lock);
506 if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
507 dprintk("audio users: %d\n", dev->adev.users);
508 dprintk("disabling audio stream!\n");
509 dev->adev.shutdown = 0;
510 dprintk("released lock\n");
511 if (atomic_read(&dev->stream_started) > 0) {
512 atomic_set(&dev->stream_started, 0);
513 schedule_work(&dev->wq_trigger);
516 return 0;
519 static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream,
520 struct snd_pcm_hw_params *hw_params)
522 int ret;
524 dprintk("Setting capture parameters\n");
526 ret = snd_pcm_alloc_vmalloc_buffer(substream,
527 params_buffer_bytes(hw_params));
528 #if 0
529 /* TODO: set up cx231xx audio chip to deliver the correct audio format,
530 current default is 48000hz multiplexed => 96000hz mono
531 which shouldn't matter since analogue TV only supports mono */
532 unsigned int channels, rate, format;
534 format = params_format(hw_params);
535 rate = params_rate(hw_params);
536 channels = params_channels(hw_params);
537 #endif
539 return ret;
542 static int snd_cx231xx_hw_capture_free(struct snd_pcm_substream *substream)
544 struct cx231xx *dev = snd_pcm_substream_chip(substream);
546 dprintk("Stop capture, if needed\n");
548 if (atomic_read(&dev->stream_started) > 0) {
549 atomic_set(&dev->stream_started, 0);
550 schedule_work(&dev->wq_trigger);
553 return 0;
556 static int snd_cx231xx_prepare(struct snd_pcm_substream *substream)
558 struct cx231xx *dev = snd_pcm_substream_chip(substream);
560 dev->adev.hwptr_done_capture = 0;
561 dev->adev.capture_transfer_done = 0;
563 return 0;
566 static void audio_trigger(struct work_struct *work)
568 struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger);
570 if (atomic_read(&dev->stream_started)) {
571 dprintk("starting capture");
572 if (is_fw_load(dev) == 0)
573 cx25840_call(dev, core, load_fw);
574 if (dev->USE_ISO)
575 cx231xx_init_audio_isoc(dev);
576 else
577 cx231xx_init_audio_bulk(dev);
578 } else {
579 dprintk("stopping capture");
580 cx231xx_isoc_audio_deinit(dev);
584 static int snd_cx231xx_capture_trigger(struct snd_pcm_substream *substream,
585 int cmd)
587 struct cx231xx *dev = snd_pcm_substream_chip(substream);
588 int retval = 0;
590 if (dev->state & DEV_DISCONNECTED)
591 return -ENODEV;
593 spin_lock(&dev->adev.slock);
594 switch (cmd) {
595 case SNDRV_PCM_TRIGGER_START:
596 atomic_set(&dev->stream_started, 1);
597 break;
598 case SNDRV_PCM_TRIGGER_STOP:
599 atomic_set(&dev->stream_started, 0);
600 break;
601 default:
602 retval = -EINVAL;
603 break;
605 spin_unlock(&dev->adev.slock);
607 schedule_work(&dev->wq_trigger);
609 return retval;
612 static snd_pcm_uframes_t snd_cx231xx_capture_pointer(struct snd_pcm_substream
613 *substream)
615 struct cx231xx *dev;
616 unsigned long flags;
617 snd_pcm_uframes_t hwptr_done;
619 dev = snd_pcm_substream_chip(substream);
621 spin_lock_irqsave(&dev->adev.slock, flags);
622 hwptr_done = dev->adev.hwptr_done_capture;
623 spin_unlock_irqrestore(&dev->adev.slock, flags);
625 return hwptr_done;
628 static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
629 unsigned long offset)
631 void *pageptr = subs->runtime->dma_area + offset;
633 return vmalloc_to_page(pageptr);
636 static struct snd_pcm_ops snd_cx231xx_pcm_capture = {
637 .open = snd_cx231xx_capture_open,
638 .close = snd_cx231xx_pcm_close,
639 .ioctl = snd_pcm_lib_ioctl,
640 .hw_params = snd_cx231xx_hw_capture_params,
641 .hw_free = snd_cx231xx_hw_capture_free,
642 .prepare = snd_cx231xx_prepare,
643 .trigger = snd_cx231xx_capture_trigger,
644 .pointer = snd_cx231xx_capture_pointer,
645 .page = snd_pcm_get_vmalloc_page,
648 static int cx231xx_audio_init(struct cx231xx *dev)
650 struct cx231xx_audio *adev = &dev->adev;
651 struct snd_pcm *pcm;
652 struct snd_card *card;
653 static int devnr;
654 int err;
655 struct usb_interface *uif;
656 int i, isoc_pipe = 0;
658 if (dev->has_alsa_audio != 1) {
659 /* This device does not support the extension (in this case
660 the device is expecting the snd-usb-audio module or
661 doesn't have analog audio support at all) */
662 return 0;
665 cx231xx_info("cx231xx-audio.c: probing for cx231xx "
666 "non standard usbaudio\n");
668 err = snd_card_new(&dev->udev->dev, index[devnr], "Cx231xx Audio",
669 THIS_MODULE, 0, &card);
670 if (err < 0)
671 return err;
673 spin_lock_init(&adev->slock);
674 err = snd_pcm_new(card, "Cx231xx Audio", 0, 0, 1, &pcm);
675 if (err < 0) {
676 snd_card_free(card);
677 return err;
680 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
681 &snd_cx231xx_pcm_capture);
682 pcm->info_flags = 0;
683 pcm->private_data = dev;
684 strcpy(pcm->name, "Conexant cx231xx Capture");
685 strcpy(card->driver, "Cx231xx-Audio");
686 strcpy(card->shortname, "Cx231xx Audio");
687 strcpy(card->longname, "Conexant cx231xx Audio");
689 INIT_WORK(&dev->wq_trigger, audio_trigger);
691 err = snd_card_register(card);
692 if (err < 0) {
693 snd_card_free(card);
694 return err;
696 adev->sndcard = card;
697 adev->udev = dev->udev;
699 /* compute alternate max packet sizes for Audio */
700 uif =
701 dev->udev->actconfig->interface[dev->current_pcb_config.
702 hs_config_info[0].interface_info.
703 audio_index + 1];
705 adev->end_point_addr =
706 uif->altsetting[0].endpoint[isoc_pipe].desc.
707 bEndpointAddress;
709 adev->num_alt = uif->num_altsetting;
710 cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
711 adev->end_point_addr, adev->num_alt);
712 adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL);
714 if (adev->alt_max_pkt_size == NULL) {
715 cx231xx_errdev("out of memory!\n");
716 return -ENOMEM;
719 for (i = 0; i < adev->num_alt; i++) {
720 u16 tmp =
721 le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.
722 wMaxPacketSize);
723 adev->alt_max_pkt_size[i] =
724 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
725 cx231xx_info("Alternate setting %i, max size= %i\n", i,
726 adev->alt_max_pkt_size[i]);
729 return 0;
732 static int cx231xx_audio_fini(struct cx231xx *dev)
734 if (dev == NULL)
735 return 0;
737 if (dev->has_alsa_audio != 1) {
738 /* This device does not support the extension (in this case
739 the device is expecting the snd-usb-audio module or
740 doesn't have analog audio support at all) */
741 return 0;
744 if (dev->adev.sndcard) {
745 snd_card_free(dev->adev.sndcard);
746 kfree(dev->adev.alt_max_pkt_size);
747 dev->adev.sndcard = NULL;
750 return 0;
753 static struct cx231xx_ops audio_ops = {
754 .id = CX231XX_AUDIO,
755 .name = "Cx231xx Audio Extension",
756 .init = cx231xx_audio_init,
757 .fini = cx231xx_audio_fini,
760 static int __init cx231xx_alsa_register(void)
762 return cx231xx_register_extension(&audio_ops);
765 static void __exit cx231xx_alsa_unregister(void)
767 cx231xx_unregister_extension(&audio_ops);
770 MODULE_LICENSE("GPL");
771 MODULE_AUTHOR("Srinivasa Deevi <srinivasa.deevi@conexant.com>");
772 MODULE_DESCRIPTION("Cx231xx Audio driver");
774 module_init(cx231xx_alsa_register);
775 module_exit(cx231xx_alsa_unregister);