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 | ad7417_sensor |
struct | write_data |
struct | read_data |
struct | ad7417_softc |
Macros | |
#define | AD7417_TEMP 0x00 |
#define | AD7417_CONFIG 0x01 |
#define | AD7417_ADC 0x04 |
#define | AD7417_CONFIG2 0x05 |
#define | AD7417_CONFMASK 0xe0 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | ad7417_probe (device_t) |
static int | ad7417_attach (device_t) |
static int | ad7417_sensor_sysctl (SYSCTL_HANDLER_ARGS) |
static int | ad7417_write (device_t dev, uint32_t addr, uint8_t reg, uint8_t *buf, int len) |
static int | ad7417_read_1 (device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) |
static int | ad7417_read_2 (device_t dev, uint32_t addr, uint8_t reg, uint16_t *data) |
static int | ad7417_write_read (device_t dev, uint32_t addr, struct write_data out, struct read_data *in) |
static int | ad7417_diode_read (struct ad7417_sensor *sens) |
static int | ad7417_adc_read (struct ad7417_sensor *sens) |
static int | ad7417_sensor_read (struct ad7417_sensor *sens) |
DRIVER_MODULE (ad7417, iicbus, ad7417_driver, ad7417_devclass, 0, 0) | |
static | MALLOC_DEFINE (M_AD7417, "ad7417", "Supply-Monitor AD7417") |
static int | ad7417_init_adc (device_t dev, uint32_t addr) |
static int | ad7417_fill_sensor_prop (device_t dev) |
static int | ad7417_get_temp (device_t dev, uint32_t addr, int *temp) |
static int | ad7417_get_adc (device_t dev, uint32_t addr, unsigned int *value, uint8_t chan) |
Variables | |
uint8_t | adc741x_config |
static device_method_t | ad7417_methods [] |
static driver_t | ad7417_driver |
static devclass_t | ad7417_devclass |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 563 of file ad7417.c.
References ad7417_get_adc(), ad7417_sensor::dev, ad7417_sensor::id, ad7417_softc::sc_addr, and ad7417_softc::sc_dev.
Referenced by ad7417_diode_read(), and ad7417_sensor_read().
|
static |
Definition at line 404 of file ad7417.c.
References ad7417_fill_sensor_prop(), ad7417_sensor_sysctl(), dev, ad7417_sensor::id, ad7417_softc::sc_nsensors, ad7417_softc::sc_sensors, ad7417_sensor::therm, and ad7417_sensor::type.
|
static |
Definition at line 528 of file ad7417.c.
References ad7417_adc_read(), and ad7417_sensor::therm.
Referenced by ad7417_fill_sensor_prop().
|
static |
Definition at line 310 of file ad7417.c.
References ad7417_diode_read(), ad7417_sensor_read(), ad7417_sensor::dev, dev, ad7417_sensor::id, len, ad7417_softc::sc_sensors, ad7417_sensor::therm, and ad7417_sensor::type.
Referenced by ad7417_attach().
|
static |
Definition at line 501 of file ad7417.c.
References AD7417_ADC, AD7417_CONFIG, AD7417_CONFMASK, ad7417_read_1(), ad7417_write_read(), addr, data, dev, write_data::reg, and write_data::val.
Referenced by ad7417_adc_read().
|
static |
Definition at line 480 of file ad7417.c.
References ad7417_read_2(), AD7417_TEMP, addr, buf, dev, and read.
Referenced by ad7417_sensor_read().
|
static |
Definition at line 248 of file ad7417.c.
References AD7417_CONFIG, AD7417_CONFIG2, ad7417_read_1(), ad7417_write(), adc741x_config, addr, buf, dev, and ad7417_softc::init_done.
Referenced by ad7417_sensor_read().
|
static |
Definition at line 281 of file ad7417.c.
References dev, ad7417_softc::sc_addr, and ad7417_softc::sc_dev.
|
static |
Definition at line 157 of file ad7417.c.
References addr, buf, data, dev, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, and iicbus_transfer().
Referenced by ad7417_get_adc(), and ad7417_init_adc().
|
static |
Definition at line 185 of file ad7417.c.
References addr, buf, data, dev, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, and iicbus_transfer().
Referenced by ad7417_get_temp().
|
static |
Definition at line 600 of file ad7417.c.
References ad7417_adc_read(), ad7417_get_temp(), ad7417_init_adc(), ad7417_sensor::dev, ad7417_softc::init_done, ad7417_softc::sc_addr, ad7417_softc::sc_dev, and ad7417_sensor::type.
Referenced by ad7417_fill_sensor_prop().
|
static |
Definition at line 623 of file ad7417.c.
References dev, ad7417_softc::sc_sensors, and ad7417_sensor::therm.
Referenced by ad7417_attach().
|
static |
Definition at line 130 of file ad7417.c.
References addr, buf, dev, IIC_M_WR, iicbus_transfer(), iic_msg::len, and len.
Referenced by ad7417_init_adc().
|
static |
Definition at line 213 of file ad7417.c.
References addr, buf, dev, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, iicbus_transfer(), write_data::reg, read_data::reg, write_data::val, and read_data::val.
Referenced by ad7417_get_adc().
DRIVER_MODULE | ( | ad7417 | , |
iicbus | , | ||
ad7417_driver | , | ||
ad7417_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
|
static |
|
static |
uint8_t adc741x_config |
Definition at line 63 of file ad7417.c.
Referenced by ad7417_init_adc().