XenevaOS
Loading...
Searching...
No Matches
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
33
36};
37
38static 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 */
uint8_t __u8
Definition drm.h:38
uint16_t __u16
Definition drm.h:40
#define I2C_NAME_SIZE
Definition i2c.h:25
#define ENOSYS
Definition kernel.h:310
Definition i2c.h:34
char name[I2C_NAME_SIZE]
Definition i2c.h:35
Definition i2c.h:27
__u16 flags
Definition i2c.h:29
__u16 len
Definition i2c.h:30
__u16 addr
Definition i2c.h:28
__u8 * buf
Definition i2c.h:31