FreeBSD kernel IICBUS device code
max44009.c File Reference
#include <sys/cdefs.h>
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/bus.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>
Include dependency graph for max44009.c:

Go to the source code of this file.

Data Structures

struct  max44009_softc
 

Macros

#define REG_LUX_HIGH   0x03
 
#define REG_LUX_LOW   0x04
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int max44009_get_reading (device_t dev, u_int *reading)
 
static int max44009_lux_sysctl (SYSCTL_HANDLER_ARGS)
 
static int max44009_probe (device_t dev)
 
static int max44009_attach (device_t dev)
 
static int max44009_detach (device_t dev)
 
 DRIVER_MODULE (max44009, iicbus, max44009_driver, max44009_devclass, 0, 0)
 
 MODULE_DEPEND (max44009, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER)
 
 MODULE_VERSION (max44009, 1)
 
 IICBUS_FDT_PNP_INFO (compat_data)
 

Variables

static device_method_t max44009_methods []
 
static driver_t max44009_driver
 
static devclass_t max44009_devclass
 

Macro Definition Documentation

◆ REG_LUX_HIGH

#define REG_LUX_HIGH   0x03

Definition at line 54 of file max44009.c.

◆ REG_LUX_LOW

#define REG_LUX_LOW   0x04

Definition at line 55 of file max44009.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( max44009  ,
iicbus  ,
max44009_driver  ,
max44009_devclass  ,
,
 
)

◆ IICBUS_FDT_PNP_INFO()

IICBUS_FDT_PNP_INFO ( compat_data  )

◆ max44009_attach()

static int max44009_attach ( device_t  dev)
static

Definition at line 146 of file max44009.c.

References dev, max44009_lux_sysctl(), max44009_softc::sc_addr, and max44009_softc::sc_dev.

Here is the call graph for this function:

◆ max44009_detach()

static int max44009_detach ( device_t  dev)
static

Definition at line 168 of file max44009.c.

◆ max44009_get_reading()

static int max44009_get_reading ( device_t  dev,
u_int *  reading 
)
static

Definition at line 70 of file max44009.c.

References iic_msg::buf, dev, iic_msg::flags, IIC_INTRWAIT, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, iicbus_transfer_excl(), iic_msg::len, msgs, REG_LUX_HIGH, REG_LUX_LOW, max44009_softc::sc_addr, iic_msg::slave, and val.

Referenced by max44009_lux_sysctl().

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

◆ max44009_lux_sysctl()

static int max44009_lux_sysctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 111 of file max44009.c.

References dev, max44009_get_reading(), and val.

Referenced by max44009_attach().

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

◆ max44009_probe()

static int max44009_probe ( device_t  dev)
static

Definition at line 129 of file max44009.c.

References compat_data, and dev.

◆ MODULE_DEPEND()

MODULE_DEPEND ( max44009  ,
iicbus  ,
IICBUS_MINVER  ,
IICBUS_PREFVER  ,
IICBUS_MAXVER   
)

◆ MODULE_VERSION()

MODULE_VERSION ( max44009  ,
 
)

Variable Documentation

◆ max44009_devclass

devclass_t max44009_devclass
static

Definition at line 188 of file max44009.c.

◆ max44009_driver

driver_t max44009_driver
static
Initial value:
= {
"max44009",
sizeof(struct max44009_softc)
}
static device_method_t max44009_methods[]
Definition: max44009.c:173

Definition at line 182 of file max44009.c.

◆ max44009_methods

device_method_t max44009_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, max44009_probe),
DEVMETHOD(device_attach, max44009_attach),
DEVMETHOD(device_detach, max44009_detach),
DEVMETHOD_END
}
static int max44009_attach(device_t dev)
Definition: max44009.c:146
static int max44009_detach(device_t dev)
Definition: max44009.c:168
static int max44009_probe(device_t dev)
Definition: max44009.c:129

Definition at line 173 of file max44009.c.