OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [drivers/] [media/] [video/] [i2c-compat.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * some i2c layer compatibility stuff -- to avoid cluttering up the
3
 * i2c modules with tons of #ifdefs
4
 */
5
 
6
 
7
static inline void *i2c_get_adapdata(struct i2c_adapter *dev)
8
{
9
        return dev->data;
10
}
11
 
12
static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
13
{
14
        dev->data = data;
15
}
16
 
17
static inline void *i2c_get_clientdata(struct i2c_client *dev)
18
{
19
        return dev->data;
20
}
21
 
22
static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
23
{
24
        dev->data = data;
25
}
26
 
27
#define I2C_DEVNAME(str)   .name = str
28
 
29
static inline char *i2c_clientname(struct i2c_client *c)
30
{
31
        return c->name;
32
}
33
 
34
static inline void i2c_clients_command(struct i2c_adapter *adap,
35
                                       unsigned int cmd, void *arg)
36
{
37
        int i;
38
 
39
        for (i = 0; i < I2C_CLIENT_MAX; i++) {
40
                if (NULL == adap->clients[i])
41
                        continue;
42
                if (NULL == adap->clients[i]->driver->command)
43
                        continue;
44
                adap->clients[i]->driver->command(adap->clients[i],cmd,arg);
45
        }
46
}
47
 
48
 
49
/*
50
 * Local variables:
51
 * c-basic-offset: 8
52
 * End:
53
 */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.