1 // SPDX-License-Identifier: GPL-2.0-only
3 * Driver for the Conexant CX25821 PCIe bridge
5 * Copyright (C) 2009 Conexant Systems Inc.
6 * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
7 * Based on SAA713x ALSA driver and CX88 driver
10 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
12 #include <linux/module.h>
13 #include <linux/init.h>
14 #include <linux/device.h>
15 #include <linux/interrupt.h>
16 #include <linux/vmalloc.h>
17 #include <linux/dma-mapping.h>
18 #include <linux/pci.h>
19 #include <linux/slab.h>
21 #include <linux/delay.h>
22 #include <sound/core.h>
23 #include <sound/pcm.h>
24 #include <sound/pcm_params.h>
25 #include <sound/control.h>
26 #include <sound/initval.h>
27 #include <sound/tlv.h>
30 #include "cx25821-reg.h"
32 #define AUDIO_SRAM_CHANNEL SRAM_CH08
34 #define dprintk(level, fmt, arg...) \
37 pr_info("%s/1: " fmt, chip->dev->name, ##arg); \
39 #define dprintk_core(level, fmt, arg...) \
42 printk(KERN_DEBUG "%s/1: " fmt, chip->dev->name, ##arg); \
45 /****************************************************************************
46 Data type declarations - Can be moded to a header file later
47 ****************************************************************************/
51 struct cx25821_audio_buffer
{
53 struct cx25821_riscmem risc
;
55 struct scatterlist
*sglist
;
60 struct cx25821_audio_dev
{
61 struct cx25821_dev
*dev
;
62 struct cx25821_dmaqueue q
;
70 struct snd_card
*card
;
76 unsigned int dma_size
;
77 unsigned int period_size
;
78 unsigned int num_periods
;
80 struct cx25821_audio_buffer
*buf
;
82 struct snd_pcm_substream
*substream
;
86 /****************************************************************************
87 Module global static vars
88 ****************************************************************************/
90 static int index
[SNDRV_CARDS
] = SNDRV_DEFAULT_IDX
; /* Index 0-MAX */
91 static char *id
[SNDRV_CARDS
] = SNDRV_DEFAULT_STR
; /* ID for this card */
92 static bool enable
[SNDRV_CARDS
] = SNDRV_DEFAULT_ENABLE_PNP
;
94 module_param_array(enable
, bool, NULL
, 0444);
95 MODULE_PARM_DESC(enable
, "Enable cx25821 soundcard. default enabled.");
97 module_param_array(index
, int, NULL
, 0444);
98 MODULE_PARM_DESC(index
, "Index value for cx25821 capture interface(s).");
100 /****************************************************************************
102 ****************************************************************************/
104 MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards");
105 MODULE_AUTHOR("Hiep Huynh");
106 MODULE_LICENSE("GPL");
107 MODULE_SUPPORTED_DEVICE("{{Conexant,25821}"); /* "{{Conexant,23881}," */
109 static unsigned int debug
;
110 module_param(debug
, int, 0644);
111 MODULE_PARM_DESC(debug
, "enable debug messages");
113 /****************************************************************************
114 Module specific functions
115 ****************************************************************************/
116 /* Constants taken from cx88-reg.h */
117 #define AUD_INT_DN_RISCI1 (1 << 0)
118 #define AUD_INT_UP_RISCI1 (1 << 1)
119 #define AUD_INT_RDS_DN_RISCI1 (1 << 2)
120 #define AUD_INT_DN_RISCI2 (1 << 4) /* yes, 3 is skipped */
121 #define AUD_INT_UP_RISCI2 (1 << 5)
122 #define AUD_INT_RDS_DN_RISCI2 (1 << 6)
123 #define AUD_INT_DN_SYNC (1 << 12)
124 #define AUD_INT_UP_SYNC (1 << 13)
125 #define AUD_INT_RDS_DN_SYNC (1 << 14)
126 #define AUD_INT_OPC_ERR (1 << 16)
127 #define AUD_INT_BER_IRQ (1 << 20)
128 #define AUD_INT_MCHG_IRQ (1 << 21)
129 #define GP_COUNT_CONTROL_RESET 0x3
131 #define PCI_MSK_AUD_EXT (1 << 4)
132 #define PCI_MSK_AUD_INT (1 << 3)
134 static int cx25821_alsa_dma_init(struct cx25821_audio_dev
*chip
, int nr_pages
)
136 struct cx25821_audio_buffer
*buf
= chip
->buf
;
140 buf
->vaddr
= vmalloc_32(nr_pages
<< PAGE_SHIFT
);
141 if (NULL
== buf
->vaddr
) {
142 dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages
);
146 dprintk(1, "vmalloc is at addr 0x%p, size=%d\n",
148 nr_pages
<< PAGE_SHIFT
);
150 memset(buf
->vaddr
, 0, nr_pages
<< PAGE_SHIFT
);
151 buf
->nr_pages
= nr_pages
;
153 buf
->sglist
= vzalloc(array_size(sizeof(*buf
->sglist
), buf
->nr_pages
));
154 if (NULL
== buf
->sglist
)
157 sg_init_table(buf
->sglist
, buf
->nr_pages
);
158 for (i
= 0; i
< buf
->nr_pages
; i
++) {
159 pg
= vmalloc_to_page(buf
->vaddr
+ i
* PAGE_SIZE
);
161 goto vmalloc_to_page_err
;
162 sg_set_page(&buf
->sglist
[i
], pg
, PAGE_SIZE
, 0);
175 static int cx25821_alsa_dma_map(struct cx25821_audio_dev
*dev
)
177 struct cx25821_audio_buffer
*buf
= dev
->buf
;
179 buf
->sglen
= dma_map_sg(&dev
->pci
->dev
, buf
->sglist
,
180 buf
->nr_pages
, PCI_DMA_FROMDEVICE
);
182 if (0 == buf
->sglen
) {
183 pr_warn("%s: cx25821_alsa_map_sg failed\n", __func__
);
189 static int cx25821_alsa_dma_unmap(struct cx25821_audio_dev
*dev
)
191 struct cx25821_audio_buffer
*buf
= dev
->buf
;
196 dma_unmap_sg(&dev
->pci
->dev
, buf
->sglist
, buf
->sglen
, PCI_DMA_FROMDEVICE
);
201 static int cx25821_alsa_dma_free(struct cx25821_audio_buffer
*buf
)
211 * BOARD Specific: Sets audio DMA
214 static int _cx25821_start_audio_dma(struct cx25821_audio_dev
*chip
)
216 struct cx25821_audio_buffer
*buf
= chip
->buf
;
217 struct cx25821_dev
*dev
= chip
->dev
;
218 const struct sram_channel
*audio_ch
=
219 &cx25821_sram_channels
[AUDIO_SRAM_CHANNEL
];
222 /* enable output on the GPIO 0 for the MCLK ADC (Audio) */
223 cx25821_set_gpiopin_direction(chip
->dev
, 0, 0);
225 /* Make sure RISC/FIFO are off before changing FIFO/RISC settings */
226 cx_clear(AUD_INT_DMA_CTL
,
227 FLD_AUD_DST_A_RISC_EN
| FLD_AUD_DST_A_FIFO_EN
);
229 /* setup fifo + format - out channel */
230 cx25821_sram_channel_setup_audio(chip
->dev
, audio_ch
, buf
->bpl
,
234 cx_write(AUD_A_LNGTH
, buf
->bpl
);
237 /* GP_COUNT_CONTROL_RESET = 0x3 */
238 cx_write(AUD_A_GPCNT_CTL
, GP_COUNT_CONTROL_RESET
);
239 atomic_set(&chip
->count
, 0);
241 /* Set the input mode to 16-bit */
242 tmp
= cx_read(AUD_A_CFG
);
243 cx_write(AUD_A_CFG
, tmp
| FLD_AUD_DST_PK_MODE
| FLD_AUD_DST_ENABLE
|
247 pr_info("DEBUG: Start audio DMA, %d B/line, cmds_start(0x%x)= %d lines/FIFO, %d periods, %d byte buffer\n",
248 buf->bpl, audio_ch->cmds_start,
249 cx_read(audio_ch->cmds_start + 12)>>1,
250 chip->num_periods, buf->bpl * chip->num_periods);
253 /* Enables corresponding bits at AUD_INT_STAT */
254 cx_write(AUD_A_INT_MSK
, FLD_AUD_DST_RISCI1
| FLD_AUD_DST_OF
|
255 FLD_AUD_DST_SYNC
| FLD_AUD_DST_OPC_ERR
);
257 /* Clean any pending interrupt bits already set */
258 cx_write(AUD_A_INT_STAT
, ~0);
260 /* enable audio irqs */
261 cx_set(PCI_INT_MSK
, chip
->dev
->pci_irqmask
| PCI_MSK_AUD_INT
);
263 /* Turn on audio downstream fifo and risc enable 0x101 */
264 tmp
= cx_read(AUD_INT_DMA_CTL
);
265 cx_set(AUD_INT_DMA_CTL
, tmp
|
266 (FLD_AUD_DST_A_RISC_EN
| FLD_AUD_DST_A_FIFO_EN
));
273 * BOARD Specific: Resets audio DMA
275 static int _cx25821_stop_audio_dma(struct cx25821_audio_dev
*chip
)
277 struct cx25821_dev
*dev
= chip
->dev
;
280 cx_clear(AUD_INT_DMA_CTL
,
281 FLD_AUD_DST_A_RISC_EN
| FLD_AUD_DST_A_FIFO_EN
);
284 cx_clear(PCI_INT_MSK
, PCI_MSK_AUD_INT
);
285 cx_clear(AUD_A_INT_MSK
, AUD_INT_OPC_ERR
| AUD_INT_DN_SYNC
|
286 AUD_INT_DN_RISCI2
| AUD_INT_DN_RISCI1
);
291 #define MAX_IRQ_LOOP 50
294 * BOARD Specific: IRQ dma bits
296 static char *cx25821_aud_irqs
[32] = {
297 "dn_risci1", "up_risci1", "rds_dn_risc1", /* 0-2 */
299 "dn_risci2", "up_risci2", "rds_dn_risc2", /* 4-6 */
301 "dnf_of", "upf_uf", "rds_dnf_uf", /* 8-10 */
303 "dn_sync", "up_sync", "rds_dn_sync", /* 12-14 */
305 "opc_err", "par_err", "rip_err", /* 16-18 */
306 "pci_abort", "ber_irq", "mchg_irq" /* 19-21 */
310 * BOARD Specific: Threats IRQ audio specific calls
312 static void cx25821_aud_irq(struct cx25821_audio_dev
*chip
, u32 status
,
315 struct cx25821_dev
*dev
= chip
->dev
;
317 if (0 == (status
& mask
))
320 cx_write(AUD_A_INT_STAT
, status
);
321 if (debug
> 1 || (status
& mask
& ~0xff))
322 cx25821_print_irqbits(dev
->name
, "irq aud", cx25821_aud_irqs
,
323 ARRAY_SIZE(cx25821_aud_irqs
), status
, mask
);
325 /* risc op code error */
326 if (status
& AUD_INT_OPC_ERR
) {
327 pr_warn("WARNING %s/1: Audio risc op code error\n", dev
->name
);
329 cx_clear(AUD_INT_DMA_CTL
,
330 FLD_AUD_DST_A_RISC_EN
| FLD_AUD_DST_A_FIFO_EN
);
331 cx25821_sram_channel_dump_audio(dev
,
332 &cx25821_sram_channels
[AUDIO_SRAM_CHANNEL
]);
334 if (status
& AUD_INT_DN_SYNC
) {
335 pr_warn("WARNING %s: Downstream sync error!\n", dev
->name
);
336 cx_write(AUD_A_GPCNT_CTL
, GP_COUNT_CONTROL_RESET
);
340 /* risc1 downstream */
341 if (status
& AUD_INT_DN_RISCI1
) {
342 atomic_set(&chip
->count
, cx_read(AUD_A_GPCNT
));
343 snd_pcm_period_elapsed(chip
->substream
);
348 * BOARD Specific: Handles IRQ calls
350 static irqreturn_t
cx25821_irq(int irq
, void *dev_id
)
352 struct cx25821_audio_dev
*chip
= dev_id
;
353 struct cx25821_dev
*dev
= chip
->dev
;
354 u32 status
, pci_status
;
355 u32 audint_status
, audint_mask
;
356 int loop
, handled
= 0;
358 audint_status
= cx_read(AUD_A_INT_STAT
);
359 audint_mask
= cx_read(AUD_A_INT_MSK
);
360 status
= cx_read(PCI_INT_STAT
);
362 for (loop
= 0; loop
< 1; loop
++) {
363 status
= cx_read(PCI_INT_STAT
);
365 status
= cx_read(PCI_INT_STAT
);
366 audint_status
= cx_read(AUD_A_INT_STAT
);
367 audint_mask
= cx_read(AUD_A_INT_MSK
);
371 cx_write(PCI_INT_STAT
, status
);
373 cx25821_aud_irq(chip
, audint_status
,
382 cx_write(PCI_INT_STAT
, status
);
384 cx25821_aud_irq(chip
, audint_status
, audint_mask
);
387 pci_status
= cx_read(PCI_INT_STAT
);
390 cx_write(PCI_INT_STAT
, pci_status
);
393 return IRQ_RETVAL(handled
);
396 static int dsp_buffer_free(struct cx25821_audio_dev
*chip
)
398 struct cx25821_riscmem
*risc
= &chip
->buf
->risc
;
400 BUG_ON(!chip
->dma_size
);
402 dprintk(2, "Freeing buffer\n");
403 cx25821_alsa_dma_unmap(chip
);
404 cx25821_alsa_dma_free(chip
->buf
);
405 pci_free_consistent(chip
->pci
, risc
->size
, risc
->cpu
, risc
->dma
);
414 /****************************************************************************
416 ****************************************************************************/
419 * Digital hardware definition
421 #define DEFAULT_FIFO_SIZE 384
422 static const struct snd_pcm_hardware snd_cx25821_digital_hw
= {
423 .info
= SNDRV_PCM_INFO_MMAP
| SNDRV_PCM_INFO_INTERLEAVED
|
424 SNDRV_PCM_INFO_BLOCK_TRANSFER
| SNDRV_PCM_INFO_MMAP_VALID
,
425 .formats
= SNDRV_PCM_FMTBIT_S16_LE
,
427 .rates
= SNDRV_PCM_RATE_48000
,
432 /* Analog audio output will be full of clicks and pops if there
433 are not exactly four lines in the SRAM FIFO buffer. */
434 .period_bytes_min
= DEFAULT_FIFO_SIZE
/ 3,
435 .period_bytes_max
= DEFAULT_FIFO_SIZE
/ 3,
437 .periods_max
= AUDIO_LINE_SIZE
,
438 /* 128 * 128 = 16384 = 1024 * 16 */
439 .buffer_bytes_max
= (AUDIO_LINE_SIZE
* AUDIO_LINE_SIZE
),
443 * audio pcm capture open callback
445 static int snd_cx25821_pcm_open(struct snd_pcm_substream
*substream
)
447 struct cx25821_audio_dev
*chip
= snd_pcm_substream_chip(substream
);
448 struct snd_pcm_runtime
*runtime
= substream
->runtime
;
450 unsigned int bpl
= 0;
453 pr_err("DEBUG: cx25821 can't find device struct. Can't proceed with open\n");
457 err
= snd_pcm_hw_constraint_pow2(runtime
, 0,
458 SNDRV_PCM_HW_PARAM_PERIODS
);
462 chip
->substream
= substream
;
464 runtime
->hw
= snd_cx25821_digital_hw
;
466 if (cx25821_sram_channels
[AUDIO_SRAM_CHANNEL
].fifo_size
!=
468 /* since there are 3 audio Clusters */
469 bpl
= cx25821_sram_channels
[AUDIO_SRAM_CHANNEL
].fifo_size
/ 3;
470 bpl
&= ~7; /* must be multiple of 8 */
472 if (bpl
> AUDIO_LINE_SIZE
)
473 bpl
= AUDIO_LINE_SIZE
;
475 runtime
->hw
.period_bytes_min
= bpl
;
476 runtime
->hw
.period_bytes_max
= bpl
;
481 dprintk(1, "Error opening PCM!\n");
486 * audio close callback
488 static int snd_cx25821_close(struct snd_pcm_substream
*substream
)
496 static int snd_cx25821_hw_params(struct snd_pcm_substream
*substream
,
497 struct snd_pcm_hw_params
*hw_params
)
499 struct cx25821_audio_dev
*chip
= snd_pcm_substream_chip(substream
);
500 struct cx25821_audio_buffer
*buf
;
503 if (substream
->runtime
->dma_area
) {
504 dsp_buffer_free(chip
);
505 substream
->runtime
->dma_area
= NULL
;
508 chip
->period_size
= params_period_bytes(hw_params
);
509 chip
->num_periods
= params_periods(hw_params
);
510 chip
->dma_size
= chip
->period_size
* params_periods(hw_params
);
512 BUG_ON(!chip
->dma_size
);
513 BUG_ON(chip
->num_periods
& (chip
->num_periods
- 1));
515 buf
= kzalloc(sizeof(*buf
), GFP_KERNEL
);
519 if (chip
->period_size
> AUDIO_LINE_SIZE
)
520 chip
->period_size
= AUDIO_LINE_SIZE
;
522 buf
->bpl
= chip
->period_size
;
525 ret
= cx25821_alsa_dma_init(chip
,
526 (PAGE_ALIGN(chip
->dma_size
) >> PAGE_SHIFT
));
530 ret
= cx25821_alsa_dma_map(chip
);
534 ret
= cx25821_risc_databuffer_audio(chip
->pci
, &buf
->risc
, buf
->sglist
,
535 chip
->period_size
, chip
->num_periods
, 1);
537 pr_info("DEBUG: ERROR after cx25821_risc_databuffer_audio()\n");
541 /* Loop back to start of program */
542 buf
->risc
.jmp
[0] = cpu_to_le32(RISC_JUMP
| RISC_IRQ1
| RISC_CNT_INC
);
543 buf
->risc
.jmp
[1] = cpu_to_le32(buf
->risc
.dma
);
544 buf
->risc
.jmp
[2] = cpu_to_le32(0); /* bits 63-32 */
546 substream
->runtime
->dma_area
= chip
->buf
->vaddr
;
547 substream
->runtime
->dma_bytes
= chip
->dma_size
;
548 substream
->runtime
->dma_addr
= 0;
561 static int snd_cx25821_hw_free(struct snd_pcm_substream
*substream
)
563 struct cx25821_audio_dev
*chip
= snd_pcm_substream_chip(substream
);
565 if (substream
->runtime
->dma_area
) {
566 dsp_buffer_free(chip
);
567 substream
->runtime
->dma_area
= NULL
;
576 static int snd_cx25821_prepare(struct snd_pcm_substream
*substream
)
584 static int snd_cx25821_card_trigger(struct snd_pcm_substream
*substream
,
587 struct cx25821_audio_dev
*chip
= snd_pcm_substream_chip(substream
);
590 /* Local interrupts are already disabled by ALSA */
591 spin_lock(&chip
->reg_lock
);
594 case SNDRV_PCM_TRIGGER_START
:
595 err
= _cx25821_start_audio_dma(chip
);
597 case SNDRV_PCM_TRIGGER_STOP
:
598 err
= _cx25821_stop_audio_dma(chip
);
605 spin_unlock(&chip
->reg_lock
);
613 static snd_pcm_uframes_t
snd_cx25821_pointer(struct snd_pcm_substream
616 struct cx25821_audio_dev
*chip
= snd_pcm_substream_chip(substream
);
617 struct snd_pcm_runtime
*runtime
= substream
->runtime
;
620 count
= atomic_read(&chip
->count
);
622 return runtime
->period_size
* (count
& (runtime
->periods
- 1));
626 * page callback (needed for mmap)
628 static struct page
*snd_cx25821_page(struct snd_pcm_substream
*substream
,
629 unsigned long offset
)
631 void *pageptr
= substream
->runtime
->dma_area
+ offset
;
633 return vmalloc_to_page(pageptr
);
639 static const struct snd_pcm_ops snd_cx25821_pcm_ops
= {
640 .open
= snd_cx25821_pcm_open
,
641 .close
= snd_cx25821_close
,
642 .hw_params
= snd_cx25821_hw_params
,
643 .hw_free
= snd_cx25821_hw_free
,
644 .prepare
= snd_cx25821_prepare
,
645 .trigger
= snd_cx25821_card_trigger
,
646 .pointer
= snd_cx25821_pointer
,
647 .page
= snd_cx25821_page
,
651 * ALSA create a PCM device: Called when initializing the board.
652 * Sets up the name and hooks up the callbacks
654 static int snd_cx25821_pcm(struct cx25821_audio_dev
*chip
, int device
,
660 err
= snd_pcm_new(chip
->card
, name
, device
, 0, 1, &pcm
);
662 pr_info("ERROR: FAILED snd_pcm_new() in %s\n", __func__
);
665 pcm
->private_data
= chip
;
667 strscpy(pcm
->name
, name
, sizeof(pcm
->name
));
668 snd_pcm_set_ops(pcm
, SNDRV_PCM_STREAM_CAPTURE
, &snd_cx25821_pcm_ops
);
673 /****************************************************************************
674 Basic Flow for Sound Devices
675 ****************************************************************************/
678 * PCI ID Table - 14f1:8801 and 14f1:8811 means function 1: Audio
679 * Only boards with eeprom and byte 1 at eeprom=1 have it
682 static const struct pci_device_id __maybe_unused cx25821_audio_pci_tbl
[] = {
683 {0x14f1, 0x0920, PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, 0},
687 MODULE_DEVICE_TABLE(pci
, cx25821_audio_pci_tbl
);
690 * Alsa Constructor - Component probe
692 static int cx25821_audio_initdev(struct cx25821_dev
*dev
)
694 struct snd_card
*card
;
695 struct cx25821_audio_dev
*chip
;
698 if (devno
>= SNDRV_CARDS
) {
699 pr_info("DEBUG ERROR: devno >= SNDRV_CARDS %s\n", __func__
);
703 if (!enable
[devno
]) {
705 pr_info("DEBUG ERROR: !enable[devno] %s\n", __func__
);
709 err
= snd_card_new(&dev
->pci
->dev
, index
[devno
], id
[devno
],
711 sizeof(struct cx25821_audio_dev
), &card
);
713 pr_info("DEBUG ERROR: cannot create snd_card_new in %s\n",
718 strscpy(card
->driver
, "cx25821", sizeof(card
->driver
));
720 /* Card "creation" */
721 chip
= card
->private_data
;
722 spin_lock_init(&chip
->reg_lock
);
726 chip
->pci
= dev
->pci
;
727 chip
->iobase
= pci_resource_start(dev
->pci
, 0);
729 chip
->irq
= dev
->pci
->irq
;
731 err
= request_irq(dev
->pci
->irq
, cx25821_irq
,
732 IRQF_SHARED
, chip
->dev
->name
, chip
);
735 pr_err("ERROR %s: can't get IRQ %d for ALSA\n", chip
->dev
->name
,
740 err
= snd_cx25821_pcm(chip
, 0, "cx25821 Digital");
742 pr_info("DEBUG ERROR: cannot create snd_cx25821_pcm %s\n",
747 strscpy(card
->shortname
, "cx25821", sizeof(card
->shortname
));
748 sprintf(card
->longname
, "%s at 0x%lx irq %d", chip
->dev
->name
,
749 chip
->iobase
, chip
->irq
);
750 strscpy(card
->mixername
, "CX25821", sizeof(card
->mixername
));
752 pr_info("%s/%i: ALSA support for cx25821 boards\n", card
->driver
,
755 err
= snd_card_register(card
);
757 pr_info("DEBUG ERROR: cannot register sound card %s\n",
771 /****************************************************************************
773 ****************************************************************************/
775 static int cx25821_alsa_exit_callback(struct device
*dev
, void *data
)
777 struct v4l2_device
*v4l2_dev
= dev_get_drvdata(dev
);
778 struct cx25821_dev
*cxdev
= get_cx25821(v4l2_dev
);
780 snd_card_free(cxdev
->card
);
784 static void cx25821_audio_fini(void)
786 struct device_driver
*drv
= driver_find("cx25821", &pci_bus_type
);
789 ret
= driver_for_each_device(drv
, NULL
, NULL
, cx25821_alsa_exit_callback
);
791 pr_err("%s failed to find a cx25821 driver.\n", __func__
);
794 static int cx25821_alsa_init_callback(struct device
*dev
, void *data
)
796 struct v4l2_device
*v4l2_dev
= dev_get_drvdata(dev
);
797 struct cx25821_dev
*cxdev
= get_cx25821(v4l2_dev
);
799 cx25821_audio_initdev(cxdev
);
806 * Loops through present saa7134 cards, and assigns an ALSA device
810 static int cx25821_alsa_init(void)
812 struct device_driver
*drv
= driver_find("cx25821", &pci_bus_type
);
814 return driver_for_each_device(drv
, NULL
, NULL
, cx25821_alsa_init_callback
);
818 late_initcall(cx25821_alsa_init
);
819 module_exit(cx25821_audio_fini
);