FreeBSD kernel IICBUS device code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/systm.h>
#include <sys/module.h>
#include <sys/callout.h>
#include <sys/conf.h>
#include <sys/cpu.h>
#include <sys/ctype.h>
#include <sys/kernel.h>
#include <sys/reboot.h>
#include <sys/rman.h>
#include <sys/sysctl.h>
#include <sys/limits.h>
#include <machine/bus.h>
#include <machine/md_var.h>
#include <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
#include <powerpc/powermac/powermac_thermal.h>
Go to the source code of this file.
Data Structures | |
struct | adt746x_fan |
struct | adt746x_sensor |
struct | adt746x_softc |
Macros | |
#define | ADT746X_TACH1LOW 0x28 |
#define | ADT746X_TACH1HIGH 0x29 |
#define | ADT746X_TACH2LOW 0x2a |
#define | ADT746X_TACH2HIGH 0x2b |
#define | ADT746X_PWM1 0x30 |
#define | ADT746X_PWM2 0x31 |
#define | ADT746X_DEVICE_ID 0x3d |
#define | ADT746X_COMPANY_ID 0x3e |
#define | ADT746X_REV_ID 0x3f |
#define | ADT746X_CONFIG 0x40 |
#define | ADT746X_PWM1_CONF 0x5c |
#define | ADT746X_PWM2_CONF 0x5d |
#define | ADT746X_MANUAL_MASK 0xe0 |
#define | ADT7460_DEV_ID 0x27 |
#define | ADT7467_DEV_ID 0x68 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | adt746x_probe (device_t) |
static int | adt746x_attach (device_t) |
static void | adt746x_attach_fans (device_t dev) |
static void | adt746x_attach_sensors (device_t dev) |
static int | adt746x_fill_fan_prop (device_t dev) |
static int | adt746x_fill_sensor_prop (device_t dev) |
static int | adt746x_fan_set_pwm (struct adt746x_fan *fan, int pwm) |
static int | adt746x_fan_get_pwm (struct adt746x_fan *fan) |
static int | adt746x_sensor_read (struct adt746x_sensor *sens) |
static void | adt746x_start (void *xdev) |
static int | adt746x_write (device_t dev, uint32_t addr, uint8_t reg, uint8_t *buf) |
static int | adt746x_read (device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) |
DRIVER_MODULE (adt746x, iicbus, adt746x_driver, adt746x_devclass, 0, 0) | |
static | MALLOC_DEFINE (M_ADT746X, "adt746x", "ADT Sensor Information") |
static int | adt746x_fanrpm_sysctl (SYSCTL_HANDLER_ARGS) |
static int | adt746x_sensor_sysctl (SYSCTL_HANDLER_ARGS) |
Variables | |
static device_method_t | adt746x_methods [] |
static driver_t | adt746x_driver |
static devclass_t | adt746x_devclass |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 236 of file adt746x.c.
References adt746x_start(), dev, and adt746x_softc::enum_hook.
|
static |
Definition at line 470 of file adt746x.c.
References adt746x_fan_get_pwm(), adt746x_fanrpm_sysctl(), adt746x_fill_fan_prop(), dev, adt746x_fan::fan, adt746x_fan::id, adt746x_softc::sc_fans, adt746x_softc::sc_nfans, and adt746x_fan::setpoint.
Referenced by adt746x_start().
|
static |
Definition at line 598 of file adt746x.c.
References adt746x_fill_sensor_prop(), adt746x_sensor_sysctl(), dev, adt746x_sensor::id, adt746x_sensor::reg, adt746x_softc::sc_nsensors, adt746x_softc::sc_sensors, adt746x_sensor::therm, and adt746x_sensor::type.
Referenced by adt746x_start().
|
static |
Definition at line 333 of file adt746x.c.
References adt746x_read(), buf, adt746x_fan::dev, adt746x_fan::pwm_reg, adt746x_softc::sc_addr, and adt746x_softc::sc_dev.
Referenced by adt746x_attach_fans(), and adt746x_fanrpm_sysctl().
|
static |
Definition at line 299 of file adt746x.c.
References ADT746X_MANUAL_MASK, adt746x_read(), adt746x_write(), buf, adt746x_fan::conf_reg, adt746x_fan::dev, adt746x_fan::fan, adt746x_fan::pwm_reg, adt746x_softc::sc_addr, adt746x_softc::sc_dev, and adt746x_fan::setpoint.
Referenced by adt746x_fanrpm_sysctl(), and adt746x_fill_fan_prop().
|
static |
Definition at line 450 of file adt746x.c.
References adt746x_fan_get_pwm(), adt746x_fan_set_pwm(), adt746x_fan::fan, and adt746x_softc::sc_fans.
Referenced by adt746x_attach_fans().
|
static |
Definition at line 350 of file adt746x.c.
References adt746x_fan_set_pwm(), ADT746X_PWM1, ADT746X_PWM1_CONF, ADT746X_PWM2, ADT746X_PWM2_CONF, adt746x_fan::conf_reg, adt746x_fan::dev, dev, adt746x_fan::fan, adt746x_fan::id, len, adt746x_fan::pwm_reg, adt746x_softc::sc_dev, and adt746x_softc::sc_fans.
Referenced by adt746x_attach_fans().
|
static |
Definition at line 402 of file adt746x.c.
References adt746x_sensor_read(), adt746x_sensor::dev, dev, adt746x_sensor::id, adt746x_sensor::reg, adt746x_softc::sc_sensors, adt746x_sensor::therm, and adt746x_sensor::type.
Referenced by adt746x_attach_sensors().
|
static |
Definition at line 210 of file adt746x.c.
References dev, adt746x_softc::sc_addr, and adt746x_softc::sc_dev.
|
static |
Definition at line 182 of file adt746x.c.
References addr, buf, data, dev, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, and iicbus_transfer().
Referenced by adt746x_fan_get_pwm(), adt746x_fan_set_pwm(), adt746x_sensor_read(), and adt746x_start().
|
static |
Definition at line 542 of file adt746x.c.
References adt746x_read(), data, adt746x_sensor::dev, adt746x_sensor::reg, adt746x_softc::sc_addr, adt746x_softc::sc_dev, adt746x_sensor::type, and val.
Referenced by adt746x_fill_sensor_prop().
|
static |
Definition at line 577 of file adt746x.c.
References dev, adt746x_softc::sc_sensors, and adt746x_sensor::therm.
Referenced by adt746x_attach_sensors().
|
static |
Definition at line 260 of file adt746x.c.
References ADT7460_DEV_ID, adt746x_attach_fans(), adt746x_attach_sensors(), ADT746X_COMPANY_ID, ADT746X_CONFIG, ADT746X_DEVICE_ID, adt746x_read(), ADT746X_REV_ID, adt746x_write(), dev, adt746x_softc::device_id, adt746x_softc::enum_hook, adt746x_softc::sc_addr, and adt746x_softc::sc_dev.
Referenced by adt746x_attach().
|
static |
Definition at line 155 of file adt746x.c.
References addr, buf, dev, IIC_M_WR, and iicbus_transfer().
Referenced by adt746x_fan_set_pwm(), and adt746x_start().
DRIVER_MODULE | ( | adt746x | , |
iicbus | , | ||
adt746x_driver | , | ||
adt746x_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
|
static |
|
static |