1 /* Prototypes and definitions for i2c drivers. */
3 #ifndef _MINIX_I2CDRIVER_H
4 #define _MINIX_I2CDRIVER_H
6 #include <minix/endpoint.h>
10 /* Functions defined by i2cdriver.c: */
11 int i2cdriver_env_parse(uint32_t * bus
, i2c_addr_t
* address
,
12 i2c_addr_t
* valid_addrs
);
13 void i2cdriver_announce(uint32_t bus
);
14 endpoint_t
i2cdriver_bus_endpoint(uint32_t bus
);
15 int i2cdriver_subscribe_bus_updates(uint32_t bus
);
16 void i2cdriver_handle_bus_update(endpoint_t
* bus_endpoint
, uint32_t bus
,
18 int i2cdriver_reserve_device(endpoint_t bus_endpoint
, i2c_addr_t address
);
19 int i2cdriver_exec(endpoint_t bus_endpoint
, minix_i2c_ioctl_exec_t
*ioctl_exec
);
21 int i2creg_raw_read8(endpoint_t bus
, i2c_addr_t addr
, uint8_t * val
);
22 int i2creg_read8(endpoint_t bus
, i2c_addr_t addr
, uint8_t reg
, uint8_t * val
);
23 int i2creg_read16(endpoint_t bus
, i2c_addr_t addr
, uint8_t reg
, uint16_t * val
);
24 int i2creg_read24(endpoint_t bus
, i2c_addr_t addr
, uint8_t reg
, uint32_t * val
);
25 int i2creg_raw_write8(endpoint_t bus
, i2c_addr_t addr
, uint8_t val
);
26 int i2creg_write8(endpoint_t bus
, i2c_addr_t addr
, uint8_t reg
, uint8_t val
);
27 int i2creg_set_bits8(endpoint_t bus
, i2c_addr_t addr
, uint8_t reg
,
29 int i2creg_clear_bits8(endpoint_t bus
, i2c_addr_t addr
, uint8_t reg
,
32 #endif /* _MINIX_I2CDRIVER_H */