FreeBSD kernel IICBUS device code
max6690.c File Reference
#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>
Include dependency graph for max6690.c:

Go to the source code of this file.

Data Structures

struct  max6690_sensor
 
struct  max6690_softc
 

Macros

#define MAX6690_INT_TEMP   0x0
 
#define MAX6690_EXT_TEMP   0x1
 
#define MAX6690_RSL_STATUS   0x2
 
#define MAX6690_EEXT_TEMP   0x10
 
#define MAX6690_IEXT_TEMP   0x11
 
#define MAX6690_TEMP_MASK   0xe0
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int max6690_probe (device_t)
 
static int max6690_attach (device_t)
 
static int max6690_sensor_read (struct max6690_sensor *sens)
 
static int max6690_sensor_sysctl (SYSCTL_HANDLER_ARGS)
 
static void max6690_start (void *xdev)
 
static int max6690_read (device_t dev, uint32_t addr, uint8_t reg, uint8_t *data)
 
 DRIVER_MODULE (max6690, iicbus, max6690_driver, max6690_devclass, 0, 0)
 
static MALLOC_DEFINE (M_MAX6690, "max6690", "Temp-Monitor MAX6690")
 
static int max6690_fill_sensor_prop (device_t dev)
 

Variables

static device_method_t max6690_methods []
 
static driver_t max6690_driver
 
static devclass_t max6690_devclass
 

Macro Definition Documentation

◆ MAX6690_EEXT_TEMP

#define MAX6690_EEXT_TEMP   0x10

Definition at line 60 of file max6690.c.

◆ MAX6690_EXT_TEMP

#define MAX6690_EXT_TEMP   0x1

Definition at line 58 of file max6690.c.

◆ MAX6690_IEXT_TEMP

#define MAX6690_IEXT_TEMP   0x11

Definition at line 61 of file max6690.c.

◆ MAX6690_INT_TEMP

#define MAX6690_INT_TEMP   0x0

Definition at line 57 of file max6690.c.

◆ MAX6690_RSL_STATUS

#define MAX6690_RSL_STATUS   0x2

Definition at line 59 of file max6690.c.

◆ MAX6690_TEMP_MASK

#define MAX6690_TEMP_MASK   0xe0

Definition at line 62 of file max6690.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( max6690  ,
iicbus  ,
max6690_driver  ,
max6690_devclass  ,
,
 
)

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_MAX6690  ,
"max6690"  ,
"Temp-Monitor MAX6690"   
)
static

◆ max6690_attach()

static int max6690_attach ( device_t  dev)
static

Definition at line 235 of file max6690.c.

References dev, max6690_softc::enum_hook, and max6690_start().

Here is the call graph for this function:

◆ max6690_fill_sensor_prop()

static int max6690_fill_sensor_prop ( device_t  dev)
static

Definition at line 177 of file max6690.c.

References max6690_sensor::dev, dev, max6690_sensor::id, len, max6690_sensor_read(), max6690_softc::sc_sensors, and max6690_sensor::therm.

Referenced by max6690_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max6690_probe()

static int max6690_probe ( device_t  dev)
static

Definition at line 148 of file max6690.c.

References dev, max6690_softc::sc_addr, and max6690_softc::sc_dev.

◆ max6690_read()

static int max6690_read ( device_t  dev,
uint32_t  addr,
uint8_t  reg,
uint8_t *  data 
)
static

Definition at line 108 of file max6690.c.

References addr, buf, data, dev, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, iicbus_transfer(), and MAX6690_RSL_STATUS.

Referenced by max6690_sensor_read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max6690_sensor_read()

static int max6690_sensor_read ( struct max6690_sensor sens)
static

Definition at line 332 of file max6690.c.

References max6690_sensor::dev, max6690_sensor::id, MAX6690_EEXT_TEMP, MAX6690_EXT_TEMP, MAX6690_IEXT_TEMP, MAX6690_INT_TEMP, max6690_read(), MAX6690_TEMP_MASK, max6690_softc::sc_addr, and max6690_softc::sc_dev.

Referenced by max6690_fill_sensor_prop(), and max6690_sensor_sysctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max6690_sensor_sysctl()

static int max6690_sensor_sysctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 373 of file max6690.c.

References dev, max6690_sensor_read(), and max6690_softc::sc_sensors.

Referenced by max6690_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max6690_start()

static void max6690_start ( void *  xdev)
static

Definition at line 259 of file max6690.c.

References dev, max6690_softc::enum_hook, max6690_sensor::id, max6690_fill_sensor_prop(), max6690_sensor_sysctl(), max6690_softc::sc_nsensors, max6690_softc::sc_sensors, and max6690_sensor::therm.

Referenced by max6690_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ max6690_devclass

devclass_t max6690_devclass
static

Definition at line 102 of file max6690.c.

◆ max6690_driver

driver_t max6690_driver
static
Initial value:
= {
"max6690",
sizeof(struct max6690_softc)
}
static device_method_t max6690_methods[]
Definition: max6690.c:89

Definition at line 96 of file max6690.c.

◆ max6690_methods

device_method_t max6690_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, max6690_probe),
DEVMETHOD(device_attach, max6690_attach),
{ 0, 0 },
}
static int max6690_attach(device_t)
Definition: max6690.c:235
static int max6690_probe(device_t)
Definition: max6690.c:148

Definition at line 89 of file max6690.c.