diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2014-10-19 17:55:04 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2014-10-19 17:55:04 +0000 |
commit | ac5bd81fc64d21a5532af46077c07a9ca0867231 (patch) | |
tree | 028791eeeae101f988a5bc1df0f31cfdcd80267b /sys/arm | |
parent | e64855fef6e6cc48f63772dfd0b50b6814ced909 (diff) | |
download | FreeBSD-src-ac5bd81fc64d21a5532af46077c07a9ca0867231.zip FreeBSD-src-ac5bd81fc64d21a5532af46077c07a9ca0867231.tar.gz |
Style changes as pointed out by stas@.
MFC after: 1 week
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/ti/ti_wdt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arm/ti/ti_wdt.c b/sys/arm/ti/ti_wdt.c index bdb8c9d..7f50a61 100644 --- a/sys/arm/ti/ti_wdt.c +++ b/sys/arm/ti/ti_wdt.c @@ -98,12 +98,14 @@ DRIVER_MODULE(ti_wdt, simplebus, ti_wdt_driver, ti_wdt_devclass, 0, 0); static volatile __inline uint32_t ti_wdt_reg_read(struct ti_wdt_softc *sc, uint32_t reg) { + return (bus_space_read_4(sc->sc_bt, sc->sc_bh, reg)); } static __inline void ti_wdt_reg_write(struct ti_wdt_softc *sc, uint32_t reg, uint32_t val) { + bus_space_write_4(sc->sc_bt, sc->sc_bh, reg, val); } @@ -113,14 +115,15 @@ ti_wdt_reg_write(struct ti_wdt_softc *sc, uint32_t reg, uint32_t val) static __inline void ti_wdt_reg_wait(struct ti_wdt_softc *sc, uint32_t bit) { + while (ti_wdt_reg_read(sc, TI_WDT_WWPS) & bit) DELAY(10); - } static __inline void ti_wdt_disable(struct ti_wdt_softc *sc) { + DPRINTF("disabling watchdog %p\n", sc); ti_wdt_reg_write(sc, TI_WDT_WSPR, 0xAAAA); ti_wdt_reg_wait(sc, TI_W_PEND_WSPR); @@ -131,6 +134,7 @@ ti_wdt_disable(struct ti_wdt_softc *sc) static __inline void ti_wdt_enable(struct ti_wdt_softc *sc) { + DPRINTF("enabling watchdog %p\n", sc); ti_wdt_reg_write(sc, TI_WDT_WSPR, 0xBBBB); ti_wdt_reg_wait(sc, TI_W_PEND_WSPR); |