FreeBSD kernel IICBUS device code
iicbus.h File Reference
#include <sys/_lock.h>
#include <sys/_mutex.h>
Include dependency graph for iicbus.h:

Go to the source code of this file.

Data Structures

struct  iicbus_softc
 
struct  iicbus_ivar
 

Macros

#define IICBUS_IVAR(d)   (struct iicbus_ivar *) device_get_ivars(d)
 
#define IICBUS_SOFTC(d)   (struct iicbus_softc *) device_get_softc(d)
 
#define IICBUS_ACCESSOR(A, B, T)    __BUS_ACCESSOR(iicbus, A, IICBUS, B, T)
 
#define IICBUS_LOCK(sc)   mtx_lock(&(sc)->lock)
 
#define IICBUS_UNLOCK(sc)   mtx_unlock(&(sc)->lock)
 
#define IICBUS_ASSERT_LOCKED(sc)   mtx_assert(&(sc)->lock, MA_OWNED)
 
#define IICBUS_FDT_PNP_INFO(t)
 
#define IICBUS_ACPI_PNP_INFO(t)
 

Enumerations

enum  { IICBUS_IVAR_ADDR }
 

Functions

int iicbus_generic_intr (device_t dev, int event, char *buf)
 
void iicbus_init_frequency (device_t dev, u_int bus_freq)
 
int iicbus_attach_common (device_t dev, u_int bus_freq)
 
device_t iicbus_add_child_common (device_t dev, u_int order, const char *name, int unit, size_t ivars_size)
 
int iicbus_detach (device_t dev)
 
void iicbus_probe_nomatch (device_t bus, device_t child)
 
int iicbus_read_ivar (device_t bus, device_t child, int which, uintptr_t *result)
 
int iicbus_write_ivar (device_t bus, device_t child, int which, uintptr_t value)
 
int iicbus_child_location (device_t bus, device_t child, struct sbuf *sb)
 
int iicbus_child_pnpinfo (device_t bus, device_t child, struct sbuf *sb)
 

Variables

driver_t iicbus_driver
 
devclass_t iicbus_devclass
 
driver_t ofw_iicbus_driver
 
devclass_t ofw_iicbus_devclass
 
driver_t acpi_iicbus_driver
 

Macro Definition Documentation

◆ IICBUS_ACCESSOR

#define IICBUS_ACCESSOR (   A,
  B,
 
)     __BUS_ACCESSOR(iicbus, A, IICBUS, B, T)

Definition at line 65 of file iicbus.h.

◆ IICBUS_ACPI_PNP_INFO

#define IICBUS_ACPI_PNP_INFO (   t)

Definition at line 83 of file iicbus.h.

◆ IICBUS_ASSERT_LOCKED

#define IICBUS_ASSERT_LOCKED (   sc)    mtx_assert(&(sc)->lock, MA_OWNED)

Definition at line 72 of file iicbus.h.

◆ IICBUS_FDT_PNP_INFO

#define IICBUS_FDT_PNP_INFO (   t)

Definition at line 77 of file iicbus.h.

◆ IICBUS_IVAR

#define IICBUS_IVAR (   d)    (struct iicbus_ivar *) device_get_ivars(d)

Definition at line 37 of file iicbus.h.

◆ IICBUS_LOCK

#define IICBUS_LOCK (   sc)    mtx_lock(&(sc)->lock)

Definition at line 70 of file iicbus.h.

◆ IICBUS_SOFTC

#define IICBUS_SOFTC (   d)    (struct iicbus_softc *) device_get_softc(d)

Definition at line 38 of file iicbus.h.

◆ IICBUS_UNLOCK

#define IICBUS_UNLOCK (   sc)    mtx_unlock(&(sc)->lock)

Definition at line 71 of file iicbus.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IICBUS_IVAR_ADDR 

Definition at line 61 of file iicbus.h.

Function Documentation

◆ iicbus_add_child_common()

