ad7418.c (302408) | ad7418.c (323421) |
---|---|
1/*- 2 * Copyright (c) 2006 Sam Leffler. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 9 unchanged lines hidden (view full) --- 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 */ 24 25#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 Sam Leffler. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 9 unchanged lines hidden (view full) --- 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 */ 24 25#include <sys/cdefs.h> |
26__FBSDID("$FreeBSD: stable/11/sys/dev/iicbus/ad7418.c 246128 2013-01-30 18:01:20Z sbz $"); | 26__FBSDID("$FreeBSD: stable/11/sys/dev/iicbus/ad7418.c 323421 2017-09-11 02:56:45Z ian $"); |
27/* 28 * Analog Devices AD7418 chip sitting on the I2C bus. 29 */ 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/lock.h> 34#include <sys/module.h> --- 80 unchanged lines hidden (view full) --- 115ad7418_attach(device_t dev) 116{ 117 struct ad7418_softc *sc = device_get_softc(dev); 118 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); 119 struct sysctl_oid *tree = device_get_sysctl_tree(dev); 120 int conf; 121 122 sc->sc_dev = dev; | 27/* 28 * Analog Devices AD7418 chip sitting on the I2C bus. 29 */ 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/lock.h> 34#include <sys/module.h> --- 80 unchanged lines hidden (view full) --- 115ad7418_attach(device_t dev) 116{ 117 struct ad7418_softc *sc = device_get_softc(dev); 118 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); 119 struct sysctl_oid *tree = device_get_sysctl_tree(dev); 120 int conf; 121 122 sc->sc_dev = dev; |
123 sc->sc_lastupdate = ticks - hz; 124 |
|
123 sx_init(&sc->sc_lock, "ad7418"); 124 125 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, 126 "temp", CTLTYPE_INT | CTLFLAG_RD, sc, 0, 127 ad7418_sysctl_temp, "I", "operating temperature"); 128 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, 129 "volt", CTLTYPE_INT | CTLFLAG_RD, sc, 0, 130 ad7418_sysctl_voltage, "I", "input voltage"); --- 104 unchanged lines hidden --- | 125 sx_init(&sc->sc_lock, "ad7418"); 126 127 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, 128 "temp", CTLTYPE_INT | CTLFLAG_RD, sc, 0, 129 ad7418_sysctl_temp, "I", "operating temperature"); 130 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, 131 "volt", CTLTYPE_INT | CTLFLAG_RD, sc, 0, 132 ad7418_sysctl_voltage, "I", "input voltage"); --- 104 unchanged lines hidden --- |