libi2cdriver: library for i2c device drivers

Change-Id: Ib6d5617e4b62e0bc5b25e6fa92b44baf536b1961
This commit is contained in:
Thomas Cort
2013-07-15 10:29:24 -04:00
parent 3c59273c97
commit 8a643e5128
7 changed files with 228 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ INCS+= acpi.h audio_fw.h bitmap.h \
debug.h devio.h devman.h dmap.h \
driver.h drivers.h drvlib.h ds.h \
endpoint.h fb.h fslib.h gpio.h gcov.h hash.h \
hgfs.h i2c.h ioctl.h input.h ipc.h ipcconst.h \
hgfs.h i2c.h i2cdriver.h ioctl.h input.h ipc.h ipcconst.h \
keymap.h log.h mmio.h mount.h mthread.h minlib.h \
netdriver.h optset.h padconf.h partition.h portio.h \
priv.h procfs.h profile.h queryparam.h \

21
include/minix/i2cdriver.h Normal file
View File

@@ -0,0 +1,21 @@
/* Prototypes and definitions for i2c drivers. */
#ifndef _MINIX_I2CDRIVER_H
#define _MINIX_I2CDRIVER_H
#include <minix/endpoint.h>
#include <minix/i2c.h>
#include <minix/ipc.h>
/* Functions defined by i2cdriver.c: */
int i2cdriver_env_parse(uint32_t * bus, i2c_addr_t * address,
i2c_addr_t * valid_addrs);
void i2cdriver_announce(uint32_t bus);
endpoint_t i2cdriver_bus_endpoint(uint32_t bus);
int i2cdriver_subscribe_bus_updates(uint32_t bus);
void i2cdriver_handle_bus_update(endpoint_t * bus_endpoint, uint32_t bus,
i2c_addr_t address);
int i2cdriver_reserve_device(endpoint_t bus_endpoint, i2c_addr_t address);
int i2cdriver_exec(endpoint_t bus_endpoint, minix_i2c_ioctl_exec_t *ioctl_exec);
#endif /* _MINIX_I2CDRIVER_H */