i2c_svc.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _I2C_SVC_H
#define _I2C_SVC_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* I2C interface return values
*/
#define I2C_SUCCESS 0
#define I2C_FAILURE -1
#define I2C_INCOMPLETE -2
/*
* Used for flags in i2c_transfer_alloc()
*/
#define I2C_SLEEP 0x01
#define I2C_NOSLEEP 0x02
/*
* Version for i2c_transfer_t.i2c_version
*/
#define I2C_XFER_REV 0
/*
* Version for i2c_svc_t.i2c_nexus_version
*/
#define I2C_NEXUS_REV 0
/*
* Valid transfer flags for i2c_transfer.flags
*/
/*
* Developer's note: i2c_transfer_copyout is sensitive to
* the ordering of i2c_transfer structure fields. If any fields
* are changed, make sure to review i2c_transfer_copyout for
* possible changes.
*
* Fields prefixed with 'I' are input fields passed to the
* i2c_transfer function, while those prefixed with 'O'
* are returned from the transfer function.
*/
typedef struct i2c_transfer {
int i2c_flags; /* I: description of transfer */
typedef struct i2c_client_hdl *i2c_client_hdl_t;
/*
* i2c_nexus_reg is passed to the I2C services module
* through the i2c_nexus_register() interface by the nexus
* driver. It contains a version plus the pointer to
* the functions that I2C services calls.
*/
typedef struct i2c_nexus_reg {
int i2c_nexus_version; /* set to I2C_NEXUS_REV_0 */
/*
* Interfaces for I2C client drivers
*/
/*
* Interfaces for I2C nexus drivers
*/
#ifdef __cplusplus
}
#endif
#endif /* _I2C_SVC_H */