MFC: r201008

Style changes

Obtained from:	NetBSD (mc146818reg.h)
This commit is contained in:
Marius Strobl 2010-01-15 16:27:57 +00:00
parent ca3405fdef
commit b70d493910
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/8/; revision=202393
4 changed files with 34 additions and 28 deletions

View File

@ -94,7 +94,7 @@ mc146818_attach(device_t dev)
(*sc->sc_mcwrite)(dev, MC_REGB, sc->sc_regb);
mtx_unlock_spin(&sc->sc_mtx);
clock_register(dev, 1000000); /* 1 second resolution. */
clock_register(dev, 1000000); /* 1 second resolution */
return (0);
}
@ -260,6 +260,9 @@ mc146818_def_write(device_t dev, u_int reg, u_int val)
bus_space_write_1(sc->sc_bst, sc->sc_bsh, MC_DATA, val);
}
#undef MC_ADDR
#undef MC_DATA
/*
* Looks like it's common even across platforms to store the century at
* 0x32 in the NVRAM of the mc146818.
@ -283,3 +286,5 @@ mc146818_def_setcent(device_t dev, u_int cent)
sc = device_get_softc(dev);
(*sc->sc_mcwrite)(dev, MC_CENT, cent);
}
#undef MC_CENT

View File

@ -22,7 +22,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* from: NetBSD: mc146818reg.h,v 1.5 2003/11/02 11:07:45 wiz Exp
* $NetBSD: mc146818reg.h,v 1.9 2006/03/08 23:46:25 lukem Exp $
*
* $FreeBSD$
*/

View File

@ -38,29 +38,30 @@ struct mc146818_softc {
u_char sc_regb; /* register B */
u_int sc_year0; /* year counter offset */
u_int sc_flag; /* MD flags */
#define MC146818_NO_CENT_ADJUST 0x0001 /* don't adjust century */
#define MC146818_BCD 0x0002 /* use BCD mode */
#define MC146818_12HR 0x0004 /* use AM/PM mode */
/* MD chip register read/write functions */
u_int (*sc_mcread)(device_t, u_int);
void (*sc_mcwrite)(device_t, u_int, u_int);
u_int (*sc_mcread)(device_t dev, u_int reg);
void (*sc_mcwrite)(device_t dev, u_int reg, u_int val);
/* MD century get/set functions */
u_int (*sc_getcent)(device_t);
void (*sc_setcent)(device_t, u_int);
u_int (*sc_getcent)(device_t dev);
void (*sc_setcent)(device_t dev, u_int cent);
};
/* Default read/write functions */
u_int mc146818_def_read(device_t, u_int);
void mc146818_def_write(device_t, u_int, u_int);
u_int mc146818_def_read(device_t dev, u_int reg);
void mc146818_def_write(device_t dev, u_int reg, u_int val);
/* Chip attach function */
int mc146818_attach(device_t);
/* Methods for the clock interface */
#ifdef notyet
int mc146818_getsecs(device_t, int *);
int mc146818_getsecs(device_t dev, int *secp);
#endif
int mc146818_gettime(device_t, struct timespec *);
int mc146818_settime(device_t, struct timespec *);
int mc146818_gettime(device_t dev, struct timespec *ts);
int mc146818_settime(device_t dev, struct timespec *ts);

View File

@ -111,7 +111,7 @@ static device_method_t rtc_isa_methods[] = {
DEVMETHOD(clock_gettime, mc146818_gettime),
DEVMETHOD(clock_settime, mc146818_settime),
{ 0, 0 }
KOBJMETHOD_END
};
static driver_t rtc_isa_driver = {
@ -123,8 +123,8 @@ static driver_t rtc_isa_driver = {
DRIVER_MODULE(rtc, isa, rtc_isa_driver, rtc_devclass, 0, 0);
#endif
static u_int pc87317_getcent(device_t);
static void pc87317_setcent(device_t, u_int);
static u_int pc87317_getcent(device_t dev);
static void pc87317_setcent(device_t dev, u_int cent);
static int
rtc_ebus_probe(device_t dev)