/*
* 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 (c) 1999-2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _PCF8591_H
#define _PCF8591_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* PCF8591 Chip Used for temperature sensors
*
* Addressing Register definition.
* A0-A2 valid range is 0-7
*
* ------------------------------------------------
* | 1 | 0 | 0 | 1 | A2 | A1 | A0 | R/W |
* ------------------------------------------------
*/
#define I2C_TYPE_PCF8591 0
#define ENVC_NETRACT_CPU_SENSOR 0
#ifndef I2CDEV_TRAN
#endif
/*
* These are now defined in sys/netract_gen.h
*
* #define ENVC_IOC_GETMODE 0x1C
* #define ENVC_IOC_SETMODE 0x1D
*/
/*
* CONTROL OF CHIP
* PCF8591 Temp sensing control register definitions
*
* ---------------------------------------------
* | 0 | AOE | X | X | 0 | AIF | X | X |
* ---------------------------------------------
* AOE = Analog out enable.. not used on out implementation
* 5 & 4 = Analog Input Programming.. see data sheet for bits..
*
* AIF = Auto increment flag
* bits 1 & 0 are for the Channel number.
*/
/*
* We should be able to select the alalog input
* programming of our choice. By default, the
* alanog input programming is set to Single
* ended. The programmer can issue an ioctl to
* set the input programming mode. We will set
* the auto increment flag set to off, so the lower
* nibble in the control byte will be set to the
* channel number.
*/
/*
* Stage of attachment.
*/
struct pcf8591 {
unsigned int reg_num;
unsigned int reg_value;
};
/*
* Following property information taken from the
* "SPARCengine ASM Reference Manual"
* Property pointers are to DDI allocated space
* which must be freed in the detach() routine.
*/
/*
* for pcf8591_properties_t.channels_in_use->io_dir
*/
#define I2C_PROP_IODIR_IN 0
/*
* for pcf8591_properties_t.channels_in_use->type
*/
#define I2C_PROP_TYPE_NOCARE 0
typedef struct {
typedef struct {
char *name;
char **channels_description;
struct pcf8591_unit {
int instance;
};
#ifdef __cplusplus
}
#endif
#endif /* _PCF8591_H */