diff options
Diffstat (limited to 'drivers/media/video/usbvision/usbvision-i2c.h')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-i2c.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/media/video/usbvision/usbvision-i2c.h b/drivers/media/video/usbvision/usbvision-i2c.h new file mode 100644 index 000000000000..a2df8dbdac59 --- /dev/null +++ b/drivers/media/video/usbvision/usbvision-i2c.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * I2C_ALGO_USB.H | ||
3 | * i2c algorithm for USB-I2C Bridges | ||
4 | * | ||
5 | * Copyright (c) 1999-2005 Joerg Heckenbach <joerg@heckenbach-aw.de> | ||
6 | * | ||
7 | * This module is part of usbvision driver project. | ||
8 | * Updates to driver completed by Dwaine P. Garden | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
23 | */ | ||
24 | |||
25 | |||
26 | #ifndef I2C_ALGO_USB_H | ||
27 | #define I2C_ALGO_USB_H 1 | ||
28 | |||
29 | #include <linux/i2c.h> | ||
30 | |||
31 | struct i2c_algo_usb_data { | ||
32 | void *data; /* private data for lowlevel routines */ | ||
33 | int (*inb) (void *data, unsigned char addr, char *buf, short len); | ||
34 | int (*outb) (void *data, unsigned char addr, char *buf, short len); | ||
35 | |||
36 | /* local settings */ | ||
37 | int udelay; | ||
38 | int mdelay; | ||
39 | int timeout; | ||
40 | }; | ||
41 | |||
42 | #define I2C_USB_ADAP_MAX 16 | ||
43 | |||
44 | int usbvision_i2c_usb_add_bus(struct i2c_adapter *); | ||
45 | int usbvision_i2c_usb_del_bus(struct i2c_adapter *); | ||
46 | |||
47 | static inline void *i2c_get_algo_usb_data (struct i2c_algo_usb_data *dev) | ||
48 | { | ||
49 | return dev->data; | ||
50 | } | ||
51 | |||
52 | static inline void i2c_set_algo_usb_data (struct i2c_algo_usb_data *dev, void *data) | ||
53 | { | ||
54 | dev->data = data; | ||
55 | } | ||
56 | |||
57 | |||
58 | #endif //I2C_ALGO_USB_H | ||