iicbus.c (227843) | iicbus.c (228257) |
---|---|
1/*- 2 * Copyright (c) 1998, 2001 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998, 2001 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/iicbus/iicbus.c 227843 2011-11-22 21:28:20Z marius $"); | 28__FBSDID("$FreeBSD: head/sys/dev/iicbus/iicbus.c 228257 2011-12-04 11:55:33Z adrian $"); |
29 30/* 31 * Autoconfiguration and support routines for the Philips serial I2C bus 32 */ 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> --- 50 unchanged lines hidden (view full) --- 87 */ 88static int 89iicbus_attach(device_t dev) 90{ 91#if SCAN_IICBUS 92 unsigned char addr; 93#endif 94 struct iicbus_softc *sc = IICBUS_SOFTC(dev); | 29 30/* 31 * Autoconfiguration and support routines for the Philips serial I2C bus 32 */ 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> --- 50 unchanged lines hidden (view full) --- 87 */ 88static int 89iicbus_attach(device_t dev) 90{ 91#if SCAN_IICBUS 92 unsigned char addr; 93#endif 94 struct iicbus_softc *sc = IICBUS_SOFTC(dev); |
95 int strict; |
|
95 96 sc->dev = dev; 97 mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); 98 iicbus_reset(dev, IIC_FASTEST, 0, NULL); | 96 97 sc->dev = dev; 98 mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); 99 iicbus_reset(dev, IIC_FASTEST, 0, NULL); |
100 if (resource_int_value(device_get_name(dev), 101 device_get_unit(dev), "strict", &strict) == 0) 102 sc->strict = strict; 103 else 104 sc->strict = 1; |
|
99 100 /* device probing is meaningless since the bus is supposed to be 101 * hot-plug. Moreover, some I2C chips do not appreciate random 102 * accesses like stop after start to fast, reads for less than 103 * x bytes... 104 */ 105#if SCAN_IICBUS 106 printf("Probing for devices on iicbus%d:", device_get_unit(dev)); --- 165 unchanged lines hidden --- | 105 106 /* device probing is meaningless since the bus is supposed to be 107 * hot-plug. Moreover, some I2C chips do not appreciate random 108 * accesses like stop after start to fast, reads for less than 109 * x bytes... 110 */ 111#if SCAN_IICBUS 112 printf("Probing for devices on iicbus%d:", device_get_unit(dev)); --- 165 unchanged lines hidden --- |