FreeBSD kernel IICBUS device code
iiconf.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/bus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
#include "iicbus_if.h"
Include dependency graph for iiconf.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
int errno2iic (int errno)
 
int iic2errno (int iic_status)
 
void iicbus_intr (device_t bus, int event, char *buf)
 
static int iicbus_poll (struct iicbus_softc *sc, int how)
 
int iicbus_request_bus (device_t bus, device_t dev, int how)
 
int iicbus_release_bus (device_t bus, device_t dev)
 
int iicbus_started (device_t bus)
 
int iicbus_start (device_t bus, u_char slave, int timeout)
 
int iicbus_repeated_start (device_t bus, u_char slave, int timeout)
 
int iicbus_stop (device_t bus)
 
int iicbus_write (device_t bus, const char *buf, int len, int *sent, int timeout)
 
int iicbus_read (device_t bus, char *buf, int len, int *read, int last, int delay)
 
int iicbus_write_byte (device_t bus, char byte, int timeout)
 
int iicbus_read_byte (device_t bus, char *byte, int timeout)
 
int iicbus_block_write (device_t bus, u_char slave, char *buf, int len, int *sent)
 
int iicbus_block_read (device_t bus, u_char slave, char *buf, int len, int *read)
 
int iicbus_transfer (device_t bus, struct iic_msg *msgs, uint32_t nmsgs)
 
int iicbus_transfer_excl (device_t dev, struct iic_msg *msgs, uint32_t nmsgs, int how)
 
int iicbus_transfer_gen (device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
 
int iicdev_readfrom (device_t slavedev, uint8_t regaddr, void *buffer, uint16_t buflen, int waithow)
 
int iicdev_writeto (device_t slavedev, uint8_t regaddr, void *buffer, uint16_t buflen, int waithow)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ errno2iic()

int errno2iic ( int  errno)

Definition at line 51 of file iiconf.c.

References IIC_ERRNO.

Referenced by acpi_iicbus_bread(), acpi_iicbus_bwrite(), iicbus_poll(), and iicdev_writeto().

Here is the caller graph for this function:

◆ iic2errno()

◆ iicbus_block_read()

int iicbus_block_read ( device_t  bus,
u_char  slave,
char *  buf,
int  len,
int *  read 
)

Definition at line 414 of file iiconf.c.

References addr, buf, IIC_LAST_READ, iicbus_read(), iicbus_start(), iicbus_stop(), len, LSB, read, and slave.

Here is the call graph for this function:

◆ iicbus_block_write()

int iicbus_block_write ( device_t  bus,
u_char  slave,
char *  buf,
int  len,
int *  sent 
)

Definition at line 393 of file iiconf.c.

References addr, buf, iicbus_start(), iicbus_stop(), iicbus_write(), len, and slave.

Referenced by icoutput().

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

◆ iicbus_intr()

void iicbus_intr ( device_t  bus,
int  event,
char *  buf 
)

Definition at line 97 of file iiconf.c.

References buf, event, and iicbus_softc::owner.

Referenced by iicmux_intr().

Here is the caller graph for this function:

◆ iicbus_poll()

static int iicbus_poll ( struct iicbus_softc sc,
int  how 
)
static

Definition at line 109 of file iiconf.c.

References errno2iic(), IIC_EBUSBSY, IIC_INTR, IIC_INTRWAIT, IIC_NOINTR, IIC_WAIT, IICBUS_ASSERT_LOCKED, IICPRI, and iicbus_softc::lock.

Referenced by iicbus_request_bus().

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

◆ iicbus_read()

int iicbus_read ( device_t  bus,
char *  buf,
int  len,
int *  read,
int  last,
int  delay 
)

Definition at line 339 of file iiconf.c.

References buf, delay, IIC_ESTATUS, last, len, LSB, read, iicbus_softc::started, and iicbus_softc::strict.

Referenced by iicbus_block_read(), iicbus_read_byte(), iicbus_transfer_gen(), iicmux_read(), and iicuio_move().

Here is the caller graph for this function:

◆ iicbus_read_byte()

int iicbus_read_byte ( device_t  bus,
char *  byte,
int  timeout 
)

Definition at line 375 of file iiconf.c.

References IIC_ESTATUS, IIC_LAST_READ, iicbus_read(), LSB, read, iicbus_softc::started, iicbus_softc::strict, and timeout.

Here is the call graph for this function:

◆ iicbus_release_bus()

◆ iicbus_repeated_start()

int iicbus_repeated_start ( device_t  bus,
u_char  slave,
int  timeout 
)

Definition at line 276 of file iiconf.c.

References IIC_ESTATUS, slave, iicbus_softc::started, and timeout.

Referenced by iicbus_transfer_gen(), iicioctl(), and iicmux_repeated_start().

Here is the caller graph for this function:

◆ iicbus_request_bus()

◆ iicbus_start()

int iicbus_start ( device_t  bus,
u_char  slave,
int  timeout 
)

Definition at line 254 of file iiconf.c.

References IIC_ESTATUS, slave, iicbus_softc::started, and timeout.

Referenced by iicbus_block_read(), iicbus_block_write(), iicbus_transfer_gen(), iicioctl(), iicmux_start(), and iicuio().

Here is the caller graph for this function:

◆ iicbus_started()

int iicbus_started ( device_t  bus)

Definition at line 241 of file iiconf.c.

References iicbus_softc::started.

◆ iicbus_stop()

int iicbus_stop ( device_t  bus)

Definition at line 298 of file iiconf.c.

References IIC_ESTATUS, and iicbus_softc::started.

Referenced by iicbus_block_read(), iicbus_block_write(), iicbus_transfer_gen(), iicdtor(), iicioctl(), iicmux_stop(), and iicuio().

Here is the caller graph for this function:

◆ iicbus_transfer()

◆ iicbus_transfer_excl()

◆ iicbus_transfer_gen()

int iicbus_transfer_gen ( device_t  dev,
struct iic_msg msgs,
uint32_t  nmsgs 
)

Definition at line 469 of file iiconf.c.

References addr, buf, dev, IIC_ENOTSUPP, IIC_ERESOURCE, IIC_LAST_READ, IIC_M_NOSTART, IIC_M_NOSTOP, IIC_M_RD, iicbus_read(), iicbus_repeated_start(), iicbus_start(), iicbus_stop(), iicbus_write(), len, LSB, msgs, nmsgs, iic_msg::slave, and iicbus_softc::started.

Referenced by iicbb_transfer(), and twsi_transfer().

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

◆ iicbus_write()

int iicbus_write ( device_t  bus,
const char *  buf,
int  len,
int *  sent,
int  timeout 
)

Definition at line 321 of file iiconf.c.

References buf, IIC_ESTATUS, len, LSB, iicbus_softc::started, iicbus_softc::strict, and timeout.

Referenced by iicbus_block_write(), iicbus_transfer_gen(), iicbus_write_byte(), iicmux_write(), and iicuio_move().

Here is the caller graph for this function:

◆ iicbus_write_byte()

int iicbus_write_byte ( device_t  bus,
char  byte,
int  timeout 
)

Definition at line 356 of file iiconf.c.

References data, IIC_ESTATUS, iicbus_write(), LSB, iicbus_softc::started, iicbus_softc::strict, and timeout.

Here is the call graph for this function:

◆ iicdev_readfrom()

◆ iicdev_writeto()

int iicdev_writeto ( device_t  slavedev,
uint8_t  regaddr,
void *  buffer,
uint16_t  buflen,
int  waithow 
)