2014-02-25 22:30:08 +04:00
|
|
|
/* $NetBSD: dbcool.c,v 1.40 2014/02/25 18:30:09 pooka Exp $ */
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Paul Goyette
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* a driver for the dbCool(tm) family of environmental controllers
|
|
|
|
*
|
|
|
|
* Data sheets for the various supported chips are available at
|
|
|
|
*
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADM1027-D.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADM1030-D.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7463-D.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7466.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7467-D.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7468-D.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7473-D.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7475-D.PDF
|
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7476-D.PDF
|
2008-10-06 05:35:35 +04:00
|
|
|
* http://www.onsemi.com/pub/Collateral/ADT7490-D.PDF
|
2011-03-11 21:38:51 +03:00
|
|
|
* http://www.smsc.com/media/Downloads_Public/Data_Sheets/6d103s.pdf
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
*
|
2008-10-06 05:35:35 +04:00
|
|
|
* (URLs are correct as of October 5, 2008)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
2014-02-25 22:30:08 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.40 2014/02/25 18:30:09 pooka Exp $");
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/device.h>
|
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/sysctl.h>
|
2011-07-31 20:05:01 +04:00
|
|
|
#include <sys/module.h>
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
#include <dev/i2c/dbcool_var.h>
|
|
|
|
#include <dev/i2c/dbcool_reg.h>
|
|
|
|
|
|
|
|
/* Config interface */
|
|
|
|
static int dbcool_match(device_t, cfdata_t, void *);
|
|
|
|
static void dbcool_attach(device_t, device_t, void *);
|
|
|
|
static int dbcool_detach(device_t, int);
|
|
|
|
|
|
|
|
/* Device attributes */
|
|
|
|
static int dbcool_supply_voltage(struct dbcool_softc *);
|
2008-10-06 05:35:35 +04:00
|
|
|
static bool dbcool_islocked(struct dbcool_softc *);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
/* Sensor read functions */
|
|
|
|
static void dbcool_refresh(struct sysmon_envsys *, envsys_data_t *);
|
|
|
|
static int dbcool_read_rpm(struct dbcool_softc *, uint8_t);
|
|
|
|
static int dbcool_read_temp(struct dbcool_softc *, uint8_t, bool);
|
2008-10-06 05:35:35 +04:00
|
|
|
static int dbcool_read_volt(struct dbcool_softc *, uint8_t, int, bool);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
/* Sensor get/set limit functions */
|
|
|
|
static void dbcool_get_limits(struct sysmon_envsys *, envsys_data_t *,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
static void dbcool_get_temp_limits(struct dbcool_softc *, int,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
static void dbcool_get_volt_limits(struct dbcool_softc *, int,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
static void dbcool_get_fan_limits(struct dbcool_softc *, int,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
|
|
|
|
static void dbcool_set_limits(struct sysmon_envsys *, envsys_data_t *,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
static void dbcool_set_temp_limits(struct dbcool_softc *, int,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
static void dbcool_set_volt_limits(struct dbcool_softc *, int,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
static void dbcool_set_fan_limits(struct dbcool_softc *, int,
|
|
|
|
sysmon_envsys_lim_t *, uint32_t *);
|
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
/* SYSCTL Helpers */
|
2011-08-02 18:06:15 +04:00
|
|
|
SYSCTL_SETUP_PROTO(sysctl_dbcoolsetup);
|
2008-10-06 05:35:35 +04:00
|
|
|
static int sysctl_dbcool_temp(SYSCTLFN_PROTO);
|
|
|
|
static int sysctl_adm1030_temp(SYSCTLFN_PROTO);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
static int sysctl_adm1030_trange(SYSCTLFN_PROTO);
|
|
|
|
static int sysctl_dbcool_duty(SYSCTLFN_PROTO);
|
|
|
|
static int sysctl_dbcool_behavior(SYSCTLFN_PROTO);
|
2008-10-06 05:35:35 +04:00
|
|
|
static int sysctl_dbcool_slope(SYSCTLFN_PROTO);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
static int sysctl_dbcool_thyst(SYSCTLFN_PROTO);
|
|
|
|
|
2008-10-06 05:35:35 +04:00
|
|
|
/* Set-up subroutines */
|
2010-03-01 06:14:49 +03:00
|
|
|
static void dbcool_setup_controllers(struct dbcool_softc *);
|
|
|
|
static int dbcool_setup_sensors(struct dbcool_softc *);
|
|
|
|
static int dbcool_attach_sensor(struct dbcool_softc *, int);
|
|
|
|
static int dbcool_attach_temp_control(struct dbcool_softc *, int,
|
|
|
|
struct chip_id *);
|
2008-10-06 05:35:35 +04:00
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
#ifdef DBCOOL_DEBUG
|
|
|
|
static int sysctl_dbcool_reg_select(SYSCTLFN_PROTO);
|
|
|
|
static int sysctl_dbcool_reg_access(SYSCTLFN_PROTO);
|
|
|
|
#endif /* DBCOOL_DEBUG */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Descriptions for SYSCTL entries
|
|
|
|
*/
|
2008-10-06 05:35:35 +04:00
|
|
|
struct dbc_sysctl_info {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
const char *name;
|
|
|
|
const char *desc;
|
2008-10-06 05:35:35 +04:00
|
|
|
bool lockable;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
int (*helper)(SYSCTLFN_PROTO);
|
|
|
|
};
|
|
|
|
|
2008-10-06 05:35:35 +04:00
|
|
|
static struct dbc_sysctl_info dbc_sysctl_table[] = {
|
|
|
|
/*
|
|
|
|
* The first several entries must remain in the same order as the
|
|
|
|
* corresponding entries in enum dbc_pwm_params
|
|
|
|
*/
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "behavior", "operating behavior and temp selector",
|
2008-10-06 05:35:35 +04:00
|
|
|
true, sysctl_dbcool_behavior },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "min_duty", "minimum fan controller PWM duty cycle",
|
2008-10-06 05:35:35 +04:00
|
|
|
true, sysctl_dbcool_duty },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "max_duty", "maximum fan controller PWM duty cycle",
|
2008-10-06 05:35:35 +04:00
|
|
|
true, sysctl_dbcool_duty },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "cur_duty", "current fan controller PWM duty cycle",
|
2008-10-06 05:35:35 +04:00
|
|
|
false, sysctl_dbcool_duty },
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The rest of these should be in the order in which they
|
|
|
|
* are to be stored in the sysctl tree; the table index is
|
|
|
|
* used as the high-order bits of the sysctl_num to maintain
|
|
|
|
* the sequence.
|
|
|
|
*
|
|
|
|
* If you rearrange the order of these items, be sure to
|
|
|
|
* update the sysctl_index in the XXX_sensor_table[] for
|
|
|
|
* the various chips!
|
|
|
|
*/
|
|
|
|
{ "Trange", "temp slope/range to reach 100% duty cycle",
|
|
|
|
true, sysctl_dbcool_slope },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "Tmin", "temp at which to start fan controller",
|
2008-10-06 05:35:35 +04:00
|
|
|
true, sysctl_dbcool_temp },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "Ttherm", "temp at which THERM is asserted",
|
2008-10-06 05:35:35 +04:00
|
|
|
true, sysctl_dbcool_temp },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "Thyst", "temp hysteresis for stopping fan controller",
|
2008-10-06 05:35:35 +04:00
|
|
|
true, sysctl_dbcool_thyst },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ "Tmin", "temp at which to start fan controller",
|
2008-10-06 05:35:35 +04:00
|
|
|
true, sysctl_adm1030_temp },
|
|
|
|
{ "Trange", "temp slope/range to reach 100% duty cycle",
|
|
|
|
true, sysctl_adm1030_trange },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static const char *dbc_sensor_names[] = {
|
2008-10-06 05:35:35 +04:00
|
|
|
"l_temp", "r1_temp", "r2_temp", "Vccp", "Vcc", "fan1",
|
2008-10-10 17:08:29 +04:00
|
|
|
"fan2", "fan3", "fan4", "AIN1", "AIN2", "V2dot5",
|
2010-02-25 02:37:45 +03:00
|
|
|
"V5", "V12", "Vtt", "Imon", "VID"
|
2008-10-06 05:35:35 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Following table derived from product data-sheets
|
|
|
|
*/
|
|
|
|
static int64_t nominal_voltages[] = {
|
|
|
|
-1, /* Vcc can be either 3.3 or 5.0V
|
|
|
|
at 3/4 scale */
|
2008-10-08 02:50:33 +04:00
|
|
|
2249939, /* Vccp 2.25V 3/4 scale */
|
|
|
|
2497436, /* 2.5VIN 2.5V 3/4 scale */
|
|
|
|
5002466, /* 5VIN 5V 3/4 scale */
|
2008-10-06 05:35:35 +04:00
|
|
|
12000000, /* 12VIN 12V 3/4 scale */
|
2008-10-08 02:50:33 +04:00
|
|
|
1690809, /* Vtt, Imon 2.25V full scale */
|
|
|
|
1689600, /* AIN1, AIN2 2.25V full scale */
|
|
|
|
0
|
2008-10-06 05:35:35 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Sensor-type, { val-reg, hilim-reg, lolim-reg}, name-idx, sysctl-table-idx,
|
|
|
|
* nom-voltage-index
|
|
|
|
*/
|
|
|
|
struct dbcool_sensor ADT7490_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_LOCAL_TEMP,
|
|
|
|
DBCOOL_LOCAL_HIGHLIM,
|
|
|
|
DBCOOL_LOCAL_LOWLIM }, 0, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE1_TEMP,
|
|
|
|
DBCOOL_REMOTE1_HIGHLIM,
|
|
|
|
DBCOOL_REMOTE1_LOWLIM }, 1, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE2_TEMP,
|
|
|
|
DBCOOL_REMOTE2_HIGHLIM,
|
|
|
|
DBCOOL_REMOTE2_LOWLIM }, 2, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCCP,
|
|
|
|
DBCOOL_VCCP_HIGHLIM,
|
|
|
|
DBCOOL_VCCP_LOWLIM }, 3, 0, 1 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCC,
|
|
|
|
DBCOOL_VCC_HIGHLIM,
|
|
|
|
DBCOOL_VCC_LOWLIM }, 4, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_25VIN,
|
|
|
|
DBCOOL_25VIN_HIGHLIM,
|
|
|
|
DBCOOL_25VIN_LOWLIM }, 11, 0, 2 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_5VIN,
|
|
|
|
DBCOOL_5VIN_HIGHLIM,
|
|
|
|
DBCOOL_5VIN_LOWLIM }, 12, 0, 3 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_12VIN,
|
|
|
|
DBCOOL_12VIN_HIGHLIM,
|
|
|
|
DBCOOL_12VIN_LOWLIM }, 13, 0, 4 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VTT,
|
|
|
|
DBCOOL_VTT_HIGHLIM,
|
|
|
|
DBCOOL_VTT_LOWLIM }, 14, 0, 5 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_IMON,
|
|
|
|
DBCOOL_IMON_HIGHLIM,
|
|
|
|
DBCOOL_IMON_LOWLIM }, 15, 0, 5 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN1_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH1_MIN_LSB }, 5, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN2_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH2_MIN_LSB }, 6, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN3_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH3_MIN_LSB }, 7, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN4_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH4_MIN_LSB }, 8, 0, 0 },
|
2010-02-25 02:37:45 +03:00
|
|
|
{ DBC_VID, { DBCOOL_VID_REG,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 16, 0, 0 },
|
2008-10-06 05:35:35 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST | 0x80,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 7, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 7, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_R2_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 7, 0 },
|
|
|
|
{ DBC_EOF, { 0, 0, 0 }, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dbcool_sensor ADT7476_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_LOCAL_TEMP,
|
|
|
|
DBCOOL_LOCAL_HIGHLIM,
|
|
|
|
DBCOOL_LOCAL_LOWLIM }, 0, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE1_TEMP,
|
|
|
|
DBCOOL_REMOTE1_HIGHLIM,
|
|
|
|
DBCOOL_REMOTE1_LOWLIM }, 1, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE2_TEMP,
|
|
|
|
DBCOOL_REMOTE2_HIGHLIM,
|
|
|
|
DBCOOL_REMOTE2_LOWLIM }, 2, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCCP,
|
|
|
|
DBCOOL_VCCP_HIGHLIM,
|
|
|
|
DBCOOL_VCCP_LOWLIM }, 3, 0, 1 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCC,
|
|
|
|
DBCOOL_VCC_HIGHLIM,
|
|
|
|
DBCOOL_VCC_LOWLIM }, 4, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_25VIN,
|
|
|
|
DBCOOL_25VIN_HIGHLIM,
|
|
|
|
DBCOOL_25VIN_LOWLIM }, 11, 0, 2 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_5VIN,
|
|
|
|
DBCOOL_5VIN_HIGHLIM,
|
|
|
|
DBCOOL_5VIN_LOWLIM }, 12, 0, 3 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_12VIN,
|
|
|
|
DBCOOL_12VIN_HIGHLIM,
|
|
|
|
DBCOOL_12VIN_LOWLIM }, 13, 0, 4 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN1_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH1_MIN_LSB }, 5, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN2_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH2_MIN_LSB }, 6, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN3_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH3_MIN_LSB }, 7, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN4_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH4_MIN_LSB }, 8, 0, 0 },
|
2010-02-25 02:37:45 +03:00
|
|
|
{ DBC_VID, { DBCOOL_VID_REG,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 16, 0, 0 },
|
2008-10-06 05:35:35 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST | 0x80,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 7, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 7, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_R2_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 7, 0 },
|
|
|
|
{ DBC_EOF, { 0, 0, 0 }, 0, 0, 0 }
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dbcool_sensor ADT7475_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_LOCAL_TEMP,
|
|
|
|
DBCOOL_LOCAL_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_LOCAL_LOWLIM }, 0, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE1_TEMP,
|
|
|
|
DBCOOL_REMOTE1_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_REMOTE1_LOWLIM }, 1, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE2_TEMP,
|
|
|
|
DBCOOL_REMOTE2_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_REMOTE2_LOWLIM }, 2, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCCP,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCOOL_VCCP_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_VCCP_LOWLIM }, 3, 0, 1 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCC,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCOOL_VCC_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_VCC_LOWLIM }, 4, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN1_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH1_MIN_LSB }, 5, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN2_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH2_MIN_LSB }, 6, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN3_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH3_MIN_LSB }, 7, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN4_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH4_MIN_LSB }, 8, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 5, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 6, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST | 0x80,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 7, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 5, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 6, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 7, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 2, 5, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 2, 6, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_R2_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 2, 7, 0 },
|
|
|
|
{ DBC_EOF, { 0, 0, 0 }, 0, 0, 0 }
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
2008-10-06 05:35:35 +04:00
|
|
|
* The registers of dbcool_power_control must be in the same order as
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
* in enum dbc_pwm_params
|
|
|
|
*/
|
|
|
|
struct dbcool_power_control ADT7475_power_table[] = {
|
2008-10-06 05:35:35 +04:00
|
|
|
{ { DBCOOL_PWM1_CTL, DBCOOL_PWM1_MINDUTY,
|
|
|
|
DBCOOL_PWM1_MAXDUTY, DBCOOL_PWM1_CURDUTY },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
"fan_control_1" },
|
2008-10-06 05:35:35 +04:00
|
|
|
{ { DBCOOL_PWM2_CTL, DBCOOL_PWM2_MINDUTY,
|
|
|
|
DBCOOL_PWM2_MAXDUTY, DBCOOL_PWM2_CURDUTY },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
"fan_control_2" },
|
2008-10-06 05:35:35 +04:00
|
|
|
{ { DBCOOL_PWM3_CTL, DBCOOL_PWM3_MINDUTY,
|
|
|
|
DBCOOL_PWM3_MAXDUTY, DBCOOL_PWM3_CURDUTY },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
"fan_control_3" },
|
2008-10-06 05:35:35 +04:00
|
|
|
{ { 0, 0, 0, 0 }, NULL }
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dbcool_sensor ADT7466_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_ADT7466_LCL_TEMP_MSB,
|
|
|
|
DBCOOL_ADT7466_LCL_TEMP_HILIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADT7466_LCL_TEMP_LOLIM }, 0, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_TEMP, { DBCOOL_ADT7466_REM_TEMP_MSB,
|
|
|
|
DBCOOL_ADT7466_REM_TEMP_HILIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADT7466_REM_TEMP_LOLIM }, 1, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_VOLT, { DBCOOL_ADT7466_VCC,
|
|
|
|
DBCOOL_ADT7466_VCC_HILIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADT7466_VCC_LOLIM }, 4, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_VOLT, { DBCOOL_ADT7466_AIN1,
|
|
|
|
DBCOOL_ADT7466_AIN1_HILIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADT7466_AIN1_LOLIM }, 9, 0, 6 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_VOLT, { DBCOOL_ADT7466_AIN2,
|
|
|
|
DBCOOL_ADT7466_AIN2_HILIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADT7466_AIN2_LOLIM }, 10, 0, 6 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_ADT7466_FANA_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADT7466_FANA_LOLIM_LSB }, 5, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_ADT7466_FANB_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADT7466_FANB_LOLIM_LSB }, 6, 0, 0 },
|
|
|
|
{ DBC_EOF, { 0, 0, 0 }, 0, 0, 0 }
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dbcool_sensor ADM1027_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_LOCAL_TEMP,
|
|
|
|
DBCOOL_LOCAL_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_LOCAL_LOWLIM }, 0, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE1_TEMP,
|
|
|
|
DBCOOL_REMOTE1_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_REMOTE1_LOWLIM }, 1, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE2_TEMP,
|
|
|
|
DBCOOL_REMOTE2_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_REMOTE2_LOWLIM }, 2, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCCP,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCOOL_VCCP_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_VCCP_LOWLIM }, 3, 0, 1 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCC,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCOOL_VCC_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_VCC_LOWLIM }, 4, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_VOLT, { DBCOOL_25VIN,
|
|
|
|
DBCOOL_25VIN_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_25VIN_LOWLIM }, 11, 0, 2 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_VOLT, { DBCOOL_5VIN,
|
|
|
|
DBCOOL_5VIN_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_5VIN_LOWLIM }, 12, 0, 3 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_VOLT, { DBCOOL_12VIN,
|
|
|
|
DBCOOL_12VIN_HIGHLIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_12VIN_LOWLIM }, 13, 0, 4 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN1_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH1_MIN_LSB }, 5, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN2_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH2_MIN_LSB }, 6, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN3_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH3_MIN_LSB }, 7, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_FAN4_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_TACH4_MIN_LSB }, 8, 0, 0 },
|
2010-02-25 02:37:45 +03:00
|
|
|
{ DBC_VID, { DBCOOL_VID_REG,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 16, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 5, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 6, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST | 0x80,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 7, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 5, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 6, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_R1_LCL_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 7, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 2, 5, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 2, 6, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_R2_TMIN_HYST,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 2, 7, 0 },
|
|
|
|
{ DBC_EOF, { 0, 0, 0 }, 0, 0, 0 }
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dbcool_sensor ADM1030_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_ADM1030_L_TEMP,
|
|
|
|
DBCOOL_ADM1030_L_HI_LIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADM1030_L_LO_LIM }, 0, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_TEMP, { DBCOOL_ADM1030_R_TEMP,
|
|
|
|
DBCOOL_ADM1030_R_HI_LIM,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADM1030_R_LO_LIM }, 1, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_FAN, { DBCOOL_ADM1030_FAN_TACH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_ADM1030_FAN_LO_LIM }, 5, 0, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_L_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 8, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_L_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 9, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_L_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 0, 6, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_R_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 8, 0 },
|
2010-04-01 08:29:35 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_R_TTHRESH,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 9, 0 },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_R_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBCOOL_NO_REG }, 1, 6, 0 },
|
|
|
|
{ DBC_EOF, {0, 0, 0 }, 0, 0, 0 }
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dbcool_power_control ADM1030_power_table[] = {
|
2008-10-06 05:35:35 +04:00
|
|
|
{ { DBCOOL_ADM1030_CFG1, DBCOOL_NO_REG, DBCOOL_NO_REG,
|
|
|
|
DBCOOL_ADM1030_FAN_SPEED_CFG },
|
|
|
|
"fan_control_1" },
|
|
|
|
{ { 0, 0, 0, 0 }, NULL }
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
};
|
|
|
|
|
2010-04-01 08:29:35 +04:00
|
|
|
struct dbcool_sensor ADM1031_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_ADM1030_L_TEMP,
|
|
|
|
DBCOOL_ADM1030_L_HI_LIM,
|
|
|
|
DBCOOL_ADM1030_L_LO_LIM }, 0, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_ADM1030_R_TEMP,
|
|
|
|
DBCOOL_ADM1030_R_HI_LIM,
|
|
|
|
DBCOOL_ADM1030_R_LO_LIM }, 1, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_ADM1031_R2_TEMP,
|
|
|
|
DBCOOL_ADM1031_R2_HI_LIM,
|
|
|
|
DBCOOL_ADM1031_R2_LO_LIM }, 2, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_ADM1030_FAN_TACH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_ADM1030_FAN_LO_LIM }, 5, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_ADM1031_FAN2_TACH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_ADM1031_FAN2_LO_LIM }, 6, 0, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_L_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 8, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_L_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 9, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_L_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_R_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 8, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_R_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 9, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1030_R_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1031_R2_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 8, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1031_R2_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 9, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_ADM1031_R2_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 6, 0 },
|
|
|
|
{ DBC_EOF, {0, 0, 0 }, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dbcool_power_control ADM1031_power_table[] = {
|
|
|
|
{ { DBCOOL_ADM1030_CFG1, DBCOOL_NO_REG, DBCOOL_NO_REG,
|
|
|
|
DBCOOL_ADM1030_FAN_SPEED_CFG },
|
|
|
|
"fan_control_1" },
|
|
|
|
{ { DBCOOL_ADM1030_CFG1, DBCOOL_NO_REG, DBCOOL_NO_REG,
|
|
|
|
DBCOOL_ADM1030_FAN_SPEED_CFG },
|
|
|
|
"fan_control_2" },
|
|
|
|
{ { 0, 0, 0, 0 }, NULL }
|
|
|
|
};
|
2011-03-11 21:38:51 +03:00
|
|
|
|
|
|
|
struct dbcool_sensor EMC6D103S_sensor_table[] = {
|
|
|
|
{ DBC_TEMP, { DBCOOL_LOCAL_TEMP,
|
|
|
|
DBCOOL_LOCAL_HIGHLIM,
|
|
|
|
DBCOOL_LOCAL_LOWLIM }, 0, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE1_TEMP,
|
|
|
|
DBCOOL_REMOTE1_HIGHLIM,
|
|
|
|
DBCOOL_REMOTE1_LOWLIM }, 1, 0, 0 },
|
|
|
|
{ DBC_TEMP, { DBCOOL_REMOTE2_TEMP,
|
|
|
|
DBCOOL_REMOTE2_HIGHLIM,
|
|
|
|
DBCOOL_REMOTE2_LOWLIM }, 2, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCCP,
|
|
|
|
DBCOOL_VCCP_HIGHLIM,
|
|
|
|
DBCOOL_VCCP_LOWLIM }, 3, 0, 1 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_VCC,
|
|
|
|
DBCOOL_VCC_HIGHLIM,
|
|
|
|
DBCOOL_VCC_LOWLIM }, 4, 0, 0 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_25VIN,
|
|
|
|
DBCOOL_25VIN_HIGHLIM,
|
|
|
|
DBCOOL_25VIN_LOWLIM }, 11, 0, 2 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_5VIN,
|
|
|
|
DBCOOL_5VIN_HIGHLIM,
|
|
|
|
DBCOOL_5VIN_LOWLIM }, 12, 0, 3 },
|
|
|
|
{ DBC_VOLT, { DBCOOL_12VIN,
|
|
|
|
DBCOOL_12VIN_HIGHLIM,
|
|
|
|
DBCOOL_12VIN_LOWLIM }, 13, 0, 4 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN1_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH1_MIN_LSB }, 5, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN2_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH2_MIN_LSB }, 6, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN3_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH3_MIN_LSB }, 7, 0, 0 },
|
|
|
|
{ DBC_FAN, { DBCOOL_FAN4_TACH_LSB,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_TACH4_MIN_LSB }, 8, 0, 0 },
|
|
|
|
{ DBC_VID, { DBCOOL_VID_REG,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 16, 0, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_LOCAL_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 0, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE1_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 1, 6, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TMIN,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 5, 0 },
|
|
|
|
{ DBC_CTL, { DBCOOL_REMOTE2_TTHRESH,
|
|
|
|
DBCOOL_NO_REG,
|
|
|
|
DBCOOL_NO_REG }, 2, 6, 0 },
|
|
|
|
{ DBC_EOF, { 0, 0, 0 }, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
struct chip_id chip_table[] = {
|
2008-10-06 05:35:35 +04:00
|
|
|
{ DBCOOL_COMPANYID, ADT7490_DEVICEID, ADT7490_REV_ID,
|
2010-02-25 02:37:45 +03:00
|
|
|
ADT7490_sensor_table, ADT7475_power_table,
|
|
|
|
DBCFLAG_TEMPOFFSET | DBCFLAG_HAS_MAXDUTY | DBCFLAG_HAS_PECI,
|
2008-10-06 05:35:35 +04:00
|
|
|
90000 * 60, "ADT7490" },
|
|
|
|
{ DBCOOL_COMPANYID, ADT7476_DEVICEID, 0xff,
|
|
|
|
ADT7476_sensor_table, ADT7475_power_table,
|
2010-02-25 02:37:45 +03:00
|
|
|
DBCFLAG_TEMPOFFSET | DBCFLAG_HAS_MAXDUTY,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
90000 * 60, "ADT7476" },
|
|
|
|
{ DBCOOL_COMPANYID, ADT7475_DEVICEID, 0xff,
|
|
|
|
ADT7475_sensor_table, ADT7475_power_table,
|
|
|
|
DBCFLAG_TEMPOFFSET | DBCFLAG_HAS_MAXDUTY | DBCFLAG_HAS_SHDN,
|
|
|
|
90000 * 60, "ADT7475" },
|
2008-10-06 05:35:35 +04:00
|
|
|
{ DBCOOL_COMPANYID, ADT7473_DEVICEID, ADT7473_REV_ID1,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
ADT7475_sensor_table, ADT7475_power_table,
|
|
|
|
DBCFLAG_TEMPOFFSET | DBCFLAG_HAS_MAXDUTY | DBCFLAG_HAS_SHDN,
|
2009-01-14 16:54:29 +03:00
|
|
|
90000 * 60, "ADT7460/ADT7463" },
|
2008-10-06 05:35:35 +04:00
|
|
|
{ DBCOOL_COMPANYID, ADT7473_DEVICEID, ADT7473_REV_ID2,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
ADT7475_sensor_table, ADT7475_power_table,
|
|
|
|
DBCFLAG_TEMPOFFSET | DBCFLAG_HAS_MAXDUTY | DBCFLAG_HAS_SHDN,
|
|
|
|
90000 * 60, "ADT7463-1" },
|
|
|
|
{ DBCOOL_COMPANYID, ADT7468_DEVICEID, 0xff,
|
2008-10-06 05:35:35 +04:00
|
|
|
ADT7476_sensor_table, ADT7475_power_table,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCFLAG_TEMPOFFSET | DBCFLAG_MULTI_VCC | DBCFLAG_HAS_MAXDUTY |
|
2010-02-25 02:37:45 +03:00
|
|
|
DBCFLAG_4BIT_VER | DBCFLAG_HAS_SHDN,
|
2008-10-06 05:35:35 +04:00
|
|
|
90000 * 60, "ADT7467/ADT7468" },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ DBCOOL_COMPANYID, ADT7466_DEVICEID, 0xff,
|
|
|
|
ADT7466_sensor_table, NULL,
|
|
|
|
DBCFLAG_ADT7466 | DBCFLAG_TEMPOFFSET | DBCFLAG_HAS_SHDN,
|
|
|
|
82000 * 60, "ADT7466" },
|
|
|
|
{ DBCOOL_COMPANYID, ADT7463_DEVICEID, ADT7463_REV_ID1,
|
|
|
|
ADM1027_sensor_table, ADT7475_power_table,
|
2010-02-25 02:37:45 +03:00
|
|
|
DBCFLAG_MULTI_VCC | DBCFLAG_4BIT_VER | DBCFLAG_HAS_SHDN,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
90000 * 60, "ADT7463" },
|
|
|
|
{ DBCOOL_COMPANYID, ADT7463_DEVICEID, ADT7463_REV_ID2,
|
|
|
|
ADM1027_sensor_table, ADT7475_power_table,
|
|
|
|
DBCFLAG_MULTI_VCC | DBCFLAG_4BIT_VER | DBCFLAG_HAS_SHDN |
|
2010-02-25 02:37:45 +03:00
|
|
|
DBCFLAG_HAS_VID_SEL,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
90000 * 60, "ADT7463" },
|
|
|
|
{ DBCOOL_COMPANYID, ADM1027_DEVICEID, ADM1027_REV_ID,
|
|
|
|
ADM1027_sensor_table, ADT7475_power_table,
|
2010-02-25 02:37:45 +03:00
|
|
|
DBCFLAG_MULTI_VCC | DBCFLAG_4BIT_VER,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
90000 * 60, "ADM1027" },
|
|
|
|
{ DBCOOL_COMPANYID, ADM1030_DEVICEID, 0xff,
|
|
|
|
ADM1030_sensor_table, ADM1030_power_table,
|
2010-02-25 02:37:45 +03:00
|
|
|
DBCFLAG_ADM1030 | DBCFLAG_NO_READBYTE,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
11250 * 60, "ADM1030" },
|
2010-03-31 22:07:13 +04:00
|
|
|
{ DBCOOL_COMPANYID, ADM1031_DEVICEID, 0xff,
|
2010-04-01 08:29:35 +04:00
|
|
|
ADM1031_sensor_table, ADM1030_power_table,
|
2010-03-31 22:07:13 +04:00
|
|
|
DBCFLAG_ADM1030 | DBCFLAG_NO_READBYTE,
|
|
|
|
11250 * 60, "ADM1031" },
|
2011-03-11 21:38:51 +03:00
|
|
|
{ SMSC_COMPANYID, EMC6D103S_DEVICEID, EMC6D103S_REV_ID,
|
|
|
|
EMC6D103S_sensor_table, ADT7475_power_table,
|
|
|
|
DBCFLAG_4BIT_VER,
|
|
|
|
90000 * 60, "EMC6D103S" },
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{ 0, 0, 0, NULL, NULL, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *behavior[] = {
|
|
|
|
"remote1", "local", "remote2", "full-speed",
|
|
|
|
"disabled", "local+remote2","all-temps", "manual"
|
|
|
|
};
|
|
|
|
|
|
|
|
static char dbcool_cur_behav[16];
|
|
|
|
|
|
|
|
CFATTACH_DECL_NEW(dbcool, sizeof(struct dbcool_softc),
|
|
|
|
dbcool_match, dbcool_attach, dbcool_detach, NULL);
|
|
|
|
|
|
|
|
int
|
|
|
|
dbcool_match(device_t parent, cfdata_t cf, void *aux)
|
|
|
|
{
|
|
|
|
struct i2c_attach_args *ia = aux;
|
2009-11-03 00:37:44 +03:00
|
|
|
struct dbcool_chipset dc;
|
|
|
|
dc.dc_tag = ia->ia_tag;
|
|
|
|
dc.dc_addr = ia->ia_addr;
|
|
|
|
dc.dc_chip = NULL;
|
|
|
|
dc.dc_readreg = dbcool_readreg;
|
|
|
|
dc.dc_writereg = dbcool_writereg;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2008-12-18 23:41:35 +03:00
|
|
|
/* no probing if we attach to iic, but verify chip id and address */
|
|
|
|
if ((ia->ia_addr & DBCOOL_ADDRMASK) != DBCOOL_ADDR)
|
|
|
|
return 0;
|
2009-11-03 00:37:44 +03:00
|
|
|
if (dbcool_chip_ident(&dc) >= 0)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
dbcool_attach(device_t parent, device_t self, void *aux)
|
|
|
|
{
|
|
|
|
struct dbcool_softc *sc = device_private(self);
|
|
|
|
struct i2c_attach_args *args = aux;
|
|
|
|
uint8_t ver;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_addr = args->ia_addr;
|
|
|
|
sc->sc_dc.dc_tag = args->ia_tag;
|
|
|
|
sc->sc_dc.dc_chip = NULL;
|
|
|
|
sc->sc_dc.dc_readreg = dbcool_readreg;
|
|
|
|
sc->sc_dc.dc_writereg = dbcool_writereg;
|
|
|
|
(void)dbcool_chip_ident(&sc->sc_dc);
|
2008-10-06 05:35:35 +04:00
|
|
|
sc->sc_dev = self;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
aprint_naive("\n");
|
|
|
|
aprint_normal("\n");
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
ver = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_REVISION_REG);
|
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_4BIT_VER)
|
2011-03-11 21:38:51 +03:00
|
|
|
if (sc->sc_dc.dc_chip->company == SMSC_COMPANYID)
|
|
|
|
{
|
|
|
|
aprint_normal_dev(self, "SMSC %s Controller "
|
|
|
|
"(rev 0x%02x, stepping 0x%02x)\n", sc->sc_dc.dc_chip->name,
|
|
|
|
ver >> 4, ver & 0x0f);
|
|
|
|
} else {
|
|
|
|
aprint_normal_dev(self, "%s dBCool(tm) Controller "
|
|
|
|
"(rev 0x%02x, stepping 0x%02x)\n", sc->sc_dc.dc_chip->name,
|
|
|
|
ver >> 4, ver & 0x0f);
|
|
|
|
}
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
else
|
|
|
|
aprint_normal_dev(self, "%s dBCool(tm) Controller "
|
2009-11-03 00:37:44 +03:00
|
|
|
"(rev 0x%04x)\n", sc->sc_dc.dc_chip->name, ver);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2011-08-02 18:06:15 +04:00
|
|
|
sc->sc_sysctl_log = NULL;
|
|
|
|
|
|
|
|
#ifdef _MODULE
|
|
|
|
sysctl_dbcoolsetup(&sc->sc_sysctl_log);
|
|
|
|
#endif
|
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
dbcool_setup(self);
|
|
|
|
|
|
|
|
if (!pmf_device_register(self, dbcool_pmf_suspend, dbcool_pmf_resume))
|
|
|
|
aprint_error_dev(self, "couldn't establish power handler\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dbcool_detach(device_t self, int flags)
|
|
|
|
{
|
|
|
|
struct dbcool_softc *sc = device_private(self);
|
|
|
|
|
2011-07-31 20:05:01 +04:00
|
|
|
pmf_device_deregister(self);
|
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
sysmon_envsys_unregister(sc->sc_sme);
|
2011-08-02 18:06:15 +04:00
|
|
|
|
|
|
|
sysctl_teardown(&sc->sc_sysctl_log);
|
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
sc->sc_sme = NULL;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* On suspend, we save the state of the SHDN bit, then set it */
|
2010-02-25 01:37:54 +03:00
|
|
|
bool dbcool_pmf_suspend(device_t dev, const pmf_qual_t *qual)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
struct dbcool_softc *sc = device_private(dev);
|
|
|
|
uint8_t reg, bit, cfg;
|
|
|
|
|
2012-04-28 21:27:08 +04:00
|
|
|
if ((sc->sc_dc.dc_chip->flags & DBCFLAG_HAS_SHDN) == 0)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return true;
|
|
|
|
|
2012-04-28 21:27:08 +04:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg = DBCOOL_ADT7466_CONFIG2;
|
|
|
|
bit = DBCOOL_ADT7466_CFG2_SHDN;
|
|
|
|
} else {
|
|
|
|
reg = DBCOOL_CONFIG2_REG;
|
|
|
|
bit = DBCOOL_CFG2_SHDN;
|
|
|
|
}
|
2009-11-03 00:37:44 +03:00
|
|
|
cfg = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
sc->sc_suspend = cfg & bit;
|
|
|
|
cfg |= bit;
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg, cfg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-09-12 23:46:31 +04:00
|
|
|
/* On resume, we restore the previous state of the SHDN bit (which
|
|
|
|
we saved in sc_suspend) */
|
2010-02-25 01:37:54 +03:00
|
|
|
bool dbcool_pmf_resume(device_t dev, const pmf_qual_t *qual)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
struct dbcool_softc *sc = device_private(dev);
|
2013-09-12 23:46:31 +04:00
|
|
|
uint8_t reg, cfg;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2012-04-28 21:27:08 +04:00
|
|
|
if ((sc->sc_dc.dc_chip->flags & DBCFLAG_HAS_SHDN) == 0)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return true;
|
|
|
|
|
2012-04-28 21:27:08 +04:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg = DBCOOL_ADT7466_CONFIG2;
|
|
|
|
} else {
|
|
|
|
reg = DBCOOL_CONFIG2_REG;
|
|
|
|
}
|
2009-11-03 00:37:44 +03:00
|
|
|
cfg = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
cfg &= ~sc->sc_suspend;
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg, cfg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t
|
2009-11-03 00:37:44 +03:00
|
|
|
dbcool_readreg(struct dbcool_chipset *dc, uint8_t reg)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
uint8_t data = 0;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (iic_acquire_bus(dc->dc_tag, 0) != 0)
|
2009-02-09 23:27:21 +03:00
|
|
|
return data;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2010-02-25 02:37:45 +03:00
|
|
|
if (dc->dc_chip == NULL || dc->dc_chip->flags & DBCFLAG_NO_READBYTE) {
|
2009-02-08 20:48:02 +03:00
|
|
|
/* ADM1027 doesn't support i2c read_byte protocol */
|
2009-11-03 00:37:44 +03:00
|
|
|
if (iic_smbus_send_byte(dc->dc_tag, dc->dc_addr, reg, 0) != 0)
|
2009-02-08 20:48:02 +03:00
|
|
|
goto bad;
|
2009-11-03 00:37:44 +03:00
|
|
|
(void)iic_smbus_receive_byte(dc->dc_tag, dc->dc_addr, &data, 0);
|
2009-02-08 20:48:02 +03:00
|
|
|
} else
|
2009-11-03 00:37:44 +03:00
|
|
|
(void)iic_smbus_read_byte(dc->dc_tag, dc->dc_addr, reg, &data,
|
2009-02-08 20:48:02 +03:00
|
|
|
0);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
bad:
|
2009-11-03 00:37:44 +03:00
|
|
|
iic_release_bus(dc->dc_tag, 0);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-11-03 00:37:44 +03:00
|
|
|
dbcool_writereg(struct dbcool_chipset *dc, uint8_t reg, uint8_t val)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
2009-11-03 00:37:44 +03:00
|
|
|
if (iic_acquire_bus(dc->dc_tag, 0) != 0)
|
2009-02-08 17:34:40 +03:00
|
|
|
return;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
(void)iic_smbus_write_byte(dc->dc_tag, dc->dc_addr, reg, val, 0);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
iic_release_bus(dc->dc_tag, 0);
|
2011-03-11 21:38:51 +03:00
|
|
|
}
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2008-10-06 05:35:35 +04:00
|
|
|
static bool
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
dbcool_islocked(struct dbcool_softc *sc)
|
|
|
|
{
|
|
|
|
uint8_t cfg_reg;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
cfg_reg = DBCOOL_ADT7466_CONFIG1;
|
|
|
|
else
|
|
|
|
cfg_reg = DBCOOL_CONFIG1_REG;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_readreg(&sc->sc_dc, cfg_reg) & DBCOOL_CFG1_LOCK)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dbcool_read_temp(struct dbcool_softc *sc, uint8_t reg, bool extres)
|
|
|
|
{
|
|
|
|
uint8_t t1, t2, t3, val, ext = 0;
|
|
|
|
int temp;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
/*
|
|
|
|
* ADT7466 temps are in strange location
|
|
|
|
*/
|
2009-11-03 00:37:44 +03:00
|
|
|
ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADT7466_CONFIG1);
|
|
|
|
val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
if (extres)
|
2009-11-03 00:37:44 +03:00
|
|
|
ext = sc->sc_dc.dc_readreg(&sc->sc_dc, reg + 1);
|
|
|
|
} else if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
/*
|
|
|
|
* ADM1030 temps are in their own special place, too
|
|
|
|
*/
|
|
|
|
if (extres) {
|
2009-11-03 00:37:44 +03:00
|
|
|
ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADM1030_TEMP_EXTRES);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
if (reg == DBCOOL_ADM1030_L_TEMP)
|
|
|
|
ext >>= 6;
|
2010-04-01 08:29:35 +04:00
|
|
|
else if (reg == DBCOOL_ADM1031_R2_TEMP)
|
|
|
|
ext >>= 4;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
else
|
|
|
|
ext >>= 1;
|
|
|
|
ext &= 0x03;
|
|
|
|
}
|
2009-11-03 00:37:44 +03:00
|
|
|
val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
2008-10-06 05:35:35 +04:00
|
|
|
} else if (extres) {
|
2009-11-03 00:37:44 +03:00
|
|
|
ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_EXTRES2_REG);
|
2008-10-06 05:35:35 +04:00
|
|
|
|
|
|
|
/* Read all msb regs to unlatch them */
|
2009-11-03 00:37:44 +03:00
|
|
|
t1 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_12VIN);
|
|
|
|
t1 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_REMOTE1_TEMP);
|
|
|
|
t2 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_REMOTE2_TEMP);
|
|
|
|
t3 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_LOCAL_TEMP);
|
2008-10-06 05:35:35 +04:00
|
|
|
switch (reg) {
|
|
|
|
case DBCOOL_REMOTE1_TEMP:
|
|
|
|
val = t1;
|
|
|
|
ext >>= 2;
|
|
|
|
break;
|
|
|
|
case DBCOOL_LOCAL_TEMP:
|
|
|
|
val = t3;
|
|
|
|
ext >>= 4;
|
|
|
|
break;
|
|
|
|
case DBCOOL_REMOTE2_TEMP:
|
|
|
|
val = t2;
|
|
|
|
ext >>= 6;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
val = 0;
|
|
|
|
break;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
2008-10-06 05:35:35 +04:00
|
|
|
ext &= 0x03;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
2008-10-06 05:35:35 +04:00
|
|
|
else
|
2009-11-03 00:37:44 +03:00
|
|
|
val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
/* Check for invalid temp values */
|
2008-10-06 05:35:35 +04:00
|
|
|
if ((sc->sc_temp_offset == 0 && val == 0x80) ||
|
|
|
|
(sc->sc_temp_offset != 0 && val == 0))
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* If using offset mode, adjust, else treat as signed */
|
2008-10-06 05:35:35 +04:00
|
|
|
if (sc->sc_temp_offset) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
temp = val;
|
2008-10-06 05:35:35 +04:00
|
|
|
temp -= sc->sc_temp_offset;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
} else
|
|
|
|
temp = (int8_t)val;
|
|
|
|
|
|
|
|
/* Convert degC to uK and include extended precision bits */
|
|
|
|
temp *= 1000000;
|
|
|
|
temp += 250000 * (int)ext;
|
|
|
|
temp += 273150000U;
|
|
|
|
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dbcool_read_rpm(struct dbcool_softc *sc, uint8_t reg)
|
|
|
|
{
|
|
|
|
int rpm;
|
|
|
|
uint8_t rpm_lo, rpm_hi;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
rpm_lo = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
rpm_hi = (rpm_lo == 0xff)?0xff:0x0;
|
|
|
|
else
|
2009-11-03 00:37:44 +03:00
|
|
|
rpm_hi = sc->sc_dc.dc_readreg(&sc->sc_dc, reg + 1);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
rpm = (rpm_hi << 8) | rpm_lo;
|
|
|
|
if (rpm == 0xffff)
|
|
|
|
return 0; /* 0xffff indicates stalled/failed fan */
|
|
|
|
|
2010-04-01 09:26:48 +04:00
|
|
|
/* don't divide by zero */
|
|
|
|
return (rpm == 0)? 0 : (sc->sc_dc.dc_chip->rpm_dividend / rpm);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
|
|
|
|
2008-10-06 05:35:35 +04:00
|
|
|
/* Provide chip's supply voltage, in microvolts */
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
static int
|
|
|
|
dbcool_supply_voltage(struct dbcool_softc *sc)
|
|
|
|
{
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_MULTI_VCC) {
|
|
|
|
if (sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_CONFIG1_REG) & DBCOOL_CFG1_Vcc)
|
2008-10-06 05:35:35 +04:00
|
|
|
return 5002500;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
else
|
2008-10-06 05:35:35 +04:00
|
|
|
return 3300000;
|
2009-11-03 00:37:44 +03:00
|
|
|
} else if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
|
|
|
|
if (sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADT7466_CONFIG1) &
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCOOL_ADT7466_CFG1_Vcc)
|
2008-10-06 05:35:35 +04:00
|
|
|
return 5000000;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
else
|
2008-10-06 05:35:35 +04:00
|
|
|
return 3300000;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
} else
|
2008-10-06 05:35:35 +04:00
|
|
|
return 3300000;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
|
|
|
|
2008-10-06 05:35:35 +04:00
|
|
|
/*
|
|
|
|
* Nominal voltages are calculated in microvolts
|
|
|
|
*/
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
static int
|
2008-10-06 05:35:35 +04:00
|
|
|
dbcool_read_volt(struct dbcool_softc *sc, uint8_t reg, int nom_idx, bool extres)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
uint8_t ext = 0, v1, v2, v3, v4, val;
|
2008-10-06 05:35:35 +04:00
|
|
|
int64_t ret;
|
|
|
|
int64_t nom;
|
|
|
|
|
|
|
|
nom = nominal_voltages[nom_idx];
|
|
|
|
if (nom < 0)
|
|
|
|
nom = sc->sc_supply_voltage;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
/* ADT7466 voltages are in strange locations with only 8-bits */
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466)
|
|
|
|
val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
2008-10-06 05:35:35 +04:00
|
|
|
else
|
|
|
|
/*
|
|
|
|
* It's a "normal" dbCool chip - check for regs that
|
|
|
|
* share extended resolution bits since we have to
|
|
|
|
* read all the MSB registers to unlatch them.
|
|
|
|
*/
|
|
|
|
if (!extres)
|
2009-11-03 00:37:44 +03:00
|
|
|
val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
2008-10-06 05:35:35 +04:00
|
|
|
else if (reg == DBCOOL_12VIN) {
|
2012-04-28 21:27:08 +04:00
|
|
|
ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_EXTRES2_REG) & 0x03;
|
2009-11-03 00:37:44 +03:00
|
|
|
val = sc->sc_dc.dc_readreg(&sc->sc_dc, reg);
|
2008-10-06 05:35:35 +04:00
|
|
|
(void)dbcool_read_temp(sc, DBCOOL_LOCAL_TEMP, true);
|
|
|
|
} else if (reg == DBCOOL_VTT || reg == DBCOOL_IMON) {
|
2009-11-03 00:37:44 +03:00
|
|
|
ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_EXTRES_VTT_IMON);
|
|
|
|
v1 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_IMON);
|
|
|
|
v2 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_VTT);
|
2008-10-06 05:35:35 +04:00
|
|
|
if (reg == DBCOOL_IMON) {
|
|
|
|
val = v1;
|
|
|
|
ext >>= 6;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
} else
|
2008-10-06 05:35:35 +04:00
|
|
|
val = v2;
|
|
|
|
ext >>= 4;
|
|
|
|
ext &= 0x0f;
|
|
|
|
} else {
|
2009-11-03 00:37:44 +03:00
|
|
|
ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_EXTRES1_REG);
|
|
|
|
v1 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_25VIN);
|
|
|
|
v2 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_VCCP);
|
|
|
|
v3 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_VCC);
|
|
|
|
v4 = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_5VIN);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
switch (reg) {
|
|
|
|
case DBCOOL_25VIN:
|
|
|
|
val = v1;
|
|
|
|
break;
|
2008-10-06 05:35:35 +04:00
|
|
|
case DBCOOL_VCCP:
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
val = v2;
|
|
|
|
ext >>= 2;
|
|
|
|
break;
|
2008-10-06 05:35:35 +04:00
|
|
|
case DBCOOL_VCC:
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
val = v3;
|
|
|
|
ext >>= 4;
|
|
|
|
break;
|
|
|
|
case DBCOOL_5VIN:
|
|
|
|
val = v4;
|
|
|
|
ext >>= 6;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
val = nom = 0;
|
|
|
|
}
|
|
|
|
ext &= 0x03;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Scale the nominal value by the 10-bit fraction
|
2008-10-06 05:35:35 +04:00
|
|
|
*
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
* Returned value is in microvolts.
|
|
|
|
*/
|
2008-10-06 05:35:35 +04:00
|
|
|
ret = val;
|
|
|
|
ret <<= 2;
|
|
|
|
ret |= ext;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
ret = (ret * nom) / 0x300;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2008-10-06 05:35:35 +04:00
|
|
|
sysctl_dbcool_temp(SYSCTLFN_ARGS)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error;
|
|
|
|
uint8_t chipreg;
|
|
|
|
uint8_t newreg;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
2008-10-06 05:35:35 +04:00
|
|
|
chipreg = node.sysctl_num & 0xff;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
if (sc->sc_temp_offset) {
|
2009-11-03 00:37:44 +03:00
|
|
|
reg = sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg -= sc->sc_temp_offset;
|
|
|
|
} else
|
2009-11-03 00:37:44 +03:00
|
|
|
reg = (int8_t)sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
/* We were asked to update the value - sanity check before writing */
|
|
|
|
if (*(int *)node.sysctl_data < -64 ||
|
|
|
|
*(int *)node.sysctl_data > 127 + sc->sc_temp_offset)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
newreg = *(int *)node.sysctl_data;
|
|
|
|
newreg += sc->sc_temp_offset;
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2008-10-06 05:35:35 +04:00
|
|
|
sysctl_adm1030_temp(SYSCTLFN_ARGS)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error;
|
|
|
|
uint8_t chipreg, oldreg, newreg;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
2008-10-06 05:35:35 +04:00
|
|
|
chipreg = node.sysctl_num & 0xff;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
oldreg = (int8_t)sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg = (oldreg >> 1) & ~0x03;
|
|
|
|
|
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
/* We were asked to update the value - sanity check before writing */
|
|
|
|
if (*(int *)node.sysctl_data < 0 || *(int *)node.sysctl_data > 127)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
newreg = *(int *)node.sysctl_data;
|
|
|
|
newreg &= ~0x03;
|
|
|
|
newreg <<= 1;
|
|
|
|
newreg |= (oldreg & 0x07);
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
sysctl_adm1030_trange(SYSCTLFN_ARGS)
|
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error, newval;
|
|
|
|
uint8_t chipreg, oldreg, newreg;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
2008-10-06 05:35:35 +04:00
|
|
|
chipreg = node.sysctl_num & 0xff;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
oldreg = (int8_t)sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg = oldreg & 0x07;
|
|
|
|
|
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
/* We were asked to update the value - sanity check before writing */
|
|
|
|
newval = *(int *)node.sysctl_data;
|
|
|
|
|
|
|
|
if (newval == 5)
|
|
|
|
newreg = 0;
|
|
|
|
else if (newval == 10)
|
|
|
|
newreg = 1;
|
|
|
|
else if (newval == 20)
|
|
|
|
newreg = 2;
|
|
|
|
else if (newval == 40)
|
|
|
|
newreg = 3;
|
|
|
|
else if (newval == 80)
|
|
|
|
newreg = 4;
|
|
|
|
else
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
newreg |= (oldreg & ~0x07);
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
sysctl_dbcool_duty(SYSCTLFN_ARGS)
|
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error;
|
|
|
|
uint8_t chipreg, oldreg, newreg;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
2008-10-06 05:35:35 +04:00
|
|
|
chipreg = node.sysctl_num & 0xff;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
oldreg = sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg = (uint32_t)oldreg;
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg = ((reg & 0x0f) * 100) / 15;
|
|
|
|
else
|
|
|
|
reg = (reg * 100) / 255;
|
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
/* We were asked to update the value - sanity check before writing */
|
|
|
|
if (*(int *)node.sysctl_data < 0 || *(int *)node.sysctl_data > 100)
|
|
|
|
return EINVAL;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
newreg = *(uint8_t *)(node.sysctl_data) * 15 / 100;
|
|
|
|
newreg |= oldreg & 0xf0;
|
|
|
|
} else
|
|
|
|
newreg = *(uint8_t *)(node.sysctl_data) * 255 / 100;
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
sysctl_dbcool_behavior(SYSCTLFN_ARGS)
|
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int i, reg, error;
|
|
|
|
uint8_t chipreg, oldreg, newreg;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
2008-10-06 05:35:35 +04:00
|
|
|
chipreg = node.sysctl_num & 0xff;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
oldreg = sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
2008-10-06 05:35:35 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030) {
|
|
|
|
if ((sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADM1030_CFG2) & 1) == 0)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
reg = 4;
|
|
|
|
else if ((oldreg & 0x80) == 0)
|
|
|
|
reg = 7;
|
|
|
|
else if ((oldreg & 0x60) == 0)
|
|
|
|
reg = 4;
|
|
|
|
else
|
|
|
|
reg = 6;
|
|
|
|
} else
|
|
|
|
reg = (oldreg >> 5) & 0x07;
|
|
|
|
|
|
|
|
strlcpy(dbcool_cur_behav, behavior[reg], sizeof(dbcool_cur_behav));
|
|
|
|
node.sysctl_data = dbcool_cur_behav;
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
/* We were asked to update the value - convert string to value */
|
|
|
|
newreg = __arraycount(behavior);
|
|
|
|
for (i = 0; i < __arraycount(behavior); i++)
|
|
|
|
if (strcmp(node.sysctl_data, behavior[i]) == 0)
|
|
|
|
break;
|
|
|
|
if (i >= __arraycount(behavior))
|
|
|
|
return EINVAL;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
/*
|
|
|
|
* ADM1030 splits fan controller behavior across two
|
|
|
|
* registers. We also do not support Auto-Filter mode
|
|
|
|
* nor do we support Manual-RPM-feedback.
|
|
|
|
*/
|
|
|
|
if (newreg == 4) {
|
2009-11-03 00:37:44 +03:00
|
|
|
oldreg = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADM1030_CFG2);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
oldreg &= ~0x01;
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, DBCOOL_ADM1030_CFG2, oldreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
} else {
|
|
|
|
if (newreg == 0)
|
|
|
|
newreg = 4;
|
|
|
|
else if (newreg == 6)
|
|
|
|
newreg = 7;
|
|
|
|
else if (newreg == 7)
|
|
|
|
newreg = 0;
|
|
|
|
else
|
|
|
|
return EINVAL;
|
|
|
|
newreg <<= 5;
|
|
|
|
newreg |= (oldreg & 0x1f);
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
|
|
|
oldreg = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADM1030_CFG2) | 1;
|
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, DBCOOL_ADM1030_CFG2, oldreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
|
|
|
} else {
|
2009-11-03 00:37:44 +03:00
|
|
|
newreg = (sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg) & 0x1f) | (i << 5);
|
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2008-10-06 05:35:35 +04:00
|
|
|
sysctl_dbcool_slope(SYSCTLFN_ARGS)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error;
|
|
|
|
uint8_t chipreg;
|
|
|
|
uint8_t newreg;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
2008-10-06 05:35:35 +04:00
|
|
|
chipreg = node.sysctl_num & 0xff;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
reg = (sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg) >> 4) & 0x0f;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
/* We were asked to update the value - sanity check before writing */
|
|
|
|
if (*(int *)node.sysctl_data < 0 || *(int *)node.sysctl_data > 0x0f)
|
|
|
|
return EINVAL;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
newreg = (sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg) & 0x0f) |
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
(*(int *)node.sysctl_data << 4);
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
sysctl_dbcool_thyst(SYSCTLFN_ARGS)
|
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error;
|
|
|
|
uint8_t chipreg;
|
|
|
|
uint8_t newreg, newhyst;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
|
|
|
chipreg = node.sysctl_num & 0x7f;
|
|
|
|
|
|
|
|
/* retrieve 4-bit value */
|
2009-11-03 00:37:44 +03:00
|
|
|
newreg = sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
if ((node.sysctl_num & 0x80) == 0)
|
|
|
|
reg = newreg >> 4;
|
|
|
|
else
|
|
|
|
reg = newreg;
|
|
|
|
reg = reg & 0x0f;
|
|
|
|
|
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
/* We were asked to update the value - sanity check before writing */
|
|
|
|
newhyst = *(int *)node.sysctl_data;
|
|
|
|
if (newhyst > 0x0f)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
/* Insert new value into field and update register */
|
|
|
|
if ((node.sysctl_num & 0x80) == 0) {
|
|
|
|
newreg &= 0x0f;
|
|
|
|
newreg |= (newhyst << 4);
|
|
|
|
} else {
|
|
|
|
newreg &= 0xf0;
|
|
|
|
newreg |= newhyst;
|
|
|
|
}
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DBCOOL_DEBUG
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These routines can be used for debugging. reg_select is used to
|
|
|
|
* select any arbitrary register in the device. reg_access is used
|
|
|
|
* to read (and optionally update) the selected register.
|
|
|
|
*
|
|
|
|
* No attempt is made to validate the data passed. If you use these
|
|
|
|
* routines, you are assumed to know what you're doing!
|
|
|
|
*
|
|
|
|
* Caveat user
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
sysctl_dbcool_reg_select(SYSCTLFN_ARGS)
|
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
|
|
|
|
|
|
|
reg = sc->sc_user_reg;
|
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
sc->sc_user_reg = *(int *)node.sysctl_data;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
sysctl_dbcool_reg_access(SYSCTLFN_ARGS)
|
|
|
|
{
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct dbcool_softc *sc;
|
|
|
|
int reg, error;
|
|
|
|
uint8_t chipreg;
|
|
|
|
uint8_t newreg;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
sc = (struct dbcool_softc *)node.sysctl_data;
|
|
|
|
chipreg = sc->sc_user_reg;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
reg = sc->sc_dc.dc_readreg(&sc->sc_dc, chipreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
node.sysctl_data = ®
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
newreg = *(int *)node.sysctl_data;
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, chipreg, newreg);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif /* DBCOOL_DEBUG */
|
|
|
|
|
|
|
|
/*
|
2008-10-06 05:35:35 +04:00
|
|
|
* Encode an index number and register number for use as a sysctl_num
|
|
|
|
* so we can select the correct device register later.
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
*/
|
2008-10-06 05:35:35 +04:00
|
|
|
#define DBC_PWM_SYSCTL(seq, reg) ((seq << 8) | reg)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
dbcool_setup(device_t self)
|
|
|
|
{
|
|
|
|
struct dbcool_softc *sc = device_private(self);
|
|
|
|
const struct sysctlnode *me = NULL;
|
2010-02-26 21:16:18 +03:00
|
|
|
#ifdef DBCOOL_DEBUG
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
struct sysctlnode *node = NULL;
|
2010-02-26 21:16:18 +03:00
|
|
|
#endif
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
uint8_t cfg_val, cfg_reg;
|
2010-03-01 06:14:49 +03:00
|
|
|
int ret, error;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Some chips are capable of reporting an extended temperature range
|
|
|
|
* by default. On these models, config register 5 bit 0 can be set
|
|
|
|
* to 1 for compatability with other chips that report 2s complement.
|
|
|
|
*/
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466) {
|
|
|
|
if (sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADT7466_CONFIG1) & 0x80)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
sc->sc_temp_offset = 64;
|
|
|
|
else
|
|
|
|
sc->sc_temp_offset = 0;
|
2009-11-03 00:37:44 +03:00
|
|
|
} else if (sc->sc_dc.dc_chip->flags & DBCFLAG_TEMPOFFSET) {
|
|
|
|
if (sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_CONFIG5_REG) &
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
DBCOOL_CFG5_TWOSCOMP)
|
|
|
|
sc->sc_temp_offset = 0;
|
|
|
|
else
|
|
|
|
sc->sc_temp_offset = 64;
|
|
|
|
} else
|
|
|
|
sc->sc_temp_offset = 0;
|
|
|
|
|
2008-10-06 05:35:35 +04:00
|
|
|
/* Determine Vcc for this chip */
|
|
|
|
sc->sc_supply_voltage = dbcool_supply_voltage(sc);
|
|
|
|
|
2011-08-02 18:06:15 +04:00
|
|
|
ret = sysctl_createv(&sc->sc_sysctl_log, 0, NULL, &me,
|
2008-10-06 05:35:35 +04:00
|
|
|
CTLFLAG_READWRITE,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
CTLTYPE_NODE, device_xname(self), NULL,
|
|
|
|
NULL, 0, NULL, 0,
|
|
|
|
CTL_HW, CTL_CREATE, CTL_EOL);
|
2010-03-01 06:14:49 +03:00
|
|
|
if (ret == 0)
|
|
|
|
sc->sc_root_sysctl_num = me->sysctl_num;
|
|
|
|
else
|
|
|
|
sc->sc_root_sysctl_num = 0;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2010-03-20 22:04:51 +03:00
|
|
|
aprint_debug_dev(self,
|
|
|
|
"Supply voltage %"PRId64".%06"PRId64"V, %s temp range\n",
|
2010-03-20 05:42:19 +03:00
|
|
|
sc->sc_supply_voltage / 1000000,
|
|
|
|
sc->sc_supply_voltage % 1000000,
|
|
|
|
sc->sc_temp_offset ? "extended" : "normal");
|
|
|
|
|
2008-10-06 05:35:35 +04:00
|
|
|
/* Create the sensors for this device */
|
2010-03-01 06:14:49 +03:00
|
|
|
sc->sc_sme = sysmon_envsys_create();
|
|
|
|
if (dbcool_setup_sensors(sc))
|
2008-10-06 05:35:35 +04:00
|
|
|
goto out;
|
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
if (sc->sc_root_sysctl_num != 0) {
|
|
|
|
/* If supported, create sysctl tree for fan PWM controllers */
|
|
|
|
if (sc->sc_dc.dc_chip->power != NULL)
|
|
|
|
dbcool_setup_controllers(sc);
|
|
|
|
|
|
|
|
#ifdef DBCOOL_DEBUG
|
2011-08-02 18:06:15 +04:00
|
|
|
ret = sysctl_createv(&sc->sc_sysctl_log, 0, NULL,
|
2011-08-18 06:08:06 +04:00
|
|
|
(void *)&node,
|
2010-03-01 06:14:49 +03:00
|
|
|
CTLFLAG_READWRITE, CTLTYPE_INT, "reg_select", NULL,
|
|
|
|
sysctl_dbcool_reg_select,
|
2012-06-03 01:36:41 +04:00
|
|
|
0, (void *)sc, sizeof(int),
|
2010-03-01 06:14:49 +03:00
|
|
|
CTL_HW, me->sysctl_num, CTL_CREATE, CTL_EOL);
|
|
|
|
if (node != NULL)
|
|
|
|
node->sysctl_data = sc;
|
|
|
|
|
2011-08-02 18:06:15 +04:00
|
|
|
ret = sysctl_createv(&sc->sc_sysctl_log, 0, NULL,
|
2011-08-18 06:08:06 +04:00
|
|
|
(void *)&node,
|
2010-03-01 06:14:49 +03:00
|
|
|
CTLFLAG_READWRITE, CTLTYPE_INT, "reg_access", NULL,
|
|
|
|
sysctl_dbcool_reg_access,
|
2012-06-03 01:36:41 +04:00
|
|
|
0, (void *)sc, sizeof(int),
|
2010-03-01 06:14:49 +03:00
|
|
|
CTL_HW, me->sysctl_num, CTL_CREATE, CTL_EOL);
|
|
|
|
if (node != NULL)
|
|
|
|
node->sysctl_data = sc;
|
|
|
|
#endif /* DBCOOL_DEBUG */
|
|
|
|
}
|
2008-10-06 05:35:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Read and rewrite config register to activate device
|
|
|
|
*/
|
2009-11-03 00:37:44 +03:00
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030)
|
2008-10-06 05:35:35 +04:00
|
|
|
cfg_reg = DBCOOL_ADM1030_CFG1;
|
2009-11-03 00:37:44 +03:00
|
|
|
else if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADT7466)
|
2008-10-06 05:35:35 +04:00
|
|
|
cfg_reg = DBCOOL_ADT7466_CONFIG1;
|
|
|
|
else
|
|
|
|
cfg_reg = DBCOOL_CONFIG1_REG;
|
2009-11-03 00:37:44 +03:00
|
|
|
cfg_val = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_CONFIG1_REG);
|
2008-10-06 05:35:35 +04:00
|
|
|
if ((cfg_val & DBCOOL_CFG1_START) == 0) {
|
|
|
|
cfg_val |= DBCOOL_CFG1_START;
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, cfg_reg, cfg_val);
|
2008-10-06 05:35:35 +04:00
|
|
|
}
|
|
|
|
if (dbcool_islocked(sc))
|
|
|
|
aprint_normal_dev(self, "configuration locked\n");
|
|
|
|
|
|
|
|
sc->sc_sme->sme_name = device_xname(self);
|
|
|
|
sc->sc_sme->sme_cookie = sc;
|
|
|
|
sc->sc_sme->sme_refresh = dbcool_refresh;
|
2010-03-01 06:14:49 +03:00
|
|
|
sc->sc_sme->sme_set_limits = dbcool_set_limits;
|
|
|
|
sc->sc_sme->sme_get_limits = dbcool_get_limits;
|
2008-10-06 05:35:35 +04:00
|
|
|
|
|
|
|
if ((error = sysmon_envsys_register(sc->sc_sme)) != 0) {
|
|
|
|
aprint_error_dev(self,
|
|
|
|
"unable to register with sysmon (%d)\n", error);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
out:
|
|
|
|
sysmon_envsys_destroy(sc->sc_sme);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-03-01 06:14:49 +03:00
|
|
|
dbcool_setup_sensors(struct dbcool_softc *sc)
|
2008-10-06 05:35:35 +04:00
|
|
|
{
|
2010-03-01 06:14:49 +03:00
|
|
|
int i;
|
2008-10-06 05:35:35 +04:00
|
|
|
int error = 0;
|
2010-03-01 06:14:49 +03:00
|
|
|
uint8_t vid_reg, vid_val;
|
2010-02-25 02:37:45 +03:00
|
|
|
struct chip_id *chip = sc->sc_dc.dc_chip;
|
2008-10-06 05:35:35 +04:00
|
|
|
|
2010-02-25 02:37:45 +03:00
|
|
|
for (i=0; chip->table[i].type != DBC_EOF; i++) {
|
2010-03-01 06:14:49 +03:00
|
|
|
if (i < DBCOOL_MAXSENSORS)
|
|
|
|
sc->sc_sysctl_num[i] = -1;
|
|
|
|
else if (chip->table[i].type != DBC_CTL) {
|
2008-10-06 05:35:35 +04:00
|
|
|
aprint_normal_dev(sc->sc_dev, "chip table too big!\n");
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
break;
|
|
|
|
}
|
2010-02-25 02:37:45 +03:00
|
|
|
switch (chip->table[i].type) {
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
case DBC_TEMP:
|
|
|
|
sc->sc_sensor[i].units = ENVSYS_STEMP;
|
2011-06-21 00:16:19 +04:00
|
|
|
sc->sc_sensor[i].state = ENVSYS_SINVALID;
|
2010-02-25 02:37:45 +03:00
|
|
|
sc->sc_sensor[i].flags |= ENVSYS_FMONLIMITS;
|
2010-03-01 06:14:49 +03:00
|
|
|
error = dbcool_attach_sensor(sc, i);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
break;
|
|
|
|
case DBC_VOLT:
|
2010-02-25 02:37:45 +03:00
|
|
|
/*
|
|
|
|
* If 12V-In pin has been reconfigured as 6th bit
|
|
|
|
* of VID code, don't create a 12V-In sensor
|
|
|
|
*/
|
|
|
|
if ((chip->flags & DBCFLAG_HAS_VID_SEL) &&
|
|
|
|
(chip->table[i].reg.val_reg == DBCOOL_12VIN) &&
|
|
|
|
(sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_VID_REG) &
|
|
|
|
0x80))
|
|
|
|
break;
|
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
sc->sc_sensor[i].units = ENVSYS_SVOLTS_DC;
|
2011-06-21 00:16:19 +04:00
|
|
|
sc->sc_sensor[i].state = ENVSYS_SINVALID;
|
2010-02-25 02:37:45 +03:00
|
|
|
sc->sc_sensor[i].flags |= ENVSYS_FMONLIMITS;
|
2010-03-01 06:14:49 +03:00
|
|
|
error = dbcool_attach_sensor(sc, i);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
break;
|
|
|
|
case DBC_FAN:
|
|
|
|
sc->sc_sensor[i].units = ENVSYS_SFANRPM;
|
2011-06-21 00:16:19 +04:00
|
|
|
sc->sc_sensor[i].state = ENVSYS_SINVALID;
|
2010-02-25 02:37:45 +03:00
|
|
|
sc->sc_sensor[i].flags |= ENVSYS_FMONLIMITS;
|
2010-03-01 06:14:49 +03:00
|
|
|
error = dbcool_attach_sensor(sc, i);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
break;
|
2010-02-25 02:37:45 +03:00
|
|
|
case DBC_VID:
|
|
|
|
sc->sc_sensor[i].units = ENVSYS_INTEGER;
|
2011-06-21 00:16:19 +04:00
|
|
|
sc->sc_sensor[i].state = ENVSYS_SINVALID;
|
2010-02-25 02:37:45 +03:00
|
|
|
sc->sc_sensor[i].flags |= ENVSYS_FMONNOTSUPP;
|
|
|
|
|
|
|
|
/* retrieve 5- or 6-bit value */
|
|
|
|
vid_reg = chip->table[i].reg.val_reg;
|
|
|
|
vid_val = sc->sc_dc.dc_readreg(&sc->sc_dc, vid_reg);
|
|
|
|
if (chip->flags & DBCFLAG_HAS_VID_SEL)
|
|
|
|
vid_val &= 0x3f;
|
|
|
|
else
|
|
|
|
vid_val &= 0x1f;
|
|
|
|
sc->sc_sensor[i].value_cur = vid_val;
|
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
error = dbcool_attach_sensor(sc, i);
|
2010-02-25 02:37:45 +03:00
|
|
|
break;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
case DBC_CTL:
|
2010-03-01 06:14:49 +03:00
|
|
|
error = dbcool_attach_temp_control(sc, i, chip);
|
|
|
|
if (error) {
|
|
|
|
aprint_error_dev(sc->sc_dev,
|
|
|
|
"attach index %d failed %d\n",
|
|
|
|
i, error);
|
|
|
|
error = 0;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2008-10-06 05:35:35 +04:00
|
|
|
aprint_error_dev(sc->sc_dev,
|
|
|
|
"sensor_table index %d has bad type %d\n",
|
2010-02-25 02:37:45 +03:00
|
|
|
i, chip->table[i].type);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
break;
|
|
|
|
}
|
2008-10-06 05:35:35 +04:00
|
|
|
if (error)
|
|
|
|
break;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
2008-10-06 05:35:35 +04:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-03-01 06:14:49 +03:00
|
|
|
dbcool_attach_sensor(struct dbcool_softc *sc, int idx)
|
2008-10-06 05:35:35 +04:00
|
|
|
{
|
|
|
|
int name_index;
|
|
|
|
int error = 0;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
name_index = sc->sc_dc.dc_chip->table[idx].name_index;
|
2008-10-06 05:35:35 +04:00
|
|
|
strlcpy(sc->sc_sensor[idx].desc, dbc_sensor_names[name_index],
|
|
|
|
sizeof(sc->sc_sensor[idx].desc));
|
2009-11-03 00:37:44 +03:00
|
|
|
sc->sc_regs[idx] = &sc->sc_dc.dc_chip->table[idx].reg;
|
|
|
|
sc->sc_nom_volt[idx] = sc->sc_dc.dc_chip->table[idx].nom_volt_index;
|
2008-10-06 05:35:35 +04:00
|
|
|
|
|
|
|
error = sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor[idx]);
|
2010-03-01 06:14:49 +03:00
|
|
|
return error;
|
|
|
|
}
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
static int
|
|
|
|
dbcool_attach_temp_control(struct dbcool_softc *sc, int idx,
|
|
|
|
struct chip_id *chip)
|
|
|
|
{
|
2011-08-02 02:42:57 +04:00
|
|
|
const struct sysctlnode *me2 = NULL, *node;
|
2010-03-01 06:14:49 +03:00
|
|
|
int j, ret, sysctl_index, rw_flag;
|
|
|
|
uint8_t sysctl_reg;
|
|
|
|
char name[SYSCTL_NAMELEN];
|
2008-10-06 05:35:35 +04:00
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
/* Search for the corresponding temp sensor */
|
|
|
|
for (j = 0; j < idx; j++) {
|
|
|
|
if (j >= DBCOOL_MAXSENSORS || chip->table[j].type != DBC_TEMP)
|
|
|
|
continue;
|
|
|
|
if (chip->table[j].name_index == chip->table[idx].name_index)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (j >= idx) /* Temp sensor not found */
|
|
|
|
return ENOENT;
|
|
|
|
|
|
|
|
/* create sysctl node for the sensor if not one already there */
|
|
|
|
if (sc->sc_sysctl_num[j] == -1) {
|
2011-08-02 18:06:15 +04:00
|
|
|
ret = sysctl_createv(&sc->sc_sysctl_log, 0, NULL, &me2,
|
|
|
|
CTLFLAG_READWRITE,
|
2010-03-01 06:14:49 +03:00
|
|
|
CTLTYPE_NODE, sc->sc_sensor[j].desc, NULL,
|
|
|
|
NULL, 0, NULL, 0,
|
|
|
|
CTL_HW, sc->sc_root_sysctl_num, CTL_CREATE,
|
|
|
|
CTL_EOL);
|
|
|
|
if (me2 != NULL)
|
|
|
|
sc->sc_sysctl_num[j] = me2->sysctl_num;
|
|
|
|
else
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
/* add sysctl leaf node for this control variable */
|
|
|
|
sysctl_index = chip->table[idx].sysctl_index;
|
|
|
|
sysctl_reg = chip->table[idx].reg.val_reg;
|
|
|
|
strlcpy(name, dbc_sysctl_table[sysctl_index].name, sizeof(name));
|
|
|
|
if (dbc_sysctl_table[sysctl_index].lockable && dbcool_islocked(sc))
|
|
|
|
rw_flag = CTLFLAG_READONLY | CTLFLAG_OWNDESC;
|
|
|
|
else
|
|
|
|
rw_flag = CTLFLAG_READWRITE | CTLFLAG_OWNDESC;
|
2011-08-02 18:06:15 +04:00
|
|
|
ret = sysctl_createv(&sc->sc_sysctl_log, 0, NULL, &node, rw_flag,
|
2010-03-01 06:14:49 +03:00
|
|
|
CTLTYPE_INT, name,
|
2010-08-18 03:36:51 +04:00
|
|
|
SYSCTL_DESCR(dbc_sysctl_table[sysctl_index].desc),
|
2010-03-01 06:14:49 +03:00
|
|
|
dbc_sysctl_table[sysctl_index].helper,
|
2012-06-03 01:36:41 +04:00
|
|
|
0, (void *)sc, sizeof(int),
|
2010-03-01 06:14:49 +03:00
|
|
|
CTL_HW, sc->sc_root_sysctl_num,
|
|
|
|
sc->sc_sysctl_num[j],
|
|
|
|
DBC_PWM_SYSCTL(idx, sysctl_reg), CTL_EOL);
|
2008-10-06 05:35:35 +04:00
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
return ret;
|
2008-10-06 05:35:35 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-03-01 06:14:49 +03:00
|
|
|
dbcool_setup_controllers(struct dbcool_softc *sc)
|
2008-10-06 05:35:35 +04:00
|
|
|
{
|
2013-09-12 23:46:31 +04:00
|
|
|
int i, j, rw_flag;
|
2008-10-06 05:35:35 +04:00
|
|
|
uint8_t sysctl_reg;
|
2010-03-01 06:14:49 +03:00
|
|
|
struct chip_id *chip = sc->sc_dc.dc_chip;
|
2008-10-06 05:35:35 +04:00
|
|
|
const struct sysctlnode *me2 = NULL;
|
2011-08-02 02:42:57 +04:00
|
|
|
const struct sysctlnode *node = NULL;
|
2008-10-06 05:35:35 +04:00
|
|
|
char name[SYSCTL_NAMELEN];
|
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
for (i = 0; chip->power[i].desc != NULL; i++) {
|
2008-10-06 05:35:35 +04:00
|
|
|
snprintf(name, sizeof(name), "fan_ctl_%d", i);
|
2013-09-12 23:46:31 +04:00
|
|
|
sysctl_createv(&sc->sc_sysctl_log, 0, NULL, &me2,
|
2010-03-01 06:14:49 +03:00
|
|
|
CTLFLAG_READWRITE | CTLFLAG_OWNDESC,
|
2008-10-06 05:35:35 +04:00
|
|
|
CTLTYPE_NODE, name, NULL,
|
|
|
|
NULL, 0, NULL, 0,
|
2010-03-01 06:14:49 +03:00
|
|
|
CTL_HW, sc->sc_root_sysctl_num, CTL_CREATE, CTL_EOL);
|
2008-10-06 05:35:35 +04:00
|
|
|
|
|
|
|
for (j = DBC_PWM_BEHAVIOR; j < DBC_PWM_LAST_PARAM; j++) {
|
|
|
|
if (j == DBC_PWM_MAX_DUTY &&
|
2010-03-01 06:14:49 +03:00
|
|
|
(chip->flags & DBCFLAG_HAS_MAXDUTY) == 0)
|
2008-10-06 05:35:35 +04:00
|
|
|
continue;
|
2010-03-01 06:14:49 +03:00
|
|
|
sysctl_reg = chip->power[i].power_regs[j];
|
2008-10-06 05:35:35 +04:00
|
|
|
if (sysctl_reg == DBCOOL_NO_REG)
|
|
|
|
continue;
|
|
|
|
strlcpy(name, dbc_sysctl_table[j].name, sizeof(name));
|
2010-03-01 06:14:49 +03:00
|
|
|
if (dbc_sysctl_table[j].lockable && dbcool_islocked(sc))
|
|
|
|
rw_flag = CTLFLAG_READONLY | CTLFLAG_OWNDESC;
|
|
|
|
else
|
|
|
|
rw_flag = CTLFLAG_READWRITE | CTLFLAG_OWNDESC;
|
2013-09-12 23:46:31 +04:00
|
|
|
(sysctl_createv)(&sc->sc_sysctl_log, 0, NULL,
|
2011-08-02 02:42:57 +04:00
|
|
|
&node, rw_flag,
|
2008-10-06 05:35:35 +04:00
|
|
|
(j == DBC_PWM_BEHAVIOR)?
|
|
|
|
CTLTYPE_STRING:CTLTYPE_INT,
|
|
|
|
name,
|
2010-08-18 03:36:51 +04:00
|
|
|
SYSCTL_DESCR(dbc_sysctl_table[j].desc),
|
2008-10-06 05:35:35 +04:00
|
|
|
dbc_sysctl_table[j].helper,
|
|
|
|
0, sc,
|
|
|
|
( j == DBC_PWM_BEHAVIOR)?
|
|
|
|
sizeof(dbcool_cur_behav): sizeof(int),
|
2010-03-01 06:14:49 +03:00
|
|
|
CTL_HW, sc->sc_root_sysctl_num, me2->sysctl_num,
|
2008-10-06 05:35:35 +04:00
|
|
|
DBC_PWM_SYSCTL(j, sysctl_reg), CTL_EOL);
|
|
|
|
}
|
|
|
|
}
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dbcool_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
|
|
|
|
{
|
|
|
|
struct dbcool_softc *sc=sme->sme_cookie;
|
2010-03-01 06:14:49 +03:00
|
|
|
int i, nom_volt_idx, cur;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
struct reg_list *reg;
|
|
|
|
|
|
|
|
i = edata->sensor;
|
|
|
|
reg = sc->sc_regs[i];
|
2010-03-01 06:14:49 +03:00
|
|
|
|
|
|
|
edata->state = ENVSYS_SVALID;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
switch (edata->units)
|
|
|
|
{
|
|
|
|
case ENVSYS_STEMP:
|
|
|
|
cur = dbcool_read_temp(sc, reg->val_reg, true);
|
|
|
|
break;
|
|
|
|
case ENVSYS_SVOLTS_DC:
|
2008-10-06 05:35:35 +04:00
|
|
|
nom_volt_idx = sc->sc_nom_volt[i];
|
|
|
|
cur = dbcool_read_volt(sc, reg->val_reg, nom_volt_idx,
|
|
|
|
true);
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
break;
|
|
|
|
case ENVSYS_SFANRPM:
|
|
|
|
cur = dbcool_read_rpm(sc, reg->val_reg);
|
|
|
|
break;
|
2010-02-25 02:37:45 +03:00
|
|
|
case ENVSYS_INTEGER:
|
|
|
|
return;
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
default:
|
|
|
|
edata->state = ENVSYS_SINVALID;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-03-01 06:14:49 +03:00
|
|
|
if (cur == 0 && (edata->units != ENVSYS_SFANRPM))
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
edata->state = ENVSYS_SINVALID;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If fan is "stalled" but has no low limit, treat
|
|
|
|
* it as though the fan is not installed.
|
|
|
|
*/
|
|
|
|
else if (edata->units == ENVSYS_SFANRPM && cur == 0 &&
|
2010-03-01 06:14:49 +03:00
|
|
|
!(edata->upropset & (PROP_CRITMIN | PROP_WARNMIN)))
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
edata->state = ENVSYS_SINVALID;
|
|
|
|
|
|
|
|
edata->value_cur = cur;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2009-11-03 00:37:44 +03:00
|
|
|
dbcool_chip_ident(struct dbcool_chipset *dc)
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
{
|
|
|
|
/* verify this is a supported dbCool chip */
|
|
|
|
uint8_t c_id, d_id, r_id;
|
|
|
|
int i;
|
|
|
|
|
2009-11-03 00:37:44 +03:00
|
|
|
c_id = dc->dc_readreg(dc, DBCOOL_COMPANYID_REG);
|
|
|
|
d_id = dc->dc_readreg(dc, DBCOOL_DEVICEID_REG);
|
|
|
|
r_id = dc->dc_readreg(dc, DBCOOL_REVISION_REG);
|
2011-03-11 21:38:51 +03:00
|
|
|
|
|
|
|
/* The EMC6D103S only supports read_byte and since dc->dc_chip is
|
|
|
|
* NULL when we call dc->dc_readreg above we use
|
2011-03-11 22:12:46 +03:00
|
|
|
* send_byte/receive_byte which doesn't work.
|
2011-03-11 21:38:51 +03:00
|
|
|
*
|
|
|
|
* So if we only get 0's back then try again with dc->dc_chip
|
2011-03-12 16:33:18 +03:00
|
|
|
* set to the EMC6D103S_DEVICEID and which doesn't have
|
2011-03-11 21:38:51 +03:00
|
|
|
* DBCFLAG_NO_READBYTE set so read_byte will be used
|
|
|
|
*/
|
|
|
|
if ((c_id == 0) && (d_id == 0) && (r_id == 0)) {
|
|
|
|
for (i = 0; chip_table[i].company != 0; i++)
|
|
|
|
if ((SMSC_COMPANYID == chip_table[i].company) &&
|
|
|
|
(EMC6D103S_DEVICEID == chip_table[i].device)) {
|
|
|
|
dc->dc_chip = &chip_table[i];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
c_id = dc->dc_readreg(dc, DBCOOL_COMPANYID_REG);
|
|
|
|
d_id = dc->dc_readreg(dc, DBCOOL_DEVICEID_REG);
|
|
|
|
r_id = dc->dc_readreg(dc, DBCOOL_REVISION_REG);
|
|
|
|
}
|
|
|
|
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
for (i = 0; chip_table[i].company != 0; i++)
|
|
|
|
if ((c_id == chip_table[i].company) &&
|
|
|
|
(d_id == chip_table[i].device ||
|
2009-11-03 00:37:44 +03:00
|
|
|
chip_table[i].device == 0xff) &&
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
(r_id == chip_table[i].rev ||
|
2009-11-03 00:37:44 +03:00
|
|
|
chip_table[i].rev == 0xff)) {
|
|
|
|
dc->dc_chip = &chip_table[i];
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
aprint_verbose("dbcool_chip_ident: addr 0x%02x c_id 0x%02x d_id 0x%02x"
|
2009-11-03 00:37:44 +03:00
|
|
|
" r_id 0x%02x: No match.\n", dc->dc_addr, c_id, d_id,
|
Add new driver for dbCool(tm) family of Thermal Monitor and Fan Controller.
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
2008-10-02 04:47:51 +04:00
|
|
|
r_id);
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Retrieve sensor limits from the chip registers
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dbcool_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
|
|
|
|
sysmon_envsys_lim_t *limits, uint32_t *props)
|
|
|
|
{
|
|
|
|
int index = edata->sensor;
|
|
|
|
struct dbcool_softc *sc = sme->sme_cookie;
|
|
|
|
|
2010-03-20 05:42:19 +03:00
|
|
|
*props &= ~(PROP_CRITMIN | PROP_CRITMAX);
|
2010-03-01 06:14:49 +03:00
|
|
|
switch (edata->units) {
|
|
|
|
case ENVSYS_STEMP:
|
|
|
|
dbcool_get_temp_limits(sc, index, limits, props);
|
|
|
|
break;
|
|
|
|
case ENVSYS_SVOLTS_DC:
|
|
|
|
dbcool_get_volt_limits(sc, index, limits, props);
|
|
|
|
break;
|
|
|
|
case ENVSYS_SFANRPM:
|
|
|
|
dbcool_get_fan_limits(sc, index, limits, props);
|
|
|
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*props &= ~PROP_DRIVER_LIMITS;
|
2010-03-20 05:42:19 +03:00
|
|
|
|
|
|
|
/* If both limits provided, make sure they're sane */
|
|
|
|
if ((*props & PROP_CRITMIN) &&
|
|
|
|
(*props & PROP_CRITMAX) &&
|
|
|
|
(limits->sel_critmin >= limits->sel_critmax))
|
|
|
|
*props &= ~(PROP_CRITMIN | PROP_CRITMAX);
|
2010-04-10 23:02:39 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If this is the first time through, save these values
|
|
|
|
* in case user overrides them and then requests a reset.
|
|
|
|
*/
|
|
|
|
if (sc->sc_defprops[index] == 0) {
|
|
|
|
sc->sc_defprops[index] = *props | PROP_DRIVER_LIMITS;
|
|
|
|
sc->sc_deflims[index] = *limits;
|
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dbcool_get_temp_limits(struct dbcool_softc *sc, int idx,
|
|
|
|
sysmon_envsys_lim_t *lims, uint32_t *props)
|
|
|
|
{
|
|
|
|
struct reg_list *reg = sc->sc_regs[idx];
|
2010-03-20 05:42:19 +03:00
|
|
|
uint8_t lo_lim, hi_lim;
|
2010-03-01 06:14:49 +03:00
|
|
|
|
2010-03-20 05:42:19 +03:00
|
|
|
lo_lim = sc->sc_dc.dc_readreg(&sc->sc_dc, reg->lo_lim_reg);
|
|
|
|
hi_lim = sc->sc_dc.dc_readreg(&sc->sc_dc, reg->hi_lim_reg);
|
2010-03-01 06:14:49 +03:00
|
|
|
|
|
|
|
if (sc->sc_temp_offset) {
|
2010-03-20 05:42:19 +03:00
|
|
|
if (lo_lim > 0x01) {
|
|
|
|
lims->sel_critmin = lo_lim - sc->sc_temp_offset;
|
|
|
|
*props |= PROP_CRITMIN;
|
|
|
|
}
|
|
|
|
if (hi_lim != 0xff) {
|
|
|
|
lims->sel_critmax = hi_lim - sc->sc_temp_offset;
|
|
|
|
*props |= PROP_CRITMAX;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (lo_lim != 0x80 && lo_lim != 0x81) {
|
|
|
|
lims->sel_critmin = (int8_t)lo_lim;
|
|
|
|
*props |= PROP_CRITMIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hi_lim != 0x7f) {
|
|
|
|
lims->sel_critmax = (int8_t)hi_lim;
|
|
|
|
*props |= PROP_CRITMAX;
|
|
|
|
}
|
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
|
2010-03-20 05:42:19 +03:00
|
|
|
/* Convert temp limits to microKelvin */
|
|
|
|
lims->sel_critmin *= 1000000;
|
|
|
|
lims->sel_critmin += 273150000;
|
|
|
|
lims->sel_critmax *= 1000000;
|
|
|
|
lims->sel_critmax += 273150000;
|
2010-03-01 06:14:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dbcool_get_volt_limits(struct dbcool_softc *sc, int idx,
|
|
|
|
sysmon_envsys_lim_t *lims, uint32_t *props)
|
|
|
|
{
|
|
|
|
struct reg_list *reg = sc->sc_regs[idx];
|
|
|
|
int64_t limit;
|
|
|
|
int nom;
|
|
|
|
|
|
|
|
nom = nominal_voltages[sc->sc_dc.dc_chip->table[idx].nom_volt_index];
|
|
|
|
if (nom < 0)
|
|
|
|
nom = dbcool_supply_voltage(sc);
|
|
|
|
nom *= 1000000; /* scale for microvolts */
|
|
|
|
|
|
|
|
limit = sc->sc_dc.dc_readreg(&sc->sc_dc, reg->lo_lim_reg);
|
2010-03-20 05:42:19 +03:00
|
|
|
if (limit != 0x00 && limit != 0xff) {
|
2010-03-01 06:14:49 +03:00
|
|
|
limit *= nom;
|
|
|
|
limit /= 0xc0;
|
|
|
|
lims->sel_critmin = limit;
|
|
|
|
*props |= PROP_CRITMIN;
|
|
|
|
}
|
|
|
|
limit = sc->sc_dc.dc_readreg(&sc->sc_dc, reg->hi_lim_reg);
|
2010-03-20 05:42:19 +03:00
|
|
|
if (limit != 0x00 && limit != 0xff) {
|
2010-03-01 06:14:49 +03:00
|
|
|
limit *= nom;
|
|
|
|
limit /= 0xc0;
|
|
|
|
lims->sel_critmax = limit;
|
|
|
|
*props |= PROP_CRITMAX;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dbcool_get_fan_limits(struct dbcool_softc *sc, int idx,
|
|
|
|
sysmon_envsys_lim_t *lims, uint32_t *props)
|
|
|
|
{
|
|
|
|
struct reg_list *reg = sc->sc_regs[idx];
|
|
|
|
int32_t limit;
|
|
|
|
|
|
|
|
limit = dbcool_read_rpm(sc, reg->lo_lim_reg);
|
|
|
|
if (limit) {
|
|
|
|
lims->sel_critmin = limit;
|
|
|
|
*props |= PROP_CRITMIN;
|
2010-03-20 05:42:19 +03:00
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Update sensor limits in the chip registers
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dbcool_set_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
|
|
|
|
sysmon_envsys_lim_t *limits, uint32_t *props)
|
|
|
|
{
|
|
|
|
int index = edata->sensor;
|
|
|
|
struct dbcool_softc *sc = sme->sme_cookie;
|
|
|
|
|
2010-04-10 23:02:39 +04:00
|
|
|
if (limits == NULL) {
|
|
|
|
limits = &sc->sc_deflims[index];
|
|
|
|
props = &sc->sc_defprops[index];
|
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
switch (edata->units) {
|
|
|
|
case ENVSYS_STEMP:
|
|
|
|
dbcool_set_temp_limits(sc, index, limits, props);
|
|
|
|
break;
|
|
|
|
case ENVSYS_SVOLTS_DC:
|
|
|
|
dbcool_set_volt_limits(sc, index, limits, props);
|
|
|
|
break;
|
|
|
|
case ENVSYS_SFANRPM:
|
|
|
|
dbcool_set_fan_limits(sc, index, limits, props);
|
|
|
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*props &= ~PROP_DRIVER_LIMITS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dbcool_set_temp_limits(struct dbcool_softc *sc, int idx,
|
|
|
|
sysmon_envsys_lim_t *lims, uint32_t *props)
|
|
|
|
{
|
|
|
|
struct reg_list *reg = sc->sc_regs[idx];
|
|
|
|
int32_t limit;
|
|
|
|
|
|
|
|
if (*props & PROP_CRITMIN) {
|
|
|
|
limit = lims->sel_critmin - 273150000;
|
|
|
|
limit /= 1000000;
|
2010-03-20 05:42:19 +03:00
|
|
|
if (sc->sc_temp_offset) {
|
|
|
|
limit += sc->sc_temp_offset;
|
|
|
|
if (limit < 0)
|
|
|
|
limit = 0;
|
|
|
|
else if (limit > 255)
|
|
|
|
limit = 255;
|
|
|
|
} else {
|
|
|
|
if (limit < -127)
|
|
|
|
limit = -127;
|
|
|
|
else if (limit > 127)
|
|
|
|
limit = 127;
|
|
|
|
}
|
2010-04-10 23:02:39 +04:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg,
|
|
|
|
(uint8_t)limit);
|
|
|
|
} else if (*props & PROP_DRIVER_LIMITS) {
|
2010-03-20 05:42:19 +03:00
|
|
|
if (sc->sc_temp_offset)
|
|
|
|
limit = 0x00;
|
|
|
|
else
|
|
|
|
limit = 0x80;
|
2010-04-10 23:02:39 +04:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg,
|
|
|
|
(uint8_t)limit);
|
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
|
|
|
|
if (*props & PROP_CRITMAX) {
|
|
|
|
limit = lims->sel_critmax - 273150000;
|
|
|
|
limit /= 1000000;
|
2010-03-20 05:42:19 +03:00
|
|
|
if (sc->sc_temp_offset) {
|
|
|
|
limit += sc->sc_temp_offset;
|
|
|
|
if (limit < 0)
|
|
|
|
limit = 0;
|
|
|
|
else if (limit > 255)
|
|
|
|
limit = 255;
|
|
|
|
} else {
|
|
|
|
if (limit < -127)
|
|
|
|
limit = -127;
|
|
|
|
else if (limit > 127)
|
|
|
|
limit = 127;
|
|
|
|
}
|
2010-04-10 23:02:39 +04:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->hi_lim_reg,
|
|
|
|
(uint8_t)limit);
|
|
|
|
} else if (*props & PROP_DRIVER_LIMITS) {
|
2010-03-20 05:42:19 +03:00
|
|
|
if (sc->sc_temp_offset)
|
|
|
|
limit = 0xff;
|
|
|
|
else
|
|
|
|
limit = 0x7f;
|
2010-04-10 23:02:39 +04:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->hi_lim_reg,
|
|
|
|
(uint8_t)limit);
|
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dbcool_set_volt_limits(struct dbcool_softc *sc, int idx,
|
|
|
|
sysmon_envsys_lim_t *lims, uint32_t *props)
|
|
|
|
{
|
|
|
|
struct reg_list *reg = sc->sc_regs[idx];
|
|
|
|
int64_t limit;
|
|
|
|
int nom;
|
|
|
|
|
|
|
|
nom = nominal_voltages[sc->sc_dc.dc_chip->table[idx].nom_volt_index];
|
|
|
|
if (nom < 0)
|
|
|
|
nom = dbcool_supply_voltage(sc);
|
|
|
|
nom *= 1000000; /* scale for microvolts */
|
|
|
|
|
|
|
|
if (*props & PROP_CRITMIN) {
|
|
|
|
limit = lims->sel_critmin;
|
|
|
|
limit *= 0xc0;
|
|
|
|
limit /= nom;
|
|
|
|
if (limit > 0xff)
|
|
|
|
limit = 0xff;
|
|
|
|
else if (limit < 0)
|
|
|
|
limit = 0;
|
2010-04-10 23:02:39 +04:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg, limit);
|
|
|
|
} else if (*props & PROP_DRIVER_LIMITS)
|
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg, 0);
|
2010-03-01 06:14:49 +03:00
|
|
|
|
|
|
|
if (*props & PROP_CRITMAX) {
|
|
|
|
limit = lims->sel_critmax;
|
|
|
|
limit *= 0xc0;
|
|
|
|
limit /= nom;
|
|
|
|
if (limit > 0xff)
|
|
|
|
limit = 0xff;
|
|
|
|
else if (limit < 0)
|
|
|
|
limit = 0;
|
2010-04-10 23:02:39 +04:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->hi_lim_reg, limit);
|
|
|
|
} else if (*props & PROP_DRIVER_LIMITS)
|
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->hi_lim_reg, 0xff);
|
2010-03-01 06:14:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dbcool_set_fan_limits(struct dbcool_softc *sc, int idx,
|
|
|
|
sysmon_envsys_lim_t *lims, uint32_t *props)
|
|
|
|
{
|
|
|
|
struct reg_list *reg = sc->sc_regs[idx];
|
|
|
|
int32_t limit, dividend;
|
|
|
|
|
|
|
|
if (*props & PROP_CRITMIN) {
|
|
|
|
limit = lims->sel_critmin;
|
|
|
|
if (limit == 0)
|
|
|
|
limit = 0xffff;
|
|
|
|
else {
|
|
|
|
if (sc->sc_dc.dc_chip->flags & DBCFLAG_ADM1030)
|
|
|
|
dividend = 11250 * 60;
|
|
|
|
else
|
|
|
|
dividend = 90000 * 60;
|
|
|
|
limit = limit / dividend;
|
|
|
|
if (limit > 0xffff)
|
|
|
|
limit = 0xffff;
|
|
|
|
}
|
2010-04-10 23:02:39 +04:00
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg,
|
|
|
|
limit & 0xff);
|
|
|
|
limit >>= 8;
|
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg + 1,
|
|
|
|
limit & 0xff);
|
|
|
|
} else if (*props & PROP_DRIVER_LIMITS) {
|
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg, 0xff);
|
|
|
|
sc->sc_dc.dc_writereg(&sc->sc_dc, reg->lo_lim_reg + 1, 0xff);
|
|
|
|
}
|
2010-03-01 06:14:49 +03:00
|
|
|
}
|
2011-07-31 20:05:01 +04:00
|
|
|
|
2011-10-02 23:03:56 +04:00
|
|
|
MODULE(MODULE_CLASS_DRIVER, dbcool, "iic");
|
2011-07-31 20:05:01 +04:00
|
|
|
|
|
|
|
#ifdef _MODULE
|
|
|
|
#include "ioconf.c"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int
|
|
|
|
dbcool_modcmd(modcmd_t cmd, void *opaque)
|
|
|
|
{
|
|
|
|
int error = 0;
|
2012-05-31 20:09:33 +04:00
|
|
|
#ifdef _MODULE
|
|
|
|
static struct sysctllog *dbcool_sysctl_clog;
|
|
|
|
#endif
|
2011-07-31 20:05:01 +04:00
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
case MODULE_CMD_INIT:
|
|
|
|
#ifdef _MODULE
|
|
|
|
error = config_init_component(cfdriver_ioconf_dbcool,
|
|
|
|
cfattach_ioconf_dbcool, cfdata_ioconf_dbcool);
|
2012-05-31 20:09:33 +04:00
|
|
|
sysctl_dbcoolsetup(&dbcool_sysctl_clog);
|
2011-07-31 20:05:01 +04:00
|
|
|
#endif
|
|
|
|
return error;
|
|
|
|
case MODULE_CMD_FINI:
|
|
|
|
#ifdef _MODULE
|
|
|
|
error = config_fini_component(cfdriver_ioconf_dbcool,
|
|
|
|
cfattach_ioconf_dbcool, cfdata_ioconf_dbcool);
|
2012-05-31 20:09:33 +04:00
|
|
|
sysctl_teardown(&dbcool_sysctl_clog);
|
2011-07-31 20:05:01 +04:00
|
|
|
#endif
|
|
|
|
return error;
|
|
|
|
default:
|
|
|
|
return ENOTTY;
|
|
|
|
}
|
|
|
|
}
|