FreeBSD kernel IICBUS device code
|
#include <sys/cdefs.h>
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/endian.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <machine/bus.h>
#include <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
Go to the source code of this file.
Data Structures | |
struct | lm75_softc |
Macros | |
#define | LM75_TEMP 0x0 |
#define | LM75_TEMP_MASK 0xff80 |
#define | LM75A_TEMP_MASK 0xffe0 |
#define | LM75_CONF 0x1 |
#define | LM75_CONF_FSHIFT 3 |
#define | LM75_CONF_FAULT 0x18 |
#define | LM75_CONF_POL 0x04 |
#define | LM75_CONF_MODE 0x02 |
#define | LM75_CONF_SHUTD 0x01 |
#define | LM75_CONF_MASK 0x1f |
#define | LM75_THYST 0x2 |
#define | LM75_TOS 0x3 |
#define | LM75_TEST_PATTERN 0xa |
#define | LM75_MIN_TEMP -55 |
#define | LM75_MAX_TEMP 125 |
#define | LM75_0500C 0x80 |
#define | LM75_0250C 0x40 |
#define | LM75_0125C 0x20 |
#define | LM75_MSB 0x8000 |
#define | LM75_NEG_BIT LM75_MSB |
#define | TZ_ZEROC 2731 |
#define | HWTYPE_LM75 1 |
#define | HWTYPE_LM75A 2 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | lm75_probe (device_t) |
static int | lm75_attach (device_t) |
static int | lm75_conf_read (struct lm75_softc *) |
static int | lm75_conf_write (struct lm75_softc *) |
static int | lm75_temp_read (struct lm75_softc *, uint8_t, int *) |
static int | lm75_temp_write (struct lm75_softc *, uint8_t, int) |
static void | lm75_start (void *) |
static int | lm75_read (device_t, uint32_t, uint8_t, uint8_t *, size_t) |
static int | lm75_write (device_t, uint32_t, uint8_t *, size_t) |
static int | lm75_str_mode (char *) |
static int | lm75_str_pol (char *) |
static int | lm75_temp_sysctl (SYSCTL_HANDLER_ARGS) |
static int | lm75_faults_sysctl (SYSCTL_HANDLER_ARGS) |
static int | lm75_mode_sysctl (SYSCTL_HANDLER_ARGS) |
static int | lm75_pol_sysctl (SYSCTL_HANDLER_ARGS) |
static int | lm75_shutdown_sysctl (SYSCTL_HANDLER_ARGS) |
DRIVER_MODULE (lm75, iicbus, lm75_driver, lm75_devclass, 0, 0) | |
static int | lm75_type_detect (struct lm75_softc *sc) |
Variables | |
static device_method_t | lm75_methods [] |
static driver_t | lm75_driver |
static devclass_t | lm75_devclass |
__FBSDID | ( | "$FreeBSD$" | ) |
DRIVER_MODULE | ( | lm75 | , |
iicbus | , | ||
lm75_driver | , | ||
lm75_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
Definition at line 171 of file lm75.c.
References dev, lm75_softc::enum_hook, lm75_start(), lm75_softc::sc_addr, and lm75_softc::sc_dev.
|
static |
Definition at line 304 of file lm75.c.
References LM75_CONF, lm75_read(), lm75_softc::sc_addr, lm75_softc::sc_conf, and lm75_softc::sc_dev.
Referenced by lm75_type_detect().
|
static |
Definition at line 317 of file lm75.c.
References LM75_CONF, LM75_CONF_MASK, lm75_write(), lm75_softc::sc_addr, lm75_softc::sc_conf, and lm75_softc::sc_dev.
Referenced by lm75_faults_sysctl(), lm75_mode_sysctl(), lm75_pol_sysctl(), lm75_shutdown_sysctl(), and lm75_type_detect().
|
static |
Definition at line 455 of file lm75.c.
References dev, LM75_CONF_FAULT, LM75_CONF_FSHIFT, lm75_conf_write(), and lm75_softc::sc_conf.
Referenced by lm75_start().
|
static |
Definition at line 488 of file lm75.c.
References buf, dev, LM75_CONF_MODE, lm75_conf_write(), lm75_str_mode(), and lm75_softc::sc_conf.
Referenced by lm75_start().
|
static |
Definition at line 522 of file lm75.c.
References buf, dev, LM75_CONF_POL, lm75_conf_write(), lm75_str_pol(), and lm75_softc::sc_conf.
Referenced by lm75_start().
|
static |
Definition at line 155 of file lm75.c.
References dev, HWTYPE_LM75, and lm75_softc::sc_hwtype.
|
static |
Definition at line 128 of file lm75.c.
References addr, data, dev, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, iicbus_transfer(), and len.
Referenced by lm75_conf_read(), lm75_temp_read(), and lm75_type_detect().
|
static |
Definition at line 556 of file lm75.c.
References dev, LM75_CONF_SHUTD, lm75_conf_write(), and lm75_softc::sc_conf.
Referenced by lm75_start().
|
static |
Definition at line 249 of file lm75.c.
References dev, lm75_softc::enum_hook, HWTYPE_LM75A, lm75_faults_sysctl(), lm75_mode_sysctl(), lm75_pol_sysctl(), lm75_shutdown_sysctl(), LM75_TEMP, lm75_temp_sysctl(), LM75_THYST, LM75_TOS, lm75_type_detect(), and lm75_softc::sc_hwtype.
Referenced by lm75_attach().
|
static |
Definition at line 396 of file lm75.c.
Referenced by lm75_mode_sysctl().
|
static |
Definition at line 411 of file lm75.c.
Referenced by lm75_pol_sysctl().
|
static |
Definition at line 330 of file lm75.c.
References buf, HWTYPE_LM75A, LM75_0125C, LM75_0250C, LM75_0500C, LM75_NEG_BIT, lm75_read(), LM75_TEMP_MASK, LM75A_TEMP_MASK, lm75_softc::sc_addr, lm75_softc::sc_dev, lm75_softc::sc_hwtype, and TZ_ZEROC.
Referenced by lm75_temp_sysctl().
|
static |
Definition at line 430 of file lm75.c.
References dev, lm75_temp_read(), and lm75_temp_write().
Referenced by lm75_start().
|
static |
Definition at line 372 of file lm75.c.
References buf, LM75_MAX_TEMP, LM75_MIN_TEMP, lm75_write(), lm75_softc::sc_addr, lm75_softc::sc_dev, and TZ_ZEROC.
Referenced by lm75_temp_sysctl().
|
static |
Definition at line 193 of file lm75.c.
References HWTYPE_LM75A, lm75_conf_read(), lm75_conf_write(), lm75_read(), LM75_TEST_PATTERN, lm75_softc::sc_addr, lm75_softc::sc_conf, lm75_softc::sc_dev, and lm75_softc::sc_hwtype.
Referenced by lm75_start().
|
static |
Definition at line 142 of file lm75.c.
References addr, data, dev, IIC_M_WR, iicbus_transfer(), and len.
Referenced by lm75_conf_write(), and lm75_temp_write().
|
static |
|
static |