XenevaOS
Loading...
Searching...
No Matches
XenevaOS
BaseHdr
linux
i2c.h
Go to the documentation of this file.
1
/*
2
* DCL i2c.h -- drm_edid's DDC read path.
3
*
4
* struct i2c_msg matches mainline's layout so drm_edid.c's designated
5
* initializers parse; i2c_transfer() fails with -ENOSYS: there is no i2c
6
* adapter behind vkms (its connector has no ddc, so probe stops before the
7
* transfer) and no i2c anywhere else in this tree's drm set.
8
*
9
* struct i2c_adapter is defined rather than only forward-declared for the one
10
* member drm_edid.c reads: the failure path of drm_ddc_read_agx() logs
11
* "skipping non-existent adapter %s" with adapter->name (drm_edid.c:2209),
12
* which needs the complete type. mainline's adapter is a few dozen members
13
* covering the algo, the locks, the device link and the clock; none of that
14
* is reachable here because no adapter is ever constructed -- i2c_transfer()
15
* below ignores its first argument entirely. The array form of name (rather
16
* than a char *) is mainline's, kept so that when an adapter does arrive the
17
* strscpy() into it still has somewhere to put the bytes.
18
*/
19
#ifndef _LINUX_I2C_H
20
#define _LINUX_I2C_H
21
22
#include <
linux/types.h
>
23
24
#define I2C_M_RD 0x0001
25
#define I2C_NAME_SIZE 50
26
27
struct
i2c_msg
{
28
__u16
addr
;
29
__u16
flags
;
30
__u16
len
;
31
__u8
*
buf
;
32
};
33
34
struct
i2c_adapter
{
35
char
name
[
I2C_NAME_SIZE
];
36
};
37
38
static
inline
int
i2c_transfer(
struct
i2c_adapter
*adap,
struct
i2c_msg
*msgs,
39
int
num)
40
{
41
(void)adap; (void)msgs; (void)num;
42
return
-
ENOSYS
;
43
}
44
45
#endif
/* _LINUX_I2C_H */
types.h
__u8
uint8_t __u8
Definition
drm.h:38
__u16
uint16_t __u16
Definition
drm.h:40
I2C_NAME_SIZE
#define I2C_NAME_SIZE
Definition
i2c.h:25
ENOSYS
#define ENOSYS
Definition
kernel.h:310
i2c_adapter
Definition
i2c.h:34
i2c_adapter::name
char name[I2C_NAME_SIZE]
Definition
i2c.h:35
i2c_msg
Definition
i2c.h:27
i2c_msg::flags
__u16 flags
Definition
i2c.h:29
i2c_msg::len
__u16 len
Definition
i2c.h:30
i2c_msg::addr
__u16 addr
Definition
i2c.h:28
i2c_msg::buf
__u8 * buf
Definition
i2c.h:31
Generated by
1.9.8