/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SMBUS_H
#define _SMBUS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Attach flags
*/
/*
* Register offsets
*/
/*
* Bit values for SMB_STS (status) register
*/
/*
* Bit values for the SMB_TYP (command type) register
*/
/*
* Used to or in bit 0 to be 1 for I2C read address.
*/
/*
* The maximum number of times to retry in event of
* a failure.
*/
/*
* If smbus_put() should make sure the buffer is flushed.
*/
/*
* The time in microseconds to wait before the timeout fires
* to protect against an interrupt never arriving.
*/
/*
* Time to wait in microseconds for any transaction before giving up
* ie 10 seconds.
*/
/*
* smbus event mode selection. select poll or interrupt mode
*/
/*
* how long to wait(us) for
* command completion.
*/
/*
* time (us) to wait between
* polls: must be small in comparison
* to the time an an i2c transaction
* takes.
*/
/*
* Scale polling retries so that the total timeout is "SMBUS_POLL_TIMEOUT"
*/
/*
* smbus_ppvt_t contains info that is chip specific
* and is stored on the child's devinfo parent private data.
*/
typedef struct smbus_ppvt {
} smbus_ppvt_t;
typedef struct smbus {
int smbus_attachflags;
int smbus_busy;
int smbus_wait;
int smbus_bus;
int smbus_saved_w_resid;
int smbus_retries;
int smbus_bytes_to_read;
int smbus_poll_complete;
/*
* Boolean:true if
* polling is complete
*/
int smbus_polling;
/*
* Boolean: true if
* driver is polling
*/
int smbus_poll_retries;
/*
* How many
* times we
* have polled
* the status
* register. Not
* to be
* confused with
* "retries",
* which is how
* many times we
* tried after
* an error
*/
} smbus_t;
/*
* smbus_switch return status
*/
#ifdef DEBUG
#else
#define SMBUS_PRINT(a)
#endif
/*
* Other function delcarations
*/
#ifdef __cplusplus
}
#endif
#endif /* _SMBUS_H */