xref: /netbsd-src/sys/dev/i2c/ibmhawkvar.h (revision 48c7d443139f8e6c966991146910eda426d519b7)
1*48c7d443Shannken /* $NetBSD: ibmhawkvar.h,v 1.1 2011/02/14 08:50:39 hannken Exp $ */
2*48c7d443Shannken 
3*48c7d443Shannken /*-
4*48c7d443Shannken  * Copyright (c) 2011 The NetBSD Foundation, Inc.
5*48c7d443Shannken  * All rights reserved.
6*48c7d443Shannken  *
7*48c7d443Shannken  * This code is derived from software contributed to The NetBSD Foundation
8*48c7d443Shannken  * by Juergen Hannken-Illjes.
9*48c7d443Shannken  *
10*48c7d443Shannken  * Redistribution and use in source and binary forms, with or without
11*48c7d443Shannken  * modification, are permitted provided that the following conditions
12*48c7d443Shannken  * are met:
13*48c7d443Shannken  * 1. Redistributions of source code must retain the above copyright
14*48c7d443Shannken  *    notice, this list of conditions and the following disclaimer.
15*48c7d443Shannken  * 2. Redistributions in binary form must reproduce the above copyright
16*48c7d443Shannken  *    notice, this list of conditions and the following disclaimer in the
17*48c7d443Shannken  *    documentation and/or other materials provided with the distribution.
18*48c7d443Shannken  *
19*48c7d443Shannken  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*48c7d443Shannken  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*48c7d443Shannken  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*48c7d443Shannken  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*48c7d443Shannken  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*48c7d443Shannken  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*48c7d443Shannken  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*48c7d443Shannken  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*48c7d443Shannken  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*48c7d443Shannken  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*48c7d443Shannken  * POSSIBILITY OF SUCH DAMAGE.
30*48c7d443Shannken  */
31*48c7d443Shannken 
32*48c7d443Shannken #define IBMHAWK_T_AMBIENT	0
33*48c7d443Shannken #define IBMHAWK_T_CPU		1
34*48c7d443Shannken #define IBMHAWK_V_VOLTAGE	(IBMHAWK_T_CPU+IBMHAWK_MAX_CPU)
35*48c7d443Shannken #define IBMHAWK_F_FAN		(IBMHAWK_V_VOLTAGE+IBMHAWK_MAX_VOLTAGE)
36*48c7d443Shannken #define IBMHAWK_MAX_SENSOR	(IBMHAWK_F_FAN+IBMHAWK_MAX_FAN)
37*48c7d443Shannken 
38*48c7d443Shannken struct ibmhawk_softc {
39*48c7d443Shannken 	device_t sc_dev;
40*48c7d443Shannken 	i2c_tag_t sc_tag;
41*48c7d443Shannken 	i2c_addr_t sc_addr;
42*48c7d443Shannken 	int sc_numcpus;
43*48c7d443Shannken 	int sc_numfans;
44*48c7d443Shannken 	int sc_refresh;
45*48c7d443Shannken 	struct sysmon_envsys *sc_sme;
46*48c7d443Shannken 	struct ibmhawk_sensordata {
47*48c7d443Shannken 		envsys_data_t ihs_edata;
48*48c7d443Shannken 		uint32_t ihs_warnmin;
49*48c7d443Shannken 		uint32_t ihs_warnmax;
50*48c7d443Shannken 	} sc_sensordata[IBMHAWK_MAX_SENSOR];
51*48c7d443Shannken };
52