1 // SPDX-License-Identifier: GPL-2.0-or-later
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
17 #include <linux/module.h>
18 #include <linux/init.h>
19 #include <linux/delay.h>
24 EXPORT_SYMBOL(bttv_get_pcidev);
25 EXPORT_SYMBOL(bttv_gpio_enable);
26 EXPORT_SYMBOL(bttv_read_gpio);
27 EXPORT_SYMBOL(bttv_write_gpio);
29 /* ----------------------------------------------------------------------- */
30 /* Exported functions - for other modules which want to access the */
31 /* gpio ports (IR for example) */
32 /* see bttv.h for comments */
34 struct pci_dev* bttv_get_pcidev(unsigned int card)
41 return bttvs[card]->c.pci;
45 int bttv_gpio_enable(unsigned int card, unsigned long mask, unsigned long data)
49 if (card >= bttv_num) {
57 gpio_inout(mask,data);
59 bttv_gpio_tracking(btv,"extern enable");
63 int bttv_read_gpio(unsigned int card, unsigned long *data)
67 if (card >= bttv_num) {
79 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
80 because we set direct input on init */
85 int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data)
89 if (card >= bttv_num) {
97 /* prior setting BT848_GPIO_REG_INP is (probably) not needed
98 because direct input is set on init */
101 bttv_gpio_tracking(btv,"extern write");