2 $Id: bttv-if.c,v 1.4 2004/11/17 18:47:47 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 printk("The bttv_* interface is obsolete and will go away,\n"
54 "please use the new, sysfs based interface instead.\n");
55 if (card
>= bttv_num
) {
58 *type
= bttvs
[card
].c
.type
;
59 *cardid
= bttvs
[card
].cardid
;
63 struct pci_dev
* bttv_get_pcidev(unsigned int card
)
67 return bttvs
[card
].c
.pci
;
70 int bttv_get_id(unsigned int card
)
72 printk("The bttv_* interface is obsolete and will go away,\n"
73 "please use the new, sysfs based interface instead.\n");
74 if (card
>= bttv_num
) {
77 return bttvs
[card
].c
.type
;
81 int bttv_gpio_enable(unsigned int card
, unsigned long mask
, unsigned long data
)
85 if (card
>= bttv_num
) {
90 gpio_inout(mask
,data
);
92 bttv_gpio_tracking(btv
,"extern enable");
96 int bttv_read_gpio(unsigned int card
, unsigned long *data
)
100 if (card
>= bttv_num
) {
110 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
111 because we set direct input on init */
116 int bttv_write_gpio(unsigned int card
, unsigned long mask
, unsigned long data
)
120 if (card
>= bttv_num
) {
126 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
127 because direct input is set on init */
128 gpio_bits(mask
,data
);
130 bttv_gpio_tracking(btv
,"extern write");
134 wait_queue_head_t
* bttv_get_gpio_queue(unsigned int card
)
138 if (card
>= bttv_num
) {
143 if (bttvs
[card
].shutdown
) {
149 void bttv_i2c_call(unsigned int card
, unsigned int cmd
, void *arg
)
151 if (card
>= bttv_num
)
153 bttv_call_i2c_clients(&bttvs
[card
], cmd
, arg
);