2 bttv-if.c -- old gpio interface to other kernel modules
3 don't use in new code, will go away in 2.7
4 have a look at bttv-gpio.c instead.
6 bttv - Bt848 frame grabber driver
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <linux/module.h>
29 #include <linux/init.h>
30 #include <linux/delay.h>
35 EXPORT_SYMBOL(bttv_get_cardinfo
);
36 EXPORT_SYMBOL(bttv_get_pcidev
);
37 EXPORT_SYMBOL(bttv_get_id
);
38 EXPORT_SYMBOL(bttv_gpio_enable
);
39 EXPORT_SYMBOL(bttv_read_gpio
);
40 EXPORT_SYMBOL(bttv_write_gpio
);
41 EXPORT_SYMBOL(bttv_get_gpio_queue
);
42 EXPORT_SYMBOL(bttv_i2c_call
);
44 /* ----------------------------------------------------------------------- */
45 /* Exported functions - for other modules which want to access the */
46 /* gpio ports (IR for example) */
47 /* see bttv.h for comments */
49 int bttv_get_cardinfo(unsigned int card
, int *type
, unsigned *cardid
)
51 if (card
>= bttv_num
) {
54 *type
= bttvs
[card
].c
.type
;
55 *cardid
= bttvs
[card
].cardid
;
59 struct pci_dev
* bttv_get_pcidev(unsigned int card
)
63 return bttvs
[card
].c
.pci
;
66 int bttv_get_id(unsigned int card
)
68 printk("bttv_get_id is obsolete, use bttv_get_cardinfo instead\n");
69 if (card
>= bttv_num
) {
72 return bttvs
[card
].c
.type
;
76 int bttv_gpio_enable(unsigned int card
, unsigned long mask
, unsigned long data
)
80 if (card
>= bttv_num
) {
85 gpio_inout(mask
,data
);
87 bttv_gpio_tracking(btv
,"extern enable");
91 int bttv_read_gpio(unsigned int card
, unsigned long *data
)
95 if (card
>= bttv_num
) {
105 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
106 because we set direct input on init */
111 int bttv_write_gpio(unsigned int card
, unsigned long mask
, unsigned long data
)
115 if (card
>= bttv_num
) {
121 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
122 because direct input is set on init */
123 gpio_bits(mask
,data
);
125 bttv_gpio_tracking(btv
,"extern write");
129 wait_queue_head_t
* bttv_get_gpio_queue(unsigned int card
)
133 if (card
>= bttv_num
) {
138 if (bttvs
[card
].shutdown
) {