device_t iicbus_add_child_common ( device_t  dev,
u_int  order,
const char *  name,
int  unit,
size_t  ivars_size 
)

Definition at line 226 of file iicbus.c.

References dev, and iicbus_ivar::rl.

Referenced by acpi_iicbus_add_child(), and iicbus_add_child().

Here is the caller graph for this function:

◆ iicbus_attach_common()

int iicbus_attach_common ( device_t  dev,
u_int  bus_freq 
)

Definition at line 96 of file iicbus.c.

References addr, iicbus_softc::bus_freq, iicbus_softc::dev, dev, IIC_FASTEST, iicbus_init_frequency(), iicbus_reset, IICBUS_SOFTC, iicbus_softc::lock, and iicbus_softc::strict.

Referenced by acpi_iicbus_attach(), and iicbus_attach().

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

◆ iicbus_child_location()

int iicbus_child_location ( device_t  bus,
device_t  child,
struct sbuf *  sb 
)

Definition at line 180 of file iicbus.c.

References iicbus_ivar::addr, and IICBUS_IVAR.

Referenced by acpi_iicbus_child_location().

Here is the caller graph for this function:

◆ iicbus_child_pnpinfo()

int iicbus_child_pnpinfo ( device_t  bus,
device_t  child,
struct sbuf *  sb 
)

Definition at line 189 of file iicbus.c.

Referenced by acpi_iicbus_child_pnpinfo().

Here is the caller graph for this function:

◆ iicbus_detach()

int iicbus_detach ( device_t  dev)

Definition at line 144 of file iicbus.c.

References dev, IIC_FASTEST, iicbus_reset, IICBUS_SOFTC, and iicbus_softc::lock.

Referenced by acpi_iicbus_detach().

Here is the caller graph for this function:

◆ iicbus_generic_intr()

int iicbus_generic_intr ( device_t  dev,
int  event,
char *  buf 
)

Definition at line 280 of file iicbus.c.

◆ iicbus_init_frequency()

void iicbus_init_frequency ( device_t  dev,
u_int  bus_freq 
)

Definition at line 301 of file iicbus.c.

References iicbus_softc::bus_freq, dev, and IICBUS_SOFTC.

Referenced by iicbus_attach_common(), and ofw_iicbus_attach().

Here is the caller graph for this function:

◆ iicbus_probe_nomatch()

void iicbus_probe_nomatch ( device_t  bus,
device_t  child 
)

Definition at line 172 of file iicbus.c.

References iicbus_ivar::addr, and IICBUS_IVAR.

Referenced by acpi_iicbus_probe_nomatch().

Here is the caller graph for this function:

◆ iicbus_read_ivar()

int iicbus_read_ivar ( device_t  bus,
device_t  child,
int  which,
uintptr_t *  result 
)

Definition at line 195 of file iicbus.c.

References iicbus_ivar::addr, IICBUS_IVAR, and IICBUS_IVAR_ADDR.

Referenced by acpi_iicbus_read_ivar().

Here is the caller graph for this function:

◆ iicbus_write_ivar()

int iicbus_write_ivar ( device_t  bus,
device_t  child,
int  which,
uintptr_t  value 
)

Definition at line 210 of file iicbus.c.

References iicbus_ivar::addr, IICBUS_IVAR, and IICBUS_IVAR_ADDR.

Referenced by acpi_iicbus_write_ivar().

Here is the caller graph for this function:

Variable Documentation

◆ acpi_iicbus_driver

driver_t acpi_iicbus_driver
extern

◆ iicbus_devclass

devclass_t iicbus_devclass
extern

Definition at line 386 of file iicbus.c.

◆ iicbus_driver

driver_t iicbus_driver
extern

Definition at line 380 of file iicbus.c.

◆ ofw_iicbus_devclass

devclass_t ofw_iicbus_devclass
extern

Definition at line 85 of file ofw_iicbus.c.

◆ ofw_iicbus_driver

driver_t ofw_iicbus_driver
extern