4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Common IOCTL definitions for client drivers.
40 #define I2C_BASE_IOCTL ('M' << 8)
42 #define I2C_GET_PORT (I2C_BASE_IOCTL | 0)
43 #define I2C_SET_PORT (I2C_BASE_IOCTL | 1)
44 #define I2C_GET_BIT (I2C_BASE_IOCTL | 2)
45 #define I2C_SET_BIT (I2C_BASE_IOCTL | 3)
46 #define I2C_GET_REG (I2C_BASE_IOCTL | 4)
47 #define I2C_SET_REG (I2C_BASE_IOCTL | 5)
48 #define I2C_GET_TEMPERATURE (I2C_BASE_IOCTL | 7)
49 #define I2C_GET_FAN_SPEED (I2C_BASE_IOCTL | 8)
50 #define I2C_SET_FAN_SPEED (I2C_BASE_IOCTL | 9)
51 #define I2C_SET_OUTPUT (I2C_BASE_IOCTL | 10)
52 #define I2C_GET_OUTPUT (I2C_BASE_IOCTL | 11)
53 #define I2C_GET_INPUT (I2C_BASE_IOCTL | 12)
54 #define I2C_SET_MODE (I2C_BASE_IOCTL | 13)
55 #define I2C_GET_MODE (I2C_BASE_IOCTL | 14)
58 * A private IOCTL definition to be used by clients. The first 128 ioctls
59 * derived by OR'ing with I2C_BASE_IOCTL are common. The next 128
60 * ioctls derived by OR'ing with I2C_PVT_BASE_IOCTL are client private.
63 #define I2C_PVT_BASE_IOCTL (I2C_BASE_IOCTL + 128)
72 * ARGS for i2c_bit_t direction
75 #define DIR_NO_CHANGE 0
80 #define INST_TO_MINOR(x) (x << 4)
81 #define MINOR_TO_INST(x) ((x & 0xFFFFFFF0) >> 4)
82 #define PORT_TO_MINOR(x) (x)
83 #define MINOR_TO_PORT(x) (0x0F & x)
85 #define I2C_PORT(x) (0x00 + x)
87 typedef struct i2c_port
{
93 typedef struct i2c_bit
{
99 typedef struct i2c_reg
{
106 #include <sys/i2c/misc/i2c_svc.h>
114 #endif /* _I2C_CLIENT_H */