This source file includes following definitions.
- bttv_get_pcidev
- bttv_gpio_enable
- bttv_read_gpio
- bttv_write_gpio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <linux/module.h>
18 #include <linux/init.h>
19 #include <linux/delay.h>
20 #include <asm/io.h>
21
22 #include "bttvp.h"
23
24 EXPORT_SYMBOL(bttv_get_pcidev);
25 EXPORT_SYMBOL(bttv_gpio_enable);
26 EXPORT_SYMBOL(bttv_read_gpio);
27 EXPORT_SYMBOL(bttv_write_gpio);
28
29
30
31
32
33
34 struct pci_dev* bttv_get_pcidev(unsigned int card)
35 {
36 if (card >= bttv_num)
37 return NULL;
38 if (!bttvs[card])
39 return NULL;
40
41 return bttvs[card]->c.pci;
42 }
43
44
45 int bttv_gpio_enable(unsigned int card, unsigned long mask, unsigned long data)
46 {
47 struct bttv *btv;
48
49 if (card >= bttv_num) {
50 return -EINVAL;
51 }
52
53 btv = bttvs[card];
54 if (!btv)
55 return -ENODEV;
56
57 gpio_inout(mask,data);
58 if (bttv_gpio)
59 bttv_gpio_tracking(btv,"extern enable");
60 return 0;
61 }
62
63 int bttv_read_gpio(unsigned int card, unsigned long *data)
64 {
65 struct bttv *btv;
66
67 if (card >= bttv_num) {
68 return -EINVAL;
69 }
70
71 btv = bttvs[card];
72 if (!btv)
73 return -ENODEV;
74
75 if(btv->shutdown) {
76 return -ENODEV;
77 }
78
79
80
81 *data = gpio_read();
82 return 0;
83 }
84
85 int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data)
86 {
87 struct bttv *btv;
88
89 if (card >= bttv_num) {
90 return -EINVAL;
91 }
92
93 btv = bttvs[card];
94 if (!btv)
95 return -ENODEV;
96
97
98
99 gpio_bits(mask,data);
100 if (bttv_gpio)
101 bttv_gpio_tracking(btv,"extern write");
102 return 0;
103 }