#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 <dev/iicbus/iicbus.h>
#include <dev/iicbus/iiconf.h>
#include "clock_if.h"
#include "iicbus_if.h"
Go to the source code of this file.
|
| __FBSDID ("$FreeBSD$") |
|
static uint8_t | bitreverse (uint8_t x) |
|
static int | s390rtc_read (device_t dev, uint8_t reg, uint8_t *buf, size_t len) |
|
static int | s390rtc_write (device_t dev, uint8_t reg, uint8_t *buf, size_t len) |
|
static int | s390rtc_probe (device_t dev) |
|
static void | s390rtc_start (void *arg) |
|
static int | s390rtc_attach (device_t dev) |
|
static int | s390rtc_detach (device_t dev) |
|
static int | s390rtc_gettime (device_t dev, struct timespec *ts) |
|
static int | s390rtc_settime (device_t dev, struct timespec *ts) |
|
| DRIVER_MODULE (s35390a, iicbus, s390rtc_driver, s390rtc_devclass, NULL, NULL) |
|
| MODULE_VERSION (s35390a, 1) |
|
| MODULE_DEPEND (s35390a, iicbus, 1, 1, 1) |
|
◆ S390_ADDR
◆ S390_CLOCKADJ
#define S390_CLOCKADJ (6 << 1) |
◆ S390_DEVCODE
#define S390_DEVCODE 0x6 /* 0110 */ |
◆ S390_DEVNAME
#define S390_DEVNAME "s35390a_rtc" |
◆ S390_FREE
#define S390_FREE (7 << 1) |
◆ S390_INT1_1
#define S390_INT1_1 (4 << 1) |
◆ S390_INT1_2
#define S390_INT1_2 (5 << 1) |
◆ S390_REALTIME1
#define S390_REALTIME1 (2 << 1) |
◆ S390_REALTIME2
#define S390_REALTIME2 (3 << 1) |
◆ S390_RT1_DAY
◆ S390_RT1_HOUR
◆ S390_RT1_MINUTE
#define S390_RT1_MINUTE 5 |
◆ S390_RT1_MONTH
◆ S390_RT1_NBYTES
#define S390_RT1_NBYTES 7 |
◆ S390_RT1_SECOND
#define S390_RT1_SECOND 6 |
◆ S390_RT1_WDAY
◆ S390_RT1_YEAR
◆ S390_ST1_24H
#define S390_ST1_24H (1 << 1) |
◆ S390_ST1_BLD
#define S390_ST1_BLD (1 << 6) |
◆ S390_ST1_POC
#define S390_ST1_POC (1 << 7) |
◆ S390_ST1_RESET
#define S390_ST1_RESET (1 << 0) |
◆ S390_ST2_TEST
#define S390_ST2_TEST (1 << 7) |
◆ S390_STATUS1
#define S390_STATUS1 (0 << 1) |
◆ S390_STATUS2
#define S390_STATUS2 (1 << 1) |
◆ __FBSDID()
◆ bitreverse()
static uint8_t bitreverse |
( |
uint8_t |
x | ) |
|
|
static |
◆ DRIVER_MODULE()
◆ MODULE_DEPEND()
MODULE_DEPEND |
( |
s35390a |
, |
|
|
iicbus |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_VERSION()
MODULE_VERSION |
( |
s35390a |
, |
|
|
1 |
|
|
) |
| |
◆ s390rtc_attach()
static int s390rtc_attach |
( |
device_t |
dev | ) |
|
|
static |
◆ s390rtc_detach()
static int s390rtc_detach |
( |
device_t |
dev | ) |
|
|
static |
◆ s390rtc_gettime()
static int s390rtc_gettime |
( |
device_t |
dev, |
|
|
struct timespec * |
ts |
|
) |
| |
|
static |
Definition at line 297 of file s35390a.c.
References dev, S390_REALTIME1, S390_RT1_DAY, S390_RT1_HOUR, S390_RT1_MINUTE, S390_RT1_MONTH, S390_RT1_NBYTES, S390_RT1_SECOND, S390_RT1_WDAY, S390_RT1_YEAR, and s390rtc_read().
◆ s390rtc_probe()
static int s390rtc_probe |
( |
device_t |
dev | ) |
|
|
static |
◆ s390rtc_read()
static int s390rtc_read |
( |
device_t |
dev, |
|
|
uint8_t |
reg, |
|
|
uint8_t * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
static |
◆ s390rtc_settime()
static int s390rtc_settime |
( |
device_t |
dev, |
|
|
struct timespec * |
ts |
|
) |
| |
|
static |
Definition at line 327 of file s35390a.c.
References dev, S390_REALTIME1, S390_RT1_DAY, S390_RT1_HOUR, S390_RT1_MINUTE, S390_RT1_MONTH, S390_RT1_NBYTES, S390_RT1_SECOND, S390_RT1_WDAY, S390_RT1_YEAR, and s390rtc_write().
◆ s390rtc_start()
static void s390rtc_start |
( |
void * |
arg | ) |
|
|
static |
◆ s390rtc_write()
static int s390rtc_write |
( |
device_t |
dev, |
|
|
uint8_t |
reg, |
|
|
uint8_t * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
static |
◆ nibbletab
const uint8_t nibbletab[] |
|
static |
Initial value:= {
0x0,
0x8,
0x4,
0xc,
0x2,
0xa,
0x6,
0xe,
0x1,
0x9,
0x5,
0xd,
0x3,
0xb,
0x7,
0xf, }
Definition at line 132 of file s35390a.c.
Referenced by bitreverse().
◆ s390rtc_devclass
devclass_t s390rtc_devclass |
|
static |
◆ s390rtc_driver
Initial value:= {
}
static device_method_t s390rtc_methods[]
Definition at line 361 of file s35390a.c.
◆ s390rtc_methods
device_method_t s390rtc_methods[] |
|
static |
Initial value:= {
DEVMETHOD_END
}
static int s390rtc_gettime(device_t dev, struct timespec *ts)
static int s390rtc_detach(device_t dev)
static int s390rtc_settime(device_t dev, struct timespec *ts)
static int s390rtc_attach(device_t dev)
static int s390rtc_probe(device_t dev)
Definition at line 350 of file s35390a.c.