xref: /freebsd/sys/powerpc/powermac/powermac_thermal.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
184d77676SNathan Whitehorn /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
371e3c308SPedro F. Giffuni  *
484d77676SNathan Whitehorn  * Copyright (c) 2009-2011 Nathan Whitehorn
584d77676SNathan Whitehorn  * All rights reserved.
684d77676SNathan Whitehorn  *
784d77676SNathan Whitehorn  * Redistribution and use in source and binary forms, with or without
884d77676SNathan Whitehorn  * modification, are permitted provided that the following conditions
984d77676SNathan Whitehorn  * are met:
1084d77676SNathan Whitehorn  * 1. Redistributions of source code must retain the above copyright
1184d77676SNathan Whitehorn  *    notice, this list of conditions and the following disclaimer.
1284d77676SNathan Whitehorn  * 2. Redistributions in binary form must reproduce the above copyright
1384d77676SNathan Whitehorn  *    notice, this list of conditions and the following disclaimer in the
1484d77676SNathan Whitehorn  *    documentation and/or other materials provided with the distribution.
1584d77676SNathan Whitehorn  *
1684d77676SNathan Whitehorn  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1784d77676SNathan Whitehorn  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1884d77676SNathan Whitehorn  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1984d77676SNathan Whitehorn  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2084d77676SNathan Whitehorn  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2184d77676SNathan Whitehorn  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2284d77676SNathan Whitehorn  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2384d77676SNathan Whitehorn  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2484d77676SNathan Whitehorn  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2584d77676SNathan Whitehorn  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2684d77676SNathan Whitehorn  * SUCH DAMAGE.
2784d77676SNathan Whitehorn  */
2884d77676SNathan Whitehorn 
2984d77676SNathan Whitehorn #ifndef _POWERPC_POWERMAC_POWERMAC_THERMAL_H
3084d77676SNathan Whitehorn #define _POWERPC_POWERMAC_POWERMAC_THERMAL_H
3184d77676SNathan Whitehorn 
329d6672e1SLuiz Otavio O Souza #define ZERO_C_TO_K 2731
337736fb18SAndreas Tobler 
3484d77676SNathan Whitehorn struct pmac_fan {
3584d77676SNathan Whitehorn 	int min_rpm, max_rpm, default_rpm;
3684d77676SNathan Whitehorn 
3784d77676SNathan Whitehorn 	char name[32];
3884d77676SNathan Whitehorn 	int zone;
3984d77676SNathan Whitehorn 
4084d77676SNathan Whitehorn 	int (*read)(struct pmac_fan *);
4184d77676SNathan Whitehorn 	int (*set)(struct pmac_fan *, int value);
4284d77676SNathan Whitehorn };
4384d77676SNathan Whitehorn 
4484d77676SNathan Whitehorn struct pmac_therm {
4584d77676SNathan Whitehorn 	int target_temp, max_temp;	/* Tenths of a degree K */
4684d77676SNathan Whitehorn 
4784d77676SNathan Whitehorn 	char name[32];
4884d77676SNathan Whitehorn 	int zone;
4984d77676SNathan Whitehorn 
5084d77676SNathan Whitehorn 	int (*read)(struct pmac_therm *);
5184d77676SNathan Whitehorn };
5284d77676SNathan Whitehorn 
5384d77676SNathan Whitehorn void pmac_thermal_fan_register(struct pmac_fan *);
5484d77676SNathan Whitehorn void pmac_thermal_sensor_register(struct pmac_therm *);
5584d77676SNathan Whitehorn 
5684d77676SNathan Whitehorn #endif
57