FreeBSD kernel IICBUS device code
|
#include <sys/cdefs.h>
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/clock.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/sysctl.h>
#include <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/ds3231reg.h>
#include "clock_if.h"
#include "iicbus_if.h"
Go to the source code of this file.
Data Structures | |
struct | ds3231_softc |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | ds3231_start (void *) |
static int | ds3231_read1 (device_t dev, uint8_t reg, uint8_t *data) |
static int | ds3231_write1 (device_t dev, uint8_t reg, uint8_t data) |
static int | ds3231_ctrl_read (struct ds3231_softc *sc) |
static int | ds3231_ctrl_write (struct ds3231_softc *sc) |
static int | ds3231_status_read (struct ds3231_softc *sc) |
static int | ds3231_status_write (struct ds3231_softc *sc, int clear_a1, int clear_a2) |
static int | ds3231_temp_read (struct ds3231_softc *sc, int *temp) |
static int | ds3231_temp_sysctl (SYSCTL_HANDLER_ARGS) |
static int | ds3231_conv_sysctl (SYSCTL_HANDLER_ARGS) |
static int | ds3231_bbsqw_sysctl (SYSCTL_HANDLER_ARGS) |
static int | ds3231_sqw_freq_sysctl (SYSCTL_HANDLER_ARGS) |
static int | ds3231_str_sqw_mode (char *buf) |
static int | ds3231_sqw_mode_sysctl (SYSCTL_HANDLER_ARGS) |
static int | ds3231_en32khz_sysctl (SYSCTL_HANDLER_ARGS) |
static int | ds3231_probe (device_t dev) |
static int | ds3231_attach (device_t dev) |
static int | ds3231_detach (device_t dev) |
static int | ds3231_gettime (device_t dev, struct timespec *ts) |
static int | ds3231_settime (device_t dev, struct timespec *ts) |
DRIVER_MODULE (ds3231, iicbus, ds3231_driver, ds3231_devclass, NULL, NULL) | |
MODULE_VERSION (ds3231, 1) | |
MODULE_DEPEND (ds3231, iicbus, 1, 1, 1) | |
Variables | |
static device_method_t | ds3231_methods [] |
static driver_t | ds3231_driver |
static devclass_t | ds3231_devclass |
__FBSDID | ( | "$FreeBSD$" | ) |
DRIVER_MODULE | ( | ds3231 | , |
iicbus | , | ||
ds3231_driver | , | ||
ds3231_devclass | , | ||
NULL | , | ||
NULL | |||
) |
|
static |
Definition at line 376 of file ds3231.c.
References dev, ds3231_start(), ds3231_softc::enum_hook, ds3231_softc::sc_addr, ds3231_softc::sc_dev, ds3231_softc::sc_last_c, and ds3231_softc::sc_year0.
|
static |
Definition at line 220 of file ds3231.c.
References DS3231_CTRL_BBSQW, ds3231_ctrl_read(), ds3231_ctrl_write(), and ds3231_softc::sc_ctrl.
Referenced by ds3231_start().
|
static |
Definition at line 191 of file ds3231.c.
References DS3231_CTRL_CONV, ds3231_ctrl_read(), ds3231_ctrl_write(), DS3231_STATUS_BUSY, ds3231_status_read(), ds3231_softc::sc_ctrl, and ds3231_softc::sc_status.
Referenced by ds3231_start().
|
static |
Definition at line 85 of file ds3231.c.
References DS3231_CONTROL, ds3231_read1(), ds3231_softc::sc_ctrl, and ds3231_softc::sc_dev.
Referenced by ds3231_bbsqw_sysctl(), ds3231_conv_sysctl(), ds3231_sqw_freq_sysctl(), ds3231_sqw_mode_sysctl(), and ds3231_start().
|
static |
Definition at line 98 of file ds3231.c.
References data, DS3231_CONTROL, ds3231_write1(), ds3231_softc::sc_ctrl, and ds3231_softc::sc_dev.
Referenced by ds3231_bbsqw_sysctl(), ds3231_conv_sysctl(), ds3231_sqw_freq_sysctl(), ds3231_sqw_mode_sysctl(), and ds3231_start().
|
static |
|
static |
Definition at line 331 of file ds3231.c.
References DS3231_STATUS_EN32KHZ, ds3231_status_read(), ds3231_status_write(), and ds3231_softc::sc_status.
Referenced by ds3231_start().
|
static |
Definition at line 481 of file ds3231.c.
References data, dev, DS3231_C_MASK, DS3231_DATE, DS3231_DATE_MASK, DS3231_HOUR, DS3231_HOUR_IS_PM, DS3231_HOUR_MASK_12HR, DS3231_HOUR_MASK_24HR, DS3231_HOUR_USE_AMPM, DS3231_MINS, DS3231_MINS_MASK, DS3231_MONTH, DS3231_MONTH_MASK, DS3231_SECS, DS3231_SECS_MASK, DS3231_STATUS_OSF, ds3231_status_read(), DS3231_YEAR, DS3231_YEAR_MASK, IIC_INTRWAIT, iicdev_readfrom(), ds3231_softc::sc_dev, ds3231_softc::sc_last_c, ds3231_softc::sc_status, ds3231_softc::sc_use_ampm, and ds3231_softc::sc_year0.
|
static |
|
static |
Definition at line 71 of file ds3231.c.
References data, dev, IIC_INTRWAIT, and iicdev_readfrom().
Referenced by ds3231_ctrl_read(), and ds3231_status_read().
|
static |
Definition at line 540 of file ds3231.c.
References data, dev, DS3231_C_MASK, DS3231_DATE, DS3231_HOUR, DS3231_HOUR_IS_PM, DS3231_HOUR_USE_AMPM, DS3231_MINS, DS3231_MONTH, DS3231_SECS, DS3231_STATUS_OSF, ds3231_status_read(), ds3231_status_write(), DS3231_WEEKDAY, DS3231_YEAR, IIC_INTRWAIT, iicdev_writeto(), ds3231_softc::sc_dev, ds3231_softc::sc_last_c, ds3231_softc::sc_status, and ds3231_softc::sc_use_ampm.
|
static |
Definition at line 246 of file ds3231.c.
References ds3231_ctrl_read(), DS3231_CTRL_RS_MASK, DS3231_CTRL_RS_SHIFT, ds3231_ctrl_write(), and ds3231_softc::sc_ctrl.
Referenced by ds3231_start().
|
static |
Definition at line 297 of file ds3231.c.
References buf, DS3231_CTRL_INTCN, ds3231_ctrl_read(), ds3231_ctrl_write(), ds3231_str_sqw_mode(), and ds3231_softc::sc_ctrl.
Referenced by ds3231_start().
|
static |
Definition at line 407 of file ds3231.c.
References dev, ds3231_bbsqw_sysctl(), ds3231_conv_sysctl(), ds3231_ctrl_read(), ds3231_ctrl_write(), ds3231_en32khz_sysctl(), ds3231_sqw_freq_sysctl(), ds3231_sqw_mode_sysctl(), DS3231_STATUS_OSF, ds3231_status_read(), ds3231_status_write(), ds3231_temp_sysctl(), ds3231_softc::enum_hook, ds3231_softc::sc_dev, and ds3231_softc::sc_status.
Referenced by ds3231_attach().
|
static |
Definition at line 113 of file ds3231.c.
References ds3231_read1(), DS3231_STATUS, ds3231_softc::sc_dev, and ds3231_softc::sc_status.
Referenced by ds3231_conv_sysctl(), ds3231_en32khz_sysctl(), ds3231_gettime(), ds3231_settime(), and ds3231_start().
|
static |
Definition at line 127 of file ds3231.c.
References data, DS3231_STATUS, DS3231_STATUS_A1F, DS3231_STATUS_A2F, ds3231_write1(), ds3231_softc::sc_dev, and ds3231_softc::sc_status.
Referenced by ds3231_en32khz_sysctl(), ds3231_settime(), and ds3231_start().
|
static |
Definition at line 279 of file ds3231.c.
Referenced by ds3231_sqw_mode_sysctl().
|
static |
Definition at line 145 of file ds3231.c.
References buf, DS3231_0250C, DS3231_0500C, DS3231_NEG_BIT, DS3231_TEMP, DS3231_TEMP_MASK, IIC_INTRWAIT, iicdev_readfrom(), ds3231_softc::sc_dev, and TZ_ZEROC.
Referenced by ds3231_temp_sysctl().
|
static |
Definition at line 177 of file ds3231.c.
References ds3231_temp_read().
Referenced by ds3231_start().
|
static |
Definition at line 78 of file ds3231.c.
References data, dev, IIC_INTRWAIT, and iicdev_writeto().
Referenced by ds3231_ctrl_write(), and ds3231_status_write().
MODULE_DEPEND | ( | ds3231 | , |
iicbus | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | ds3231 | , |
1 | |||
) |
|
static |
|
static |