Module Name: src Committed By: jmcneill Date: Tue Jan 1 23:20:25 UTC 2013
Modified Files: src/sys/arch/arm/omap: omap3_i2c.c Log Message: add a function to lookup the i2c controller tag for the specified device_t To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omap3_i2c.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/omap/omap3_i2c.c diff -u src/sys/arch/arm/omap/omap3_i2c.c:1.1 src/sys/arch/arm/omap/omap3_i2c.c:1.2 --- src/sys/arch/arm/omap/omap3_i2c.c:1.1 Mon Dec 31 12:45:49 2012 +++ src/sys/arch/arm/omap/omap3_i2c.c Tue Jan 1 23:20:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: omap3_i2c.c,v 1.1 2012/12/31 12:45:49 jmcneill Exp $ */ +/* $NetBSD: omap3_i2c.c,v 1.2 2013/01/01 23:20:24 jmcneill Exp $ */ /*- * Copyright (c) 2012 Jared D. McNeill <jmcne...@invisible.ca> @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: omap3_i2c.c,v 1.1 2012/12/31 12:45:49 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: omap3_i2c.c,v 1.2 2013/01/01 23:20:24 jmcneill Exp $"); #include "opt_omap.h" @@ -88,6 +88,8 @@ static int omap3_i2c_wait(struct omap3_i static int omap3_i2c_stat(struct omap3_i2c_softc *); static int omap3_i2c_flush(struct omap3_i2c_softc *); +i2c_tag_t omap3_i2c_get_tag(device_t); + CFATTACH_DECL2_NEW(omap3_i2c, sizeof(struct omap3_i2c_softc), omap3_i2c_match, omap3_i2c_attach, NULL, NULL, omap3_i2c_rescan, omap3_i2c_childdet); @@ -434,3 +436,15 @@ omap3_i2c_flush(struct omap3_i2c_softc * return 0; } + +i2c_tag_t +omap3_i2c_get_tag(device_t dev) +{ + struct omap3_i2c_softc *sc; + + if (dev == NULL) + return NULL; + sc = device_private(dev); + + return &sc->sc_ic; +}