ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / media / dvb / dvb-core / dvb_i2c.h
1 /*
2  * dvb_i2c.h: i2c interface to get rid of i2c-core.c
3  *
4  * Copyright (C) 2002 Holger Waechtler for convergence integrated media GmbH
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation; either version 2.1
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef _DVB_I2C_H_
22 #define _DVB_I2C_H_
23
24 #include <linux/list.h>
25 #include <linux/i2c.h>
26
27 #include "dvbdev.h"
28
29
30 struct dvb_i2c_bus {
31         struct list_head list_head;
32         int (*xfer) (struct dvb_i2c_bus *i2c, 
33                      const struct i2c_msg msgs[],
34                      int num);
35         void *data;
36         struct dvb_adapter *adapter;
37         int id;
38         struct list_head client_list;
39 };
40
41
42 extern struct dvb_i2c_bus*
43 dvb_register_i2c_bus (int (*xfer) (struct dvb_i2c_bus *i2c,
44                                    const struct i2c_msg *msgs, int num),
45                       void *data,
46                       struct dvb_adapter *adapter,
47                       int id);
48
49 extern
50 void dvb_unregister_i2c_bus (int (*xfer) (struct dvb_i2c_bus *i2c,
51                                           const struct i2c_msg msgs[], int num),
52                              struct dvb_adapter *adapter,
53                              int id);
54
55
56 extern int dvb_register_i2c_device (struct module *owner,
57                                     int (*attach) (struct dvb_i2c_bus *i2c, void **data),
58                                     void (*detach) (struct dvb_i2c_bus *i2c, void *data));
59
60 extern int dvb_unregister_i2c_device (int (*attach) (struct dvb_i2c_bus *i2c, void **data));
61
62 #endif
63