FreeBSD kernel IICBUS device code
ds1775.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 ds1775.c:

Go to the source code of this file.

Data Structures

struct  ds1775_softc
 

Macros

#define DS1775_TEMP   0x0
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int ds1775_probe (device_t)
 
static int ds1775_attach (device_t)
 
static int ds1775_sensor_read (struct ds1775_softc *sc)
 
static int ds1775_sensor_sysctl (SYSCTL_HANDLER_ARGS)
 
static void ds1775_start (void *xdev)
 
static int ds1775_read_2 (device_t dev, uint32_t addr, uint8_t reg, uint16_t *data)
 
 DRIVER_MODULE (ds1775, iicbus, ds1775_driver, ds1775_devclass, 0, 0)
 

Variables

static device_method_t ds1775_methods []
 
static driver_t ds1775_driver
 
static devclass_t ds1775_devclass
 

Macro Definition Documentation

◆ DS1775_TEMP

#define DS1775_TEMP   0x0

Definition at line 56 of file ds1775.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( ds1775  ,
iicbus  ,
ds1775_driver  ,
ds1775_devclass  ,
,
 
)

◆ ds1775_attach()

static int ds1775_attach ( device_t  dev)
static

Definition at line 148 of file ds1775.c.

References dev, ds1775_start(), and ds1775_softc::enum_hook.

Here is the call graph for this function:

◆ ds1775_probe()

static int ds1775_probe ( device_t  dev)
static

Definition at line 122 of file ds1775.c.

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

◆ ds1775_read_2()

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

Definition at line 94 of file ds1775.c.

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

Referenced by ds1775_sensor_read().

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

◆ ds1775_sensor_read()

static int ds1775_sensor_read ( struct ds1775_softc sc)
static

Definition at line 237 of file ds1775.c.

References buf, ds1775_read_2(), DS1775_TEMP, read, ds1775_softc::sc_addr, and ds1775_softc::sc_dev.

Referenced by ds1775_sensor_sysctl(), and ds1775_start().

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

◆ ds1775_sensor_sysctl()

static int ds1775_sensor_sysctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 256 of file ds1775.c.

References dev, and ds1775_sensor_read().

Referenced by ds1775_start().

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

◆ ds1775_start()

static void ds1775_start ( void *  xdev)
static

Definition at line 172 of file ds1775.c.

References dev, ds1775_sensor_read(), ds1775_sensor_sysctl(), ds1775_softc::enum_hook, and ds1775_softc::sc_sensor.

Referenced by ds1775_attach().

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

Variable Documentation

◆ ds1775_devclass

devclass_t ds1775_devclass
static

Definition at line 89 of file ds1775.c.

◆ ds1775_driver

driver_t ds1775_driver
static
Initial value:
= {
"ds1775",
sizeof(struct ds1775_softc)
}
static device_method_t ds1775_methods[]
Definition: ds1775.c:76

Definition at line 83 of file ds1775.c.

◆ ds1775_methods

device_method_t ds1775_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, ds1775_probe),
DEVMETHOD(device_attach, ds1775_attach),
{ 0, 0 },
}
static int ds1775_attach(device_t)
Definition: ds1775.c:148
static int ds1775_probe(device_t)
Definition: ds1775.c:122

Definition at line 76 of file ds1775.c.