FreeBSD kernel IICBUS device code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/kernel.h>
#include <sys/reboot.h>
#include <sys/module.h>
#include <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/extres/regulator/regulator.h>
#include "iicbus_if.h"
#include "regdev_if.h"
Go to the source code of this file.
Data Structures | |
struct | sy8106a_reg_sc |
struct | sy8106a_softc |
Macros | |
#define | VOUT1_SEL 0x01 |
#define | SEL_GO (1 << 7) |
#define | SEL_VOLTAGE_MASK 0x7f |
#define | SEL_VOLTAGE_BASE 680000 /* uV */ |
#define | SEL_VOLTAGE_STEP 10000 /* uV */ |
#define | VOUT_COM 0x02 |
#define | COM_DISABLE (1 << 0) |
#define | SYS_STATUS 0x06 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | sy8106a_read (device_t dev, uint8_t reg, uint8_t *data, uint8_t size) |
static int | sy8106a_write (device_t dev, uint8_t reg, uint8_t val) |
static int | sy8106a_regnode_init (struct regnode *regnode) |
static int | sy8106a_regnode_enable (struct regnode *regnode, bool enable, int *udelay) |
static int | sy8106a_regnode_set_voltage (struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) |
static int | sy8106a_regnode_get_voltage (struct regnode *regnode, int *uvolt) |
DEFINE_CLASS_1 (sy8106a_regnode, sy8106a_regnode_class, sy8106a_regnode_methods, sizeof(struct sy8106a_reg_sc), regnode_class) | |
static struct sy8106a_reg_sc * | sy8106a_reg_attach (device_t dev, phandle_t node) |
static int | sy8106a_regdev_map (device_t dev, phandle_t xref, int ncells, pcell_t *cells, intptr_t *num) |
static int | sy8106a_probe (device_t dev) |
static int | sy8106a_attach (device_t dev) |
EARLY_DRIVER_MODULE (sy8106a, iicbus, sy8106a_driver, sy8106a_devclass, 0, 0, BUS_PASS_RESOURCE) | |
MODULE_VERSION (sy8106a, 1) | |
MODULE_DEPEND (sy8106a, iicbus, 1, 1, 1) | |
IICBUS_FDT_PNP_INFO (compat_data) | |
Variables | |
static struct ofw_compat_data | compat_data [] |
static regnode_method_t | sy8106a_regnode_methods [] |
static device_method_t | sy8106a_methods [] |
static driver_t | sy8106a_driver |
static devclass_t | sy8106a_devclass |
__FBSDID | ( | "$FreeBSD$" | ) |
DEFINE_CLASS_1 | ( | sy8106a_regnode | , |
sy8106a_regnode_class | , | ||
sy8106a_regnode_methods | , | ||
sizeof(struct sy8106a_reg_sc) | , | ||
regnode_class | |||
) |
EARLY_DRIVER_MODULE | ( | sy8106a | , |
iicbus | , | ||
sy8106a_driver | , | ||
sy8106a_devclass | , | ||
0 | , | ||
0 | , | ||
BUS_PASS_RESOURCE | |||
) |
IICBUS_FDT_PNP_INFO | ( | compat_data | ) |
MODULE_DEPEND | ( | sy8106a | , |
iicbus | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | sy8106a | , |
1 | |||
) |
|
static |
Definition at line 260 of file sy8106a.c.
References sy8106a_softc::addr, dev, sy8106a_softc::reg, and sy8106a_reg_attach().
|
static |
Definition at line 246 of file sy8106a.c.
References compat_data, and dev.
|
static |
Definition at line 83 of file sy8106a.c.
References sy8106a_softc::addr, iic_msg::buf, data, dev, iic_msg::flags, IIC_M_RD, IIC_M_WR, iicbus_transfer(), iic_msg::len, and iic_msg::slave.
Referenced by sy8106a_regnode_enable(), sy8106a_regnode_get_voltage(), and sy8106a_regnode_set_voltage().
|
static |
Definition at line 202 of file sy8106a.c.
References sy8106a_reg_sc::base_dev, dev, sy8106a_reg_sc::param, sy8106a_reg_sc::regnode, and sy8106a_reg_sc::xref.
Referenced by sy8106a_attach().
|
static |
Definition at line 230 of file sy8106a.c.
References dev, sy8106a_softc::reg, and sy8106a_reg_sc::xref.
|
static |
Definition at line 130 of file sy8106a.c.
References sy8106a_reg_sc::base_dev, COM_DISABLE, sy8106a_reg_sc::param, sy8106a_reg_sc::regnode, sy8106a_read(), sy8106a_write(), val, and VOUT_COM.
|
static |
Definition at line 176 of file sy8106a.c.
References sy8106a_reg_sc::base_dev, sy8106a_reg_sc::regnode, SEL_VOLTAGE_BASE, SEL_VOLTAGE_MASK, SEL_VOLTAGE_STEP, sy8106a_read(), val, and VOUT1_SEL.
|
static |
|
static |
Definition at line 150 of file sy8106a.c.
References sy8106a_reg_sc::base_dev, sy8106a_reg_sc::param, sy8106a_reg_sc::regnode, SEL_GO, SEL_VOLTAGE_BASE, SEL_VOLTAGE_MASK, SEL_VOLTAGE_STEP, sy8106a_read(), sy8106a_write(), val, and VOUT1_SEL.
|
static |
Definition at line 104 of file sy8106a.c.
References sy8106a_softc::addr, iic_msg::buf, dev, iic_msg::flags, IIC_M_WR, iicbus_transfer(), iic_msg::len, iic_msg::slave, and val.
Referenced by sy8106a_regnode_enable(), and sy8106a_regnode_set_voltage().
|
static |
Definition at line 63 of file sy8106a.c.
Referenced by sy8106a_probe().
|
static |
|
static |
|
static |