3 bttv-if.c -- old gpio interface to other kernel modules
4 don't use in new code, will go away in 2.7
5 have a look at bttv-gpio.c instead.
7 bttv - Bt848 frame grabber driver
9 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
10 & Marcus Metzler (mocm@thp.uni-koeln.de)
11 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <linux/module.h>
30 #include <linux/init.h>
31 #include <linux/delay.h>
36 EXPORT_SYMBOL(bttv_get_cardinfo
);
37 EXPORT_SYMBOL(bttv_get_pcidev
);
38 EXPORT_SYMBOL(bttv_get_id
);
39 EXPORT_SYMBOL(bttv_gpio_enable
);
40 EXPORT_SYMBOL(bttv_read_gpio
);
41 EXPORT_SYMBOL(bttv_write_gpio
);
42 EXPORT_SYMBOL(bttv_get_gpio_queue
);
43 EXPORT_SYMBOL(bttv_i2c_call
);
45 /* ----------------------------------------------------------------------- */
46 /* Exported functions - for other modules which want to access the */
47 /* gpio ports (IR for example) */
48 /* see bttv.h for comments */
50 int bttv_get_cardinfo(unsigned int card
, int *type
, unsigned *cardid
)
52 printk("The bttv_* interface is obsolete and will go away,\n"
53 "please use the new, sysfs based interface instead.\n");
54 if (card
>= bttv_num
) {
57 *type
= bttvs
[card
].c
.type
;
58 *cardid
= bttvs
[card
].cardid
;
62 struct pci_dev
* bttv_get_pcidev(unsigned int card
)
66 return bttvs
[card
].c
.pci
;
69 int bttv_get_id(unsigned int card
)
71 printk("The bttv_* interface is obsolete and will go away,\n"
72 "please use the new, sysfs based interface instead.\n");
73 if (card
>= bttv_num
) {
76 return bttvs
[card
].c
.type
;
80 int bttv_gpio_enable(unsigned int card
, unsigned long mask
, unsigned long data
)
84 if (card
>= bttv_num
) {
89 gpio_inout(mask
,data
);
91 bttv_gpio_tracking(btv
,"extern enable");
95 int bttv_read_gpio(unsigned int card
, unsigned long *data
)
99 if (card
>= bttv_num
) {
109 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
110 because we set direct input on init */
115 int bttv_write_gpio(unsigned int card
, unsigned long mask
, unsigned long data
)
119 if (card
>= bttv_num
) {
125 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
126 because direct input is set on init */
127 gpio_bits(mask
,data
);
129 bttv_gpio_tracking(btv
,"extern write");
133 wait_queue_head_t
* bttv_get_gpio_queue(unsigned int card
)
137 if (card
>= bttv_num
) {
142 if (bttvs
[card
].shutdown
) {
148 void bttv_i2c_call(unsigned int card
, unsigned int cmd
, void *arg
)
150 if (card
>= bttv_num
)
152 bttv_call_i2c_clients(&bttvs
[card
], cmd
, arg
);