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 | syr827_reg_sc |
struct | syr827_softc |
Macros | |
#define | VSEL0 0x00 |
#define | VSEL1 0x01 |
#define | VSEL_BUCK_EN (1 << 7) |
#define | VSEL_NSEL_MASK 0x3F |
#define | VSEL_VOLTAGE_BASE 712500 /* uV */ |
#define | VSEL_VOLTAGE_STEP 12500 /* uV */ |
#define | ID1 0x03 |
#define | ID1_VENDOR_MASK 0xE0 |
#define | ID1_VENDOR_SHIFT 5 |
#define | ID1_DIE_MASK 0xF |
#define | ID2 0x4 |
#define | ID2_DIE_REV_MASK 0xF |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | syr827_read (device_t dev, uint8_t reg, uint8_t *data, uint8_t size) |
static int | syr827_write (device_t dev, uint8_t reg, uint8_t val) |
static int | syr827_regnode_init (struct regnode *regnode) |
static int | syr827_regnode_enable (struct regnode *regnode, bool enable, int *udelay) |
static int | syr827_regnode_set_voltage (struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) |
static int | syr827_regnode_get_voltage (struct regnode *regnode, int *uvolt) |
DEFINE_CLASS_1 (syr827_regnode, syr827_regnode_class, syr827_regnode_methods, sizeof(struct syr827_reg_sc), regnode_class) | |
static struct syr827_reg_sc * | syr827_reg_attach (device_t dev, phandle_t node) |
static int | syr827_regdev_map (device_t dev, phandle_t xref, int ncells, pcell_t *cells, intptr_t *num) |
static int | syr827_probe (device_t dev) |
static void | syr827_start (void *pdev) |
static int | syr827_attach (device_t dev) |
EARLY_DRIVER_MODULE (syr827, iicbus, syr827_driver, syr827_devclass, 0, 0, BUS_PASS_RESOURCE) | |
MODULE_VERSION (syr827, 1) | |
MODULE_DEPEND (syr827, iicbus, 1, 1, 1) | |
IICBUS_FDT_PNP_INFO (compat_data) | |
Variables | |
static struct ofw_compat_data | compat_data [] |
static regnode_method_t | syr827_regnode_methods [] |
static device_method_t | syr827_methods [] |
static driver_t | syr827_driver |
static devclass_t | syr827_devclass |
__FBSDID | ( | "$FreeBSD$" | ) |
DEFINE_CLASS_1 | ( | syr827_regnode | , |
syr827_regnode_class | , | ||
syr827_regnode_methods | , | ||
sizeof(struct syr827_reg_sc) | , | ||
regnode_class | |||
) |
EARLY_DRIVER_MODULE | ( | syr827 | , |
iicbus | , | ||
syr827_driver | , | ||
syr827_devclass | , | ||
0 | , | ||
0 | , | ||
BUS_PASS_RESOURCE | |||
) |
IICBUS_FDT_PNP_INFO | ( | compat_data | ) |
MODULE_DEPEND | ( | syr827 | , |
iicbus | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | syr827 | , |
1 | |||
) |
|
static |
Definition at line 278 of file syr827.c.
References syr827_softc::addr, dev, syr827_softc::intr_hook, syr827_softc::reg, syr827_reg_attach(), and syr827_start().
|
static |
Definition at line 242 of file syr827.c.
References compat_data, and dev.
|
static |
Definition at line 91 of file syr827.c.
References data, dev, IIC_INTRWAIT, and iicdev_readfrom().
Referenced by syr827_regnode_enable(), syr827_regnode_get_voltage(), syr827_regnode_set_voltage(), and syr827_start().
|
static |
Definition at line 182 of file syr827.c.
References syr827_reg_sc::base_dev, dev, syr827_reg_sc::param, syr827_reg_sc::regnode, syr827_reg_sc::suspend_reg, syr827_reg_sc::volt_reg, VSEL0, VSEL1, and syr827_reg_sc::xref.
Referenced by syr827_attach().
|
static |
Definition at line 226 of file syr827.c.
References dev, syr827_softc::reg, and syr827_reg_sc::xref.
|
static |
Definition at line 109 of file syr827.c.
References syr827_reg_sc::base_dev, syr827_reg_sc::param, syr827_reg_sc::regnode, syr827_read(), syr827_write(), val, syr827_reg_sc::volt_reg, and VSEL_BUCK_EN.
|
static |
Definition at line 156 of file syr827.c.
References syr827_reg_sc::base_dev, syr827_reg_sc::regnode, syr827_read(), val, syr827_reg_sc::volt_reg, VSEL_NSEL_MASK, VSEL_VOLTAGE_BASE, and VSEL_VOLTAGE_STEP.
|
static |
|
static |
Definition at line 129 of file syr827.c.
References syr827_reg_sc::base_dev, syr827_reg_sc::param, syr827_reg_sc::regnode, syr827_read(), syr827_write(), val, syr827_reg_sc::volt_reg, VSEL_NSEL_MASK, VSEL_VOLTAGE_BASE, and VSEL_VOLTAGE_STEP.
|
static |
Definition at line 256 of file syr827.c.
References dev, ID1, ID1_DIE_MASK, ID1_VENDOR_MASK, ID1_VENDOR_SHIFT, ID2, ID2_DIE_REV_MASK, syr827_softc::intr_hook, syr827_read(), and val.
Referenced by syr827_attach().
|
static |
Definition at line 97 of file syr827.c.
References dev, IIC_INTRWAIT, iicdev_writeto(), and val.
Referenced by syr827_regnode_enable(), and syr827_regnode_set_voltage().
|
static |
Definition at line 67 of file syr827.c.
Referenced by syr827_probe().
|
static |
|
static |
|
static |