FreeBSD kernel IICBUS device code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
#include <dev/smbus/smb.h>
#include <dev/smbus/smbconf.h>
#include "iicbus_if.h"
#include "smbus_if.h"
Go to the source code of this file.
Data Structures | |
struct | iicsmb_softc |
Macros | |
#define | SMB_WAITING_ADDR 0x0 |
#define | SMB_WAITING_LOW 0x1 |
#define | SMB_WAITING_HIGH 0x2 |
#define | SMB_DONE 0x3 |
#define | TRANSFER_MSGS(dev, msgs) iicbus_transfer(dev, msgs, nitems(msgs)) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | iicsmb_probe (device_t) |
static int | iicsmb_attach (device_t) |
static int | iicsmb_detach (device_t) |
static void | iicsmb_identify (driver_t *driver, device_t parent) |
static int | iicsmb_intr (device_t dev, int event, char *buf) |
static int | iicsmb_callback (device_t dev, int index, void *data) |
static int | iicsmb_quick (device_t dev, u_char slave, int how) |
static int | iicsmb_sendb (device_t dev, u_char slave, char byte) |
static int | iicsmb_recvb (device_t dev, u_char slave, char *byte) |
static int | iicsmb_writeb (device_t dev, u_char slave, char cmd, char byte) |
static int | iicsmb_writew (device_t dev, u_char slave, char cmd, short word) |
static int | iicsmb_readb (device_t dev, u_char slave, char cmd, char *byte) |
static int | iicsmb_readw (device_t dev, u_char slave, char cmd, short *word) |
static int | iicsmb_pcall (device_t dev, u_char slave, char cmd, short sdata, short *rdata) |
static int | iicsmb_bwrite (device_t dev, u_char slave, char cmd, u_char count, char *buf) |
static int | iicsmb_bread (device_t dev, u_char slave, char cmd, u_char *count, char *buf) |
static int | iic2smb_error (int error) |
DRIVER_MODULE (iicsmb, iicbus, iicsmb_driver, iicsmb_devclass, 0, 0) | |
DRIVER_MODULE (smbus, iicsmb, smbus_driver, smbus_devclass, 0, 0) | |
MODULE_DEPEND (iicsmb, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER) | |
MODULE_DEPEND (iicsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER) | |
MODULE_VERSION (iicsmb, 1) | |
Variables | |
static devclass_t | iicsmb_devclass |
static device_method_t | iicsmb_methods [] |
static driver_t | iicsmb_driver |
__FBSDID | ( | "$FreeBSD$" | ) |
DRIVER_MODULE | ( | iicsmb | , |
iicbus | , | ||
iicsmb_driver | , | ||
iicsmb_devclass | , | ||
0 | , | ||
0 | |||
) |
DRIVER_MODULE | ( | smbus | , |
iicsmb | , | ||
smbus_driver | , | ||
smbus_devclass | , | ||
0 | , | ||
0 | |||
) |
|
static |
Definition at line 280 of file iicsmb.c.
References IIC_EBUSBSY, IIC_EBUSERR, IIC_ENOACK, IIC_ENOADDR, IIC_ENOTSUPP, IIC_EOVERFLOW, IIC_ERESOURCE, IIC_ESTATUS, IIC_ETIMEOUT, IIC_EUNDERFLOW, and IIC_NOERR.
Referenced by iicsmb_bread(), iicsmb_bwrite(), iicsmb_pcall(), iicsmb_quick(), iicsmb_readb(), iicsmb_readw(), iicsmb_recvb(), iicsmb_sendb(), iicsmb_writeb(), and iicsmb_writew().
|
static |
Definition at line 153 of file iicsmb.c.
References dev, iicsmb_softc::lock, and iicsmb_softc::smbus.
|
static |
Definition at line 445 of file iicsmb.c.
References buf, dev, iic2smb_error(), IIC_M_NOSTART, IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, IIC_RECURSIVE, IIC_WAIT, iicbus_release_bus(), iicbus_request_bus(), iic_msg::len, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 429 of file iicsmb.c.
References buf, bytes, dev, iic2smb_error(), IIC_M_NOSTART, IIC_M_NOSTOP, IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 254 of file iicsmb.c.
References data, dev, iicbus_release_bus(), iicbus_request_bus(), and index.
|
static |
Definition at line 168 of file iicsmb.c.
References dev, and iicsmb_softc::lock.
|
static |
|
static |
Definition at line 185 of file iicsmb.c.
References buf, dev, iicsmb_softc::devaddr, event, iicsmb_softc::high, IIC_EBUSERR, INTR_ERROR, INTR_GENERAL, INTR_NOACK, INTR_RECEIVE, INTR_START, INTR_STOP, INTR_TRANSMIT, iicsmb_softc::lock, iicsmb_softc::low, SMB_DONE, SMB_WAITING_ADDR, SMB_WAITING_HIGH, SMB_WAITING_LOW, iicsmb_softc::smbus, and iicsmb_softc::state.
|
static |
Definition at line 412 of file iicsmb.c.
References dev, iic2smb_error(), IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
|
static |
|
static |
Definition at line 313 of file iicsmb.c.
References dev, iic2smb_error(), IIC_M_RD, IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 383 of file iicsmb.c.
References dev, iic2smb_error(), IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 396 of file iicsmb.c.
References buf, dev, iic2smb_error(), IIC_M_NOSTOP, IIC_M_RD, IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 345 of file iicsmb.c.
References dev, iic2smb_error(), IIC_M_RD, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 333 of file iicsmb.c.
References dev, iic2smb_error(), IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 357 of file iicsmb.c.
References bytes, dev, iic2smb_error(), IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
|
static |
Definition at line 370 of file iicsmb.c.
References bytes, dev, iic2smb_error(), IIC_M_WR, msgs, slave, and TRANSFER_MSGS.
MODULE_DEPEND | ( | iicsmb | , |
iicbus | , | ||
IICBUS_MINVER | , | ||
IICBUS_PREFVER | , | ||
IICBUS_MAXVER | |||
) |
MODULE_DEPEND | ( | iicsmb | , |
smbus | , | ||
SMBUS_MINVER | , | ||
SMBUS_PREFVER | , | ||
SMBUS_MAXVER | |||
) |
MODULE_VERSION | ( | iicsmb | , |
1 | |||
) |
|
static |
|
static |