Deleted Added
full compact
bktr_i2c.c (146734) bktr_i2c.c (162234)
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/bktr/bktr_i2c.c 146734 2005-05-29 04:42:30Z nyan $");
28__FBSDID("$FreeBSD: head/sys/dev/bktr/bktr_i2c.c 162234 2006-09-11 20:52:41Z jhb $");
29
30/*
31 * I2C support for the bti2c chipset.
32 *
33 * From brooktree848.c <fsmp@freefall.org>
34 */
35
36#include "opt_bktr.h"

--- 77 unchanged lines hidden (view full) ---

114
115 if (sc->smbus && (error = device_delete_child(dev, sc->smbus)))
116 goto error;
117
118error:
119 return (error);
120}
121
29
30/*
31 * I2C support for the bti2c chipset.
32 *
33 * From brooktree848.c <fsmp@freefall.org>
34 */
35
36#include "opt_bktr.h"

--- 77 unchanged lines hidden (view full) ---

114
115 if (sc->smbus && (error = device_delete_child(dev, sc->smbus)))
116 goto error;
117
118error:
119 return (error);
120}
121
122int bti2c_smb_callback(device_t dev, int index, caddr_t *data)
122int bti2c_smb_callback(device_t dev, int index, void *data)
123{
124 struct bktr_softc *bktr_sc = (struct bktr_softc *)device_get_softc(dev);
125 struct bktr_i2c_softc *sc = &bktr_sc->i2c_sc;
126 int error = 0;
127
128 /* test each time if we already have/haven't the iicbus
129 * to avoid deadlocks
130 */

--- 202 unchanged lines hidden (view full) ---

333 }
334
335 *byte = (char)((INL(sc,BKTR_I2C_DATA_CTL) >> 8) & 0xff);
336 BTI2C_DEBUG(printf("r%x+", *byte));
337
338 return (0);
339}
340
123{
124 struct bktr_softc *bktr_sc = (struct bktr_softc *)device_get_softc(dev);
125 struct bktr_i2c_softc *sc = &bktr_sc->i2c_sc;
126 int error = 0;
127
128 /* test each time if we already have/haven't the iicbus
129 * to avoid deadlocks
130 */

--- 202 unchanged lines hidden (view full) ---

333 }
334
335 *byte = (char)((INL(sc,BKTR_I2C_DATA_CTL) >> 8) & 0xff);
336 BTI2C_DEBUG(printf("r%x+", *byte));
337
338 return (0);
339}
340
341DRIVER_MODULE(smbus, bktr, smbus_driver, smbus_devclass, 0, 0);
342
341#endif /* defined(BKTR_USE_FREEBSD_SMBUS) */
343#endif /* defined(BKTR_USE_FREEBSD_SMBUS) */