3 * device driver for philips saa7134 based TV cards
6 * (c) 2001-03 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
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/init.h>
24 #include <linux/list.h>
25 #include <linux/module.h>
26 #include <linux/kernel.h>
27 #include <linux/slab.h>
28 #include <linux/kmod.h>
29 #include <linux/sound.h>
30 #include <linux/interrupt.h>
31 #include <linux/delay.h>
32 #include <linux/mutex.h>
33 #include <linux/dma-mapping.h>
36 #include "saa7134-reg.h"
39 MODULE_DESCRIPTION("v4l2 driver module for saa7130/34 based TV cards");
40 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
41 MODULE_LICENSE("GPL");
43 /* ------------------------------------------------------------------ */
45 static unsigned int irq_debug
;
46 module_param(irq_debug
, int, 0644);
47 MODULE_PARM_DESC(irq_debug
,"enable debug messages [IRQ handler]");
49 static unsigned int core_debug
;
50 module_param(core_debug
, int, 0644);
51 MODULE_PARM_DESC(core_debug
,"enable debug messages [core]");
53 static unsigned int gpio_tracking
;
54 module_param(gpio_tracking
, int, 0644);
55 MODULE_PARM_DESC(gpio_tracking
,"enable debug messages [gpio]");
57 static unsigned int alsa
= 1;
58 module_param(alsa
, int, 0644);
59 MODULE_PARM_DESC(alsa
,"enable/disable ALSA DMA sound [dmasound]");
61 static unsigned int latency
= UNSET
;
62 module_param(latency
, int, 0444);
63 MODULE_PARM_DESC(latency
,"pci latency timer");
65 int saa7134_no_overlay
=-1;
66 module_param_named(no_overlay
, saa7134_no_overlay
, int, 0444);
67 MODULE_PARM_DESC(no_overlay
,"allow override overlay default (0 disables, 1 enables)"
68 " [some VIA/SIS chipsets are known to have problem with overlay]");
70 static unsigned int video_nr
[] = {[0 ... (SAA7134_MAXBOARDS
- 1)] = UNSET
};
71 static unsigned int vbi_nr
[] = {[0 ... (SAA7134_MAXBOARDS
- 1)] = UNSET
};
72 static unsigned int radio_nr
[] = {[0 ... (SAA7134_MAXBOARDS
- 1)] = UNSET
};
73 static unsigned int tuner
[] = {[0 ... (SAA7134_MAXBOARDS
- 1)] = UNSET
};
74 static unsigned int card
[] = {[0 ... (SAA7134_MAXBOARDS
- 1)] = UNSET
};
77 module_param_array(video_nr
, int, NULL
, 0444);
78 module_param_array(vbi_nr
, int, NULL
, 0444);
79 module_param_array(radio_nr
, int, NULL
, 0444);
80 module_param_array(tuner
, int, NULL
, 0444);
81 module_param_array(card
, int, NULL
, 0444);
83 MODULE_PARM_DESC(video_nr
, "video device number");
84 MODULE_PARM_DESC(vbi_nr
, "vbi device number");
85 MODULE_PARM_DESC(radio_nr
, "radio device number");
86 MODULE_PARM_DESC(tuner
, "tuner type");
87 MODULE_PARM_DESC(card
, "card type");
89 DEFINE_MUTEX(saa7134_devlist_lock
);
90 EXPORT_SYMBOL(saa7134_devlist_lock
);
91 LIST_HEAD(saa7134_devlist
);
92 EXPORT_SYMBOL(saa7134_devlist
);
93 static LIST_HEAD(mops_list
);
94 static unsigned int saa7134_devcount
;
96 int (*saa7134_dmasound_init
)(struct saa7134_dev
*dev
);
97 int (*saa7134_dmasound_exit
)(struct saa7134_dev
*dev
);
99 #define dprintk(fmt, arg...) if (core_debug) \
100 printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
102 void saa7134_track_gpio(struct saa7134_dev
*dev
, char *msg
)
104 unsigned long mode
,status
;
108 /* rising SAA7134_GPIO_GPRESCAN reads the status */
109 saa_andorb(SAA7134_GPIO_GPMODE3
,SAA7134_GPIO_GPRESCAN
,0);
110 saa_andorb(SAA7134_GPIO_GPMODE3
,SAA7134_GPIO_GPRESCAN
,SAA7134_GPIO_GPRESCAN
);
111 mode
= saa_readl(SAA7134_GPIO_GPMODE0
>> 2) & 0xfffffff;
112 status
= saa_readl(SAA7134_GPIO_GPSTATUS0
>> 2) & 0xfffffff;
114 "%s: gpio: mode=0x%07lx in=0x%07lx out=0x%07lx [%s]\n",
115 dev
->name
, mode
, (~mode
) & status
, mode
& status
, msg
);
118 void saa7134_set_gpio(struct saa7134_dev
*dev
, int bit_no
, int value
)
124 case 0: /* static value */
125 case 1: dprintk("setting GPIO%d to static %d\n", bit_no
, value
);
126 /* turn sync mode off if necessary */
127 if (index
& 0x00c00000)
128 saa_andorb(SAA7134_VIDEO_PORT_CTRL6
, 0x0f, 0x00);
133 saa_andorl(SAA7134_GPIO_GPMODE0
>> 2, index
, index
);
134 saa_andorl(SAA7134_GPIO_GPSTATUS0
>> 2, index
, bitval
);
136 case 3: /* tristate */
137 dprintk("setting GPIO%d to tristate\n", bit_no
);
138 saa_andorl(SAA7134_GPIO_GPMODE0
>> 2, index
, 0);
143 /* ------------------------------------------------------------------ */
146 /* ----------------------------------------------------------- */
147 /* delayed request_module */
149 #if defined(CONFIG_MODULES) && defined(MODULE)
151 static void request_module_async(struct work_struct
*work
){
152 struct saa7134_dev
* dev
= container_of(work
, struct saa7134_dev
, request_module_wk
);
153 if (card_is_empress(dev
))
154 request_module("saa7134-empress");
155 if (card_is_dvb(dev
))
156 request_module("saa7134-dvb");
158 if (dev
->pci
->device
!= PCI_DEVICE_ID_PHILIPS_SAA7130
)
159 request_module("saa7134-alsa");
163 static void request_submodules(struct saa7134_dev
*dev
)
165 INIT_WORK(&dev
->request_module_wk
, request_module_async
);
166 schedule_work(&dev
->request_module_wk
);
169 static void flush_request_submodules(struct saa7134_dev
*dev
)
171 flush_work_sync(&dev
->request_module_wk
);
175 #define request_submodules(dev)
176 #define flush_request_submodules(dev)
177 #endif /* CONFIG_MODULES */
179 /* ------------------------------------------------------------------ */
181 /* nr of (saa7134-)pages for the given buffer size */
182 static int saa7134_buffer_pages(int size
)
184 size
= PAGE_ALIGN(size
);
185 size
+= PAGE_SIZE
; /* for non-page-aligned buffers */
190 /* calc max # of buffers from size (must not exceed the 4MB virtual
191 * address space per DMA channel) */
192 int saa7134_buffer_count(unsigned int size
, unsigned int count
)
194 unsigned int maxcount
;
196 maxcount
= 1024 / saa7134_buffer_pages(size
);
197 if (count
> maxcount
)
202 int saa7134_buffer_startpage(struct saa7134_buf
*buf
)
204 return saa7134_buffer_pages(buf
->vb
.bsize
) * buf
->vb
.i
;
207 unsigned long saa7134_buffer_base(struct saa7134_buf
*buf
)
210 struct videobuf_dmabuf
*dma
=videobuf_to_dma(&buf
->vb
);
212 base
= saa7134_buffer_startpage(buf
) * 4096;
213 base
+= dma
->sglist
[0].offset
;
217 /* ------------------------------------------------------------------ */
219 int saa7134_pgtable_alloc(struct pci_dev
*pci
, struct saa7134_pgtable
*pt
)
222 dma_addr_t dma_addr
= 0;
224 cpu
= pci_alloc_consistent(pci
, SAA7134_PGTABLE_SIZE
, &dma_addr
);
227 pt
->size
= SAA7134_PGTABLE_SIZE
;
233 int saa7134_pgtable_build(struct pci_dev
*pci
, struct saa7134_pgtable
*pt
,
234 struct scatterlist
*list
, unsigned int length
,
235 unsigned int startpage
)
240 BUG_ON(NULL
== pt
|| NULL
== pt
->cpu
);
242 ptr
= pt
->cpu
+ startpage
;
243 for (i
= 0; i
< length
; i
++, list
++)
244 for (p
= 0; p
* 4096 < list
->length
; p
++, ptr
++)
245 *ptr
= cpu_to_le32(sg_dma_address(list
) - list
->offset
);
249 void saa7134_pgtable_free(struct pci_dev
*pci
, struct saa7134_pgtable
*pt
)
253 pci_free_consistent(pci
, pt
->size
, pt
->cpu
, pt
->dma
);
257 /* ------------------------------------------------------------------ */
259 void saa7134_dma_free(struct videobuf_queue
*q
,struct saa7134_buf
*buf
)
261 struct videobuf_dmabuf
*dma
=videobuf_to_dma(&buf
->vb
);
262 BUG_ON(in_interrupt());
264 videobuf_waiton(q
, &buf
->vb
, 0, 0);
265 videobuf_dma_unmap(q
->dev
, dma
);
266 videobuf_dma_free(dma
);
267 buf
->vb
.state
= VIDEOBUF_NEEDS_INIT
;
270 /* ------------------------------------------------------------------ */
272 int saa7134_buffer_queue(struct saa7134_dev
*dev
,
273 struct saa7134_dmaqueue
*q
,
274 struct saa7134_buf
*buf
)
276 struct saa7134_buf
*next
= NULL
;
278 assert_spin_locked(&dev
->slock
);
279 dprintk("buffer_queue %p\n",buf
);
280 if (NULL
== q
->curr
) {
283 buf
->activate(dev
,buf
,NULL
);
284 } else if (list_empty(&q
->queue
)) {
285 list_add_tail(&buf
->vb
.queue
,&q
->queue
);
286 buf
->vb
.state
= VIDEOBUF_QUEUED
;
288 next
= list_entry(q
->queue
.next
,struct saa7134_buf
,
291 buf
->activate(dev
,buf
,next
);
294 list_add_tail(&buf
->vb
.queue
,&q
->queue
);
295 buf
->vb
.state
= VIDEOBUF_QUEUED
;
300 void saa7134_buffer_finish(struct saa7134_dev
*dev
,
301 struct saa7134_dmaqueue
*q
,
304 assert_spin_locked(&dev
->slock
);
305 dprintk("buffer_finish %p\n",q
->curr
);
307 /* finish current buffer */
308 q
->curr
->vb
.state
= state
;
309 do_gettimeofday(&q
->curr
->vb
.ts
);
310 wake_up(&q
->curr
->vb
.done
);
314 void saa7134_buffer_next(struct saa7134_dev
*dev
,
315 struct saa7134_dmaqueue
*q
)
317 struct saa7134_buf
*buf
,*next
= NULL
;
319 assert_spin_locked(&dev
->slock
);
320 BUG_ON(NULL
!= q
->curr
);
322 if (!list_empty(&q
->queue
)) {
323 /* activate next one from queue */
324 buf
= list_entry(q
->queue
.next
,struct saa7134_buf
,vb
.queue
);
325 dprintk("buffer_next %p [prev=%p/next=%p]\n",
326 buf
,q
->queue
.prev
,q
->queue
.next
);
327 list_del(&buf
->vb
.queue
);
328 if (!list_empty(&q
->queue
))
329 next
= list_entry(q
->queue
.next
,struct saa7134_buf
,
332 buf
->activate(dev
,buf
,next
);
333 dprintk("buffer_next #2 prev=%p/next=%p\n",
334 q
->queue
.prev
,q
->queue
.next
);
336 /* nothing to do -- just stop DMA */
337 dprintk("buffer_next %p\n",NULL
);
338 saa7134_set_dmabits(dev
);
339 del_timer(&q
->timeout
);
341 if (card_has_mpeg(dev
))
343 saa7134_ts_stop(dev
);
347 void saa7134_buffer_timeout(unsigned long data
)
349 struct saa7134_dmaqueue
*q
= (struct saa7134_dmaqueue
*)data
;
350 struct saa7134_dev
*dev
= q
->dev
;
353 spin_lock_irqsave(&dev
->slock
,flags
);
355 /* try to reset the hardware (SWRST) */
356 saa_writeb(SAA7134_REGION_ENABLE
, 0x00);
357 saa_writeb(SAA7134_REGION_ENABLE
, 0x80);
358 saa_writeb(SAA7134_REGION_ENABLE
, 0x00);
360 /* flag current buffer as failed,
361 try to start over with the next one. */
363 dprintk("timeout on %p\n",q
->curr
);
364 saa7134_buffer_finish(dev
,q
,VIDEOBUF_ERROR
);
366 saa7134_buffer_next(dev
,q
);
367 spin_unlock_irqrestore(&dev
->slock
,flags
);
370 /* ------------------------------------------------------------------ */
372 int saa7134_set_dmabits(struct saa7134_dev
*dev
)
374 u32 split
, task
=0, ctrl
=0, irq
=0;
375 enum v4l2_field cap
= V4L2_FIELD_ANY
;
376 enum v4l2_field ov
= V4L2_FIELD_ANY
;
378 assert_spin_locked(&dev
->slock
);
383 /* video capture -- dma 0 + video task A */
384 if (dev
->video_q
.curr
) {
386 ctrl
|= SAA7134_MAIN_CTRL_TE0
;
387 irq
|= SAA7134_IRQ1_INTE_RA0_1
|
388 SAA7134_IRQ1_INTE_RA0_0
;
389 cap
= dev
->video_q
.curr
->vb
.field
;
392 /* video capture -- dma 1+2 (planar modes) */
393 if (dev
->video_q
.curr
&&
394 dev
->video_q
.curr
->fmt
->planar
) {
395 ctrl
|= SAA7134_MAIN_CTRL_TE4
|
396 SAA7134_MAIN_CTRL_TE5
;
399 /* screen overlay -- dma 0 + video task B */
402 ctrl
|= SAA7134_MAIN_CTRL_TE1
;
406 /* vbi capture -- dma 0 + vbi task A+B */
407 if (dev
->vbi_q
.curr
) {
409 ctrl
|= SAA7134_MAIN_CTRL_TE2
|
410 SAA7134_MAIN_CTRL_TE3
;
411 irq
|= SAA7134_IRQ1_INTE_RA0_7
|
412 SAA7134_IRQ1_INTE_RA0_6
|
413 SAA7134_IRQ1_INTE_RA0_5
|
414 SAA7134_IRQ1_INTE_RA0_4
;
417 /* audio capture -- dma 3 */
418 if (dev
->dmasound
.dma_running
) {
419 ctrl
|= SAA7134_MAIN_CTRL_TE6
;
420 irq
|= SAA7134_IRQ1_INTE_RA3_1
|
421 SAA7134_IRQ1_INTE_RA3_0
;
424 /* TS capture -- dma 5 */
425 if (dev
->ts_q
.curr
) {
426 ctrl
|= SAA7134_MAIN_CTRL_TE5
;
427 irq
|= SAA7134_IRQ1_INTE_RA2_1
|
428 SAA7134_IRQ1_INTE_RA2_0
;
431 /* set task conditions + field handling */
432 if (V4L2_FIELD_HAS_BOTH(cap
) || V4L2_FIELD_HAS_BOTH(ov
) || cap
== ov
) {
433 /* default config -- use full frames */
434 saa_writeb(SAA7134_TASK_CONDITIONS(TASK_A
), 0x0d);
435 saa_writeb(SAA7134_TASK_CONDITIONS(TASK_B
), 0x0d);
436 saa_writeb(SAA7134_FIELD_HANDLING(TASK_A
), 0x02);
437 saa_writeb(SAA7134_FIELD_HANDLING(TASK_B
), 0x02);
440 /* split fields between tasks */
441 if (V4L2_FIELD_TOP
== cap
) {
442 /* odd A, even B, repeat */
443 saa_writeb(SAA7134_TASK_CONDITIONS(TASK_A
), 0x0d);
444 saa_writeb(SAA7134_TASK_CONDITIONS(TASK_B
), 0x0e);
446 /* odd B, even A, repeat */
447 saa_writeb(SAA7134_TASK_CONDITIONS(TASK_A
), 0x0e);
448 saa_writeb(SAA7134_TASK_CONDITIONS(TASK_B
), 0x0d);
450 saa_writeb(SAA7134_FIELD_HANDLING(TASK_A
), 0x01);
451 saa_writeb(SAA7134_FIELD_HANDLING(TASK_B
), 0x01);
456 saa_writeb(SAA7134_REGION_ENABLE
, task
);
457 saa_writel(SAA7134_IRQ1
, irq
);
458 saa_andorl(SAA7134_MAIN_CTRL
,
459 SAA7134_MAIN_CTRL_TE0
|
460 SAA7134_MAIN_CTRL_TE1
|
461 SAA7134_MAIN_CTRL_TE2
|
462 SAA7134_MAIN_CTRL_TE3
|
463 SAA7134_MAIN_CTRL_TE4
|
464 SAA7134_MAIN_CTRL_TE5
|
465 SAA7134_MAIN_CTRL_TE6
,
467 dprintk("dmabits: task=0x%02x ctrl=0x%02x irq=0x%x split=%s\n",
468 task
, ctrl
, irq
, split
? "no" : "yes");
473 /* ------------------------------------------------------------------ */
474 /* IRQ handler + helpers */
476 static char *irqbits
[] = {
477 "DONE_RA0", "DONE_RA1", "DONE_RA2", "DONE_RA3",
478 "AR", "PE", "PWR_ON", "RDCAP", "INTL", "FIDT", "MMC",
479 "TRIG_ERR", "CONF_ERR", "LOAD_ERR",
480 "GPIO16", "GPIO18", "GPIO22", "GPIO23"
482 #define IRQBITS ARRAY_SIZE(irqbits)
484 static void print_irqstatus(struct saa7134_dev
*dev
, int loop
,
485 unsigned long report
, unsigned long status
)
489 printk(KERN_DEBUG
"%s/irq[%d,%ld]: r=0x%lx s=0x%02lx",
490 dev
->name
,loop
,jiffies
,report
,status
);
491 for (i
= 0; i
< IRQBITS
; i
++) {
492 if (!(report
& (1 << i
)))
494 printk(" %s",irqbits
[i
]);
496 if (report
& SAA7134_IRQ_REPORT_DONE_RA0
) {
497 printk(" | RA0=%s,%s,%s,%ld",
498 (status
& 0x40) ? "vbi" : "video",
499 (status
& 0x20) ? "b" : "a",
500 (status
& 0x10) ? "odd" : "even",
506 static irqreturn_t
saa7134_irq(int irq
, void *dev_id
)
508 struct saa7134_dev
*dev
= (struct saa7134_dev
*) dev_id
;
509 unsigned long report
,status
;
510 int loop
, handled
= 0;
515 for (loop
= 0; loop
< 10; loop
++) {
516 report
= saa_readl(SAA7134_IRQ_REPORT
);
517 status
= saa_readl(SAA7134_IRQ_STATUS
);
519 /* If dmasound support is active and we get a sound report,
520 * mask out the report and let the saa7134-alsa module deal
522 if ((report
& SAA7134_IRQ_REPORT_DONE_RA3
) &&
523 (dev
->dmasound
.priv_data
!= NULL
) )
526 printk(KERN_DEBUG
"%s/irq: preserving DMA sound interrupt\n",
528 report
&= ~SAA7134_IRQ_REPORT_DONE_RA3
;
533 printk(KERN_DEBUG
"%s/irq: no (more) work\n",
539 saa_writel(SAA7134_IRQ_REPORT
,report
);
541 print_irqstatus(dev
,loop
,report
,status
);
544 if ((report
& SAA7134_IRQ_REPORT_RDCAP
) ||
545 (report
& SAA7134_IRQ_REPORT_INTL
))
546 saa7134_irq_video_signalchange(dev
);
549 if ((report
& SAA7134_IRQ_REPORT_DONE_RA0
) &&
550 (status
& 0x60) == 0)
551 saa7134_irq_video_done(dev
,status
);
553 if ((report
& SAA7134_IRQ_REPORT_DONE_RA0
) &&
554 (status
& 0x40) == 0x40)
555 saa7134_irq_vbi_done(dev
,status
);
557 if ((report
& SAA7134_IRQ_REPORT_DONE_RA2
) &&
559 saa7134_irq_ts_done(dev
,status
);
561 if (report
& SAA7134_IRQ_REPORT_GPIO16
) {
562 switch (dev
->has_remote
) {
563 case SAA7134_REMOTE_GPIO
:
566 if (dev
->remote
->mask_keydown
& 0x10000) {
567 saa7134_input_irq(dev
);
571 case SAA7134_REMOTE_I2C
:
572 break; /* FIXME: invoke I2C get_key() */
574 default: /* GPIO16 not used by IR remote */
579 if (report
& SAA7134_IRQ_REPORT_GPIO18
) {
580 switch (dev
->has_remote
) {
581 case SAA7134_REMOTE_GPIO
:
584 if ((dev
->remote
->mask_keydown
& 0x40000) ||
585 (dev
->remote
->mask_keyup
& 0x40000)) {
586 saa7134_input_irq(dev
);
590 case SAA7134_REMOTE_I2C
:
591 break; /* FIXME: invoke I2C get_key() */
593 default: /* GPIO18 not used by IR remote */
600 print_irqstatus(dev
,loop
,report
,status
);
601 if (report
& SAA7134_IRQ_REPORT_PE
) {
602 /* disable all parity error */
603 printk(KERN_WARNING
"%s/irq: looping -- "
604 "clearing PE (parity error!) enable bit\n",dev
->name
);
605 saa_clearl(SAA7134_IRQ2
,SAA7134_IRQ2_INTE_PE
);
606 } else if (report
& SAA7134_IRQ_REPORT_GPIO16
) {
607 /* disable gpio16 IRQ */
608 printk(KERN_WARNING
"%s/irq: looping -- "
609 "clearing GPIO16 enable bit\n",dev
->name
);
610 saa_clearl(SAA7134_IRQ2
, SAA7134_IRQ2_INTE_GPIO16_P
);
611 saa_clearl(SAA7134_IRQ2
, SAA7134_IRQ2_INTE_GPIO16_N
);
612 } else if (report
& SAA7134_IRQ_REPORT_GPIO18
) {
613 /* disable gpio18 IRQs */
614 printk(KERN_WARNING
"%s/irq: looping -- "
615 "clearing GPIO18 enable bit\n",dev
->name
);
616 saa_clearl(SAA7134_IRQ2
, SAA7134_IRQ2_INTE_GPIO18_P
);
617 saa_clearl(SAA7134_IRQ2
, SAA7134_IRQ2_INTE_GPIO18_N
);
619 /* disable all irqs */
620 printk(KERN_WARNING
"%s/irq: looping -- "
621 "clearing all enable bits\n",dev
->name
);
622 saa_writel(SAA7134_IRQ1
,0);
623 saa_writel(SAA7134_IRQ2
,0);
628 return IRQ_RETVAL(handled
);
631 /* ------------------------------------------------------------------ */
633 /* early init (no i2c, no irq) */
635 static int saa7134_hw_enable1(struct saa7134_dev
*dev
)
637 /* RAM FIFO config */
638 saa_writel(SAA7134_FIFO_SIZE
, 0x08070503);
639 saa_writel(SAA7134_THRESHOULD
, 0x02020202);
641 /* enable audio + video processing */
642 saa_writel(SAA7134_MAIN_CTRL
,
643 SAA7134_MAIN_CTRL_VPLLE
|
644 SAA7134_MAIN_CTRL_APLLE
|
645 SAA7134_MAIN_CTRL_EXOSC
|
646 SAA7134_MAIN_CTRL_EVFE1
|
647 SAA7134_MAIN_CTRL_EVFE2
|
648 SAA7134_MAIN_CTRL_ESFE
|
649 SAA7134_MAIN_CTRL_EBDAC
);
652 * Initialize OSS _after_ enabling audio clock PLL and audio processing.
653 * OSS initialization writes to registers via the audio DSP; these
654 * writes will fail unless the audio clock has been started. At worst,
655 * audio will not work.
658 /* enable peripheral devices */
659 saa_writeb(SAA7134_SPECIAL_MODE
, 0x01);
661 /* set vertical line numbering start (vbi needs this) */
662 saa_writeb(SAA7134_SOURCE_TIMING2
, 0x20);
667 static int saa7134_hwinit1(struct saa7134_dev
*dev
)
669 dprintk("hwinit1\n");
671 saa_writel(SAA7134_IRQ1
, 0);
672 saa_writel(SAA7134_IRQ2
, 0);
674 /* Clear any stale IRQ reports */
675 saa_writel(SAA7134_IRQ_REPORT
, saa_readl(SAA7134_IRQ_REPORT
));
677 mutex_init(&dev
->lock
);
678 spin_lock_init(&dev
->slock
);
680 saa7134_track_gpio(dev
,"pre-init");
681 saa7134_video_init1(dev
);
682 saa7134_vbi_init1(dev
);
683 if (card_has_mpeg(dev
))
684 saa7134_ts_init1(dev
);
685 saa7134_input_init1(dev
);
687 saa7134_hw_enable1(dev
);
692 /* late init (with i2c + irq) */
693 static int saa7134_hw_enable2(struct saa7134_dev
*dev
)
696 unsigned int irq2_mask
;
700 SAA7134_IRQ2_INTE_DEC3
|
701 SAA7134_IRQ2_INTE_DEC2
|
702 SAA7134_IRQ2_INTE_DEC1
|
703 SAA7134_IRQ2_INTE_DEC0
|
704 SAA7134_IRQ2_INTE_PE
|
705 SAA7134_IRQ2_INTE_AR
;
707 if (dev
->has_remote
== SAA7134_REMOTE_GPIO
&& dev
->remote
) {
708 if (dev
->remote
->mask_keydown
& 0x10000)
709 irq2_mask
|= SAA7134_IRQ2_INTE_GPIO16_N
;
710 else { /* Allow enabling both IRQ edge triggers */
711 if (dev
->remote
->mask_keydown
& 0x40000)
712 irq2_mask
|= SAA7134_IRQ2_INTE_GPIO18_P
;
713 if (dev
->remote
->mask_keyup
& 0x40000)
714 irq2_mask
|= SAA7134_IRQ2_INTE_GPIO18_N
;
718 if (dev
->has_remote
== SAA7134_REMOTE_I2C
) {
719 request_module("ir-kbd-i2c");
722 saa_writel(SAA7134_IRQ1
, 0);
723 saa_writel(SAA7134_IRQ2
, irq2_mask
);
728 static int saa7134_hwinit2(struct saa7134_dev
*dev
)
731 dprintk("hwinit2\n");
733 saa7134_video_init2(dev
);
734 saa7134_tvaudio_init2(dev
);
736 saa7134_hw_enable2(dev
);
743 static int saa7134_hwfini(struct saa7134_dev
*dev
)
747 if (card_has_mpeg(dev
))
748 saa7134_ts_fini(dev
);
749 saa7134_input_fini(dev
);
750 saa7134_vbi_fini(dev
);
751 saa7134_tvaudio_fini(dev
);
755 static void __devinit
must_configure_manually(int has_eeprom
)
762 "saa7134: Congratulations! Your TV card vendor saved a few\n"
763 "saa7134: cents for a eeprom, thus your pci board has no\n"
764 "saa7134: subsystem ID and I can't identify it automatically\n"
766 "saa7134: I feel better now. Ok, here are the good news:\n"
767 "saa7134: You can use the card=<nr> insmod option to specify\n"
768 "saa7134: which board do you have. The list:\n");
771 "saa7134: Board is currently unknown. You might try to use the card=<nr>\n"
772 "saa7134: insmod option to specify which board do you have, but this is\n"
773 "saa7134: somewhat risky, as might damage your card. It is better to ask\n"
774 "saa7134: for support at linux-media@vger.kernel.org.\n"
775 "saa7134: The supported cards are:\n");
777 for (i
= 0; i
< saa7134_bcount
; i
++) {
778 printk(KERN_WARNING
"saa7134: card=%d -> %-40.40s",
779 i
,saa7134_boards
[i
].name
);
780 for (p
= 0; saa7134_pci_tbl
[p
].driver_data
; p
++) {
781 if (saa7134_pci_tbl
[p
].driver_data
!= i
)
784 saa7134_pci_tbl
[p
].subvendor
,
785 saa7134_pci_tbl
[p
].subdevice
);
791 static struct video_device
*vdev_init(struct saa7134_dev
*dev
,
792 struct video_device
*template,
795 struct video_device
*vfd
;
797 vfd
= video_device_alloc();
801 vfd
->v4l2_dev
= &dev
->v4l2_dev
;
802 vfd
->release
= video_device_release
;
803 vfd
->debug
= video_debug
;
804 snprintf(vfd
->name
, sizeof(vfd
->name
), "%s %s (%s)",
805 dev
->name
, type
, saa7134_boards
[dev
->board
].name
);
806 video_set_drvdata(vfd
, dev
);
810 static void saa7134_unregister_video(struct saa7134_dev
*dev
)
812 if (dev
->video_dev
) {
813 if (video_is_registered(dev
->video_dev
))
814 video_unregister_device(dev
->video_dev
);
816 video_device_release(dev
->video_dev
);
817 dev
->video_dev
= NULL
;
820 if (video_is_registered(dev
->vbi_dev
))
821 video_unregister_device(dev
->vbi_dev
);
823 video_device_release(dev
->vbi_dev
);
826 if (dev
->radio_dev
) {
827 if (video_is_registered(dev
->radio_dev
))
828 video_unregister_device(dev
->radio_dev
);
830 video_device_release(dev
->radio_dev
);
831 dev
->radio_dev
= NULL
;
835 static void mpeg_ops_attach(struct saa7134_mpeg_ops
*ops
,
836 struct saa7134_dev
*dev
)
840 if (NULL
!= dev
->mops
)
842 if (saa7134_boards
[dev
->board
].mpeg
!= ops
->type
)
844 err
= ops
->init(dev
);
850 static void mpeg_ops_detach(struct saa7134_mpeg_ops
*ops
,
851 struct saa7134_dev
*dev
)
853 if (NULL
== dev
->mops
)
855 if (dev
->mops
!= ops
)
857 dev
->mops
->fini(dev
);
861 static int __devinit
saa7134_initdev(struct pci_dev
*pci_dev
,
862 const struct pci_device_id
*pci_id
)
864 struct saa7134_dev
*dev
;
865 struct saa7134_mpeg_ops
*mops
;
868 if (saa7134_devcount
== SAA7134_MAXBOARDS
)
871 dev
= kzalloc(sizeof(*dev
),GFP_KERNEL
);
875 err
= v4l2_device_register(&pci_dev
->dev
, &dev
->v4l2_dev
);
881 if (pci_enable_device(pci_dev
)) {
886 dev
->nr
= saa7134_devcount
;
887 sprintf(dev
->name
,"saa%x[%d]",pci_dev
->device
,dev
->nr
);
890 if (pci_pci_problems
) {
891 if (pci_pci_problems
& PCIPCI_TRITON
)
892 printk(KERN_INFO
"%s: quirk: PCIPCI_TRITON\n", dev
->name
);
893 if (pci_pci_problems
& PCIPCI_NATOMA
)
894 printk(KERN_INFO
"%s: quirk: PCIPCI_NATOMA\n", dev
->name
);
895 if (pci_pci_problems
& PCIPCI_VIAETBF
)
896 printk(KERN_INFO
"%s: quirk: PCIPCI_VIAETBF\n", dev
->name
);
897 if (pci_pci_problems
& PCIPCI_VSFX
)
898 printk(KERN_INFO
"%s: quirk: PCIPCI_VSFX\n",dev
->name
);
899 #ifdef PCIPCI_ALIMAGIK
900 if (pci_pci_problems
& PCIPCI_ALIMAGIK
) {
901 printk(KERN_INFO
"%s: quirk: PCIPCI_ALIMAGIK -- latency fixup\n",
906 if (pci_pci_problems
& (PCIPCI_FAIL
|PCIAGP_FAIL
)) {
907 printk(KERN_INFO
"%s: quirk: this driver and your "
908 "chipset may not work together"
909 " in overlay mode.\n",dev
->name
);
910 if (!saa7134_no_overlay
) {
911 printk(KERN_INFO
"%s: quirk: overlay "
912 "mode will be disabled.\n",
914 saa7134_no_overlay
= 1;
916 printk(KERN_INFO
"%s: quirk: overlay "
917 "mode will be forced. Use this"
918 " option at your own risk.\n",
923 if (UNSET
!= latency
) {
924 printk(KERN_INFO
"%s: setting pci latency timer to %d\n",
926 pci_write_config_byte(pci_dev
, PCI_LATENCY_TIMER
, latency
);
930 pci_read_config_byte(pci_dev
, PCI_CLASS_REVISION
, &dev
->pci_rev
);
931 pci_read_config_byte(pci_dev
, PCI_LATENCY_TIMER
, &dev
->pci_lat
);
932 printk(KERN_INFO
"%s: found at %s, rev: %d, irq: %d, "
933 "latency: %d, mmio: 0x%llx\n", dev
->name
,
934 pci_name(pci_dev
), dev
->pci_rev
, pci_dev
->irq
,
935 dev
->pci_lat
,(unsigned long long)pci_resource_start(pci_dev
,0));
936 pci_set_master(pci_dev
);
937 if (!pci_dma_supported(pci_dev
, DMA_BIT_MASK(32))) {
938 printk("%s: Oops: no 32bit PCI DMA ???\n",dev
->name
);
944 dev
->board
= pci_id
->driver_data
;
945 if (card
[dev
->nr
] >= 0 &&
946 card
[dev
->nr
] < saa7134_bcount
)
947 dev
->board
= card
[dev
->nr
];
948 if (SAA7134_BOARD_UNKNOWN
== dev
->board
)
949 must_configure_manually(0);
950 else if (SAA7134_BOARD_NOAUTO
== dev
->board
) {
951 must_configure_manually(1);
952 dev
->board
= SAA7134_BOARD_UNKNOWN
;
954 dev
->autodetected
= card
[dev
->nr
] != dev
->board
;
955 dev
->tuner_type
= saa7134_boards
[dev
->board
].tuner_type
;
956 dev
->tuner_addr
= saa7134_boards
[dev
->board
].tuner_addr
;
957 dev
->radio_type
= saa7134_boards
[dev
->board
].radio_type
;
958 dev
->radio_addr
= saa7134_boards
[dev
->board
].radio_addr
;
959 dev
->tda9887_conf
= saa7134_boards
[dev
->board
].tda9887_conf
;
960 if (UNSET
!= tuner
[dev
->nr
])
961 dev
->tuner_type
= tuner
[dev
->nr
];
962 printk(KERN_INFO
"%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
963 dev
->name
,pci_dev
->subsystem_vendor
,
964 pci_dev
->subsystem_device
,saa7134_boards
[dev
->board
].name
,
965 dev
->board
, dev
->autodetected
?
966 "autodetected" : "insmod option");
969 if (!request_mem_region(pci_resource_start(pci_dev
,0),
970 pci_resource_len(pci_dev
,0),
973 printk(KERN_ERR
"%s: can't get MMIO memory @ 0x%llx\n",
974 dev
->name
,(unsigned long long)pci_resource_start(pci_dev
,0));
977 dev
->lmmio
= ioremap(pci_resource_start(pci_dev
, 0),
978 pci_resource_len(pci_dev
, 0));
979 dev
->bmmio
= (__u8 __iomem
*)dev
->lmmio
;
980 if (NULL
== dev
->lmmio
) {
982 printk(KERN_ERR
"%s: can't ioremap() MMIO memory\n",
987 /* initialize hardware #1 */
988 saa7134_board_init1(dev
);
989 saa7134_hwinit1(dev
);
992 err
= request_irq(pci_dev
->irq
, saa7134_irq
,
993 IRQF_SHARED
| IRQF_DISABLED
, dev
->name
, dev
);
995 printk(KERN_ERR
"%s: can't get IRQ %d\n",
996 dev
->name
,pci_dev
->irq
);
1000 /* wait a bit, register i2c bus */
1002 saa7134_i2c_register(dev
);
1003 saa7134_board_init2(dev
);
1005 saa7134_hwinit2(dev
);
1007 /* load i2c helpers */
1008 if (card_is_empress(dev
)) {
1009 struct v4l2_subdev
*sd
=
1010 v4l2_i2c_new_subdev(&dev
->v4l2_dev
, &dev
->i2c_adap
,
1012 saa7134_boards
[dev
->board
].empress_addr
, NULL
);
1015 sd
->grp_id
= GRP_EMPRESS
;
1018 if (saa7134_boards
[dev
->board
].rds_addr
) {
1019 struct v4l2_subdev
*sd
;
1021 sd
= v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
1022 &dev
->i2c_adap
, "saa6588",
1023 0, I2C_ADDRS(saa7134_boards
[dev
->board
].rds_addr
));
1025 printk(KERN_INFO
"%s: found RDS decoder\n", dev
->name
);
1030 v4l2_prio_init(&dev
->prio
);
1032 mutex_lock(&saa7134_devlist_lock
);
1033 list_for_each_entry(mops
, &mops_list
, next
)
1034 mpeg_ops_attach(mops
, dev
);
1035 list_add_tail(&dev
->devlist
, &saa7134_devlist
);
1036 mutex_unlock(&saa7134_devlist_lock
);
1038 /* check for signal */
1039 saa7134_irq_video_signalchange(dev
);
1041 if (TUNER_ABSENT
!= dev
->tuner_type
)
1042 saa_call_all(dev
, core
, s_power
, 0);
1044 /* register v4l devices */
1045 if (saa7134_no_overlay
> 0)
1046 printk(KERN_INFO
"%s: Overlay support disabled.\n", dev
->name
);
1048 dev
->video_dev
= vdev_init(dev
,&saa7134_video_template
,"video");
1049 err
= video_register_device(dev
->video_dev
,VFL_TYPE_GRABBER
,
1052 printk(KERN_INFO
"%s: can't register video device\n",
1056 printk(KERN_INFO
"%s: registered device %s [v4l2]\n",
1057 dev
->name
, video_device_node_name(dev
->video_dev
));
1059 dev
->vbi_dev
= vdev_init(dev
, &saa7134_video_template
, "vbi");
1061 err
= video_register_device(dev
->vbi_dev
,VFL_TYPE_VBI
,
1065 printk(KERN_INFO
"%s: registered device %s\n",
1066 dev
->name
, video_device_node_name(dev
->vbi_dev
));
1068 if (card_has_radio(dev
)) {
1069 dev
->radio_dev
= vdev_init(dev
,&saa7134_radio_template
,"radio");
1070 err
= video_register_device(dev
->radio_dev
,VFL_TYPE_RADIO
,
1074 printk(KERN_INFO
"%s: registered device %s\n",
1075 dev
->name
, video_device_node_name(dev
->radio_dev
));
1078 /* everything worked */
1081 if (saa7134_dmasound_init
&& !dev
->dmasound
.priv_data
)
1082 saa7134_dmasound_init(dev
);
1084 request_submodules(dev
);
1088 saa7134_unregister_video(dev
);
1089 saa7134_i2c_unregister(dev
);
1090 free_irq(pci_dev
->irq
, dev
);
1092 saa7134_hwfini(dev
);
1093 iounmap(dev
->lmmio
);
1095 release_mem_region(pci_resource_start(pci_dev
,0),
1096 pci_resource_len(pci_dev
,0));
1098 v4l2_device_unregister(&dev
->v4l2_dev
);
1104 static void __devexit
saa7134_finidev(struct pci_dev
*pci_dev
)
1106 struct v4l2_device
*v4l2_dev
= pci_get_drvdata(pci_dev
);
1107 struct saa7134_dev
*dev
= container_of(v4l2_dev
, struct saa7134_dev
, v4l2_dev
);
1108 struct saa7134_mpeg_ops
*mops
;
1110 flush_request_submodules(dev
);
1112 /* Release DMA sound modules if present */
1113 if (saa7134_dmasound_exit
&& dev
->dmasound
.priv_data
) {
1114 saa7134_dmasound_exit(dev
);
1119 u32 report
= saa_readl(SAA7134_IRQ_REPORT
);
1120 u32 status
= saa_readl(SAA7134_IRQ_STATUS
);
1121 print_irqstatus(dev
,42,report
,status
);
1124 /* disable peripheral devices */
1125 saa_writeb(SAA7134_SPECIAL_MODE
,0);
1127 /* shutdown hardware */
1128 saa_writel(SAA7134_IRQ1
,0);
1129 saa_writel(SAA7134_IRQ2
,0);
1130 saa_writel(SAA7134_MAIN_CTRL
,0);
1132 /* shutdown subsystems */
1133 saa7134_hwfini(dev
);
1136 mutex_lock(&saa7134_devlist_lock
);
1137 list_del(&dev
->devlist
);
1138 list_for_each_entry(mops
, &mops_list
, next
)
1139 mpeg_ops_detach(mops
, dev
);
1140 mutex_unlock(&saa7134_devlist_lock
);
1143 saa7134_i2c_unregister(dev
);
1144 saa7134_unregister_video(dev
);
1147 /* the DMA sound modules should be unloaded before reaching
1148 this, but just in case they are still present... */
1149 if (dev
->dmasound
.priv_data
!= NULL
) {
1150 free_irq(pci_dev
->irq
, &dev
->dmasound
);
1151 dev
->dmasound
.priv_data
= NULL
;
1155 /* release resources */
1156 free_irq(pci_dev
->irq
, dev
);
1157 iounmap(dev
->lmmio
);
1158 release_mem_region(pci_resource_start(pci_dev
,0),
1159 pci_resource_len(pci_dev
,0));
1162 v4l2_device_unregister(&dev
->v4l2_dev
);
1170 /* resends a current buffer in queue after resume */
1171 static int saa7134_buffer_requeue(struct saa7134_dev
*dev
,
1172 struct saa7134_dmaqueue
*q
)
1174 struct saa7134_buf
*buf
, *next
;
1176 assert_spin_locked(&dev
->slock
);
1180 dprintk("buffer_requeue\n");
1185 dprintk("buffer_requeue : resending active buffers \n");
1187 if (!list_empty(&q
->queue
))
1188 next
= list_entry(q
->queue
.next
, struct saa7134_buf
,
1190 buf
->activate(dev
, buf
, next
);
1195 static int saa7134_suspend(struct pci_dev
*pci_dev
, pm_message_t state
)
1197 struct v4l2_device
*v4l2_dev
= pci_get_drvdata(pci_dev
);
1198 struct saa7134_dev
*dev
= container_of(v4l2_dev
, struct saa7134_dev
, v4l2_dev
);
1200 /* disable overlay - apps should enable it explicitly on resume*/
1203 /* Disable interrupts, DMA, and rest of the chip*/
1204 saa_writel(SAA7134_IRQ1
, 0);
1205 saa_writel(SAA7134_IRQ2
, 0);
1206 saa_writel(SAA7134_MAIN_CTRL
, 0);
1209 synchronize_irq(pci_dev
->irq
);
1211 /* ACK interrupts once more, just in case,
1212 since the IRQ handler won't ack them anymore*/
1214 saa_writel(SAA7134_IRQ_REPORT
, saa_readl(SAA7134_IRQ_REPORT
));
1216 /* Disable timeout timers - if we have active buffers, we will
1217 fill them on resume*/
1219 del_timer(&dev
->video_q
.timeout
);
1220 del_timer(&dev
->vbi_q
.timeout
);
1221 del_timer(&dev
->ts_q
.timeout
);
1224 saa7134_ir_stop(dev
);
1226 pci_save_state(pci_dev
);
1227 pci_set_power_state(pci_dev
, pci_choose_state(pci_dev
, state
));
1232 static int saa7134_resume(struct pci_dev
*pci_dev
)
1234 struct v4l2_device
*v4l2_dev
= pci_get_drvdata(pci_dev
);
1235 struct saa7134_dev
*dev
= container_of(v4l2_dev
, struct saa7134_dev
, v4l2_dev
);
1236 unsigned long flags
;
1238 pci_set_power_state(pci_dev
, PCI_D0
);
1239 pci_restore_state(pci_dev
);
1241 /* Do things that are done in saa7134_initdev ,
1242 except of initializing memory structures.*/
1244 saa7134_board_init1(dev
);
1246 /* saa7134_hwinit1 */
1247 if (saa7134_boards
[dev
->board
].video_out
)
1248 saa7134_videoport_init(dev
);
1249 if (card_has_mpeg(dev
))
1250 saa7134_ts_init_hw(dev
);
1252 saa7134_ir_start(dev
);
1253 saa7134_hw_enable1(dev
);
1257 saa7134_board_init2(dev
);
1260 saa7134_set_tvnorm_hw(dev
);
1261 saa7134_tvaudio_setmute(dev
);
1262 saa7134_tvaudio_setvolume(dev
, dev
->ctl_volume
);
1263 saa7134_tvaudio_init(dev
);
1264 saa7134_tvaudio_do_scan(dev
);
1265 saa7134_enable_i2s(dev
);
1266 saa7134_hw_enable2(dev
);
1268 saa7134_irq_video_signalchange(dev
);
1270 /*resume unfinished buffer(s)*/
1271 spin_lock_irqsave(&dev
->slock
, flags
);
1272 saa7134_buffer_requeue(dev
, &dev
->video_q
);
1273 saa7134_buffer_requeue(dev
, &dev
->vbi_q
);
1274 saa7134_buffer_requeue(dev
, &dev
->ts_q
);
1276 /* FIXME: Disable DMA audio sound - temporary till proper support
1279 dev
->dmasound
.dma_running
= 0;
1284 saa7134_set_dmabits(dev
);
1285 spin_unlock_irqrestore(&dev
->slock
, flags
);
1291 /* ----------------------------------------------------------- */
1293 int saa7134_ts_register(struct saa7134_mpeg_ops
*ops
)
1295 struct saa7134_dev
*dev
;
1297 mutex_lock(&saa7134_devlist_lock
);
1298 list_for_each_entry(dev
, &saa7134_devlist
, devlist
)
1299 mpeg_ops_attach(ops
, dev
);
1300 list_add_tail(&ops
->next
,&mops_list
);
1301 mutex_unlock(&saa7134_devlist_lock
);
1305 void saa7134_ts_unregister(struct saa7134_mpeg_ops
*ops
)
1307 struct saa7134_dev
*dev
;
1309 mutex_lock(&saa7134_devlist_lock
);
1310 list_del(&ops
->next
);
1311 list_for_each_entry(dev
, &saa7134_devlist
, devlist
)
1312 mpeg_ops_detach(ops
, dev
);
1313 mutex_unlock(&saa7134_devlist_lock
);
1316 EXPORT_SYMBOL(saa7134_ts_register
);
1317 EXPORT_SYMBOL(saa7134_ts_unregister
);
1319 /* ----------------------------------------------------------- */
1321 static struct pci_driver saa7134_pci_driver
= {
1323 .id_table
= saa7134_pci_tbl
,
1324 .probe
= saa7134_initdev
,
1325 .remove
= __devexit_p(saa7134_finidev
),
1327 .suspend
= saa7134_suspend
,
1328 .resume
= saa7134_resume
1332 static int __init
saa7134_init(void)
1334 INIT_LIST_HEAD(&saa7134_devlist
);
1335 printk(KERN_INFO
"saa7130/34: v4l2 driver version %d.%d.%d loaded\n",
1336 (SAA7134_VERSION_CODE
>> 16) & 0xff,
1337 (SAA7134_VERSION_CODE
>> 8) & 0xff,
1338 SAA7134_VERSION_CODE
& 0xff);
1340 printk(KERN_INFO
"saa7130/34: snapshot date %04d-%02d-%02d\n",
1341 SNAPSHOT
/10000, (SNAPSHOT
/100)%100, SNAPSHOT
%100);
1343 return pci_register_driver(&saa7134_pci_driver
);
1346 static void __exit
saa7134_fini(void)
1348 pci_unregister_driver(&saa7134_pci_driver
);
1351 module_init(saa7134_init
);
1352 module_exit(saa7134_fini
);
1354 /* ----------------------------------------------------------- */
1356 EXPORT_SYMBOL(saa7134_set_gpio
);
1357 EXPORT_SYMBOL(saa7134_boards
);
1359 /* ----------------- for the DMA sound modules --------------- */
1361 EXPORT_SYMBOL(saa7134_dmasound_init
);
1362 EXPORT_SYMBOL(saa7134_dmasound_exit
);
1363 EXPORT_SYMBOL(saa7134_pgtable_free
);
1364 EXPORT_SYMBOL(saa7134_pgtable_build
);
1365 EXPORT_SYMBOL(saa7134_pgtable_alloc
);
1366 EXPORT_SYMBOL(saa7134_set_dmabits
);
1368 /* ----------------------------------------------------------- */