kernel: remove unused utsname_set_machine()
[unleashed.git] / usr / src / uts / sun4u / sys / i2c / clients / i2c_client.h
blob47149a25bb1d3f971c4f4facb3ad5ff68f6c22d0
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _I2C_CLIENT_H
28 #define _I2C_CLIENT_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
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)
66 * ARGS for I2C_*_MODE
68 #define I2C_NORMAL 0
69 #define I2C_DEBUG 1
72 * ARGS for i2c_bit_t direction
75 #define DIR_NO_CHANGE 0
76 #define DIR_OUTPUT 1
77 #define DIR_INPUT 2
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 {
88 uint8_t value;
89 uint8_t direction;
90 uint8_t dir_mask;
91 } i2c_port_t;
93 typedef struct i2c_bit {
94 uchar_t bit_num;
95 boolean_t bit_value;
96 uint8_t direction;
97 } i2c_bit_t;
99 typedef struct i2c_reg {
100 uint8_t reg_num;
101 int32_t reg_value;
102 } i2c_reg_t;
104 #if defined(_KERNEL)
106 #include <sys/i2c/misc/i2c_svc.h>
108 #endif /* _KERNEL */
110 #ifdef __cplusplus
112 #endif
114 #endif /* _I2C_CLIENT_H */