2 $Id: bttv-if.c,v 1.3 2004/10/13 10:39:00 kraxel Exp $
4 bttv-if.c -- old gpio interface to other kernel modules
5 don't use in new code, will go away in 2.7
6 have a look at bttv-gpio.c instead.
8 bttv - Bt848 frame grabber driver
10 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
11 & Marcus Metzler (mocm@thp.uni-koeln.de)
12 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <linux/module.h>
31 #include <linux/init.h>
32 #include <linux/delay.h>
37 EXPORT_SYMBOL(bttv_get_cardinfo);
38 EXPORT_SYMBOL(bttv_get_pcidev);
39 EXPORT_SYMBOL(bttv_get_id);
40 EXPORT_SYMBOL(bttv_gpio_enable);
41 EXPORT_SYMBOL(bttv_read_gpio);
42 EXPORT_SYMBOL(bttv_write_gpio);
43 EXPORT_SYMBOL(bttv_get_gpio_queue);
44 EXPORT_SYMBOL(bttv_i2c_call);
46 /* ----------------------------------------------------------------------- */
47 /* Exported functions - for other modules which want to access the */
48 /* gpio ports (IR for example) */
49 /* see bttv.h for comments */
51 int bttv_get_cardinfo(unsigned int card, int *type, unsigned *cardid)
53 if (card >= bttv_num) {
56 *type = bttvs[card].c.type;
57 *cardid = bttvs[card].cardid;
61 struct pci_dev* bttv_get_pcidev(unsigned int card)
65 return bttvs[card].c.pci;
68 int bttv_get_id(unsigned int card)
70 printk("bttv_get_id is obsolete, use bttv_get_cardinfo instead\n");
71 if (card >= bttv_num) {
74 return bttvs[card].c.type;
78 int bttv_gpio_enable(unsigned int card, unsigned long mask, unsigned long data)
82 if (card >= bttv_num) {
87 gpio_inout(mask,data);
89 bttv_gpio_tracking(btv,"extern enable");
93 int bttv_read_gpio(unsigned int card, unsigned long *data)
97 if (card >= bttv_num) {
107 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
108 because we set direct input on init */
113 int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data)
117 if (card >= bttv_num) {
123 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
124 because direct input is set on init */
125 gpio_bits(mask,data);
127 bttv_gpio_tracking(btv,"extern write");
131 wait_queue_head_t* bttv_get_gpio_queue(unsigned int card)
135 if (card >= bttv_num) {
140 if (bttvs[card].shutdown) {