Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/omap add a function to lookup the i2c controlle...
details: https://anonhg.NetBSD.org/src/rev/149a3d550e92
branches: trunk
changeset: 783631:149a3d550e92
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Jan 01 23:20:24 2013 +0000
description:
add a function to lookup the i2c controller tag for the specified device_t
diffstat:
sys/arch/arm/omap/omap3_i2c.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r 6deaba0dd4fc -r 149a3d550e92 sys/arch/arm/omap/omap3_i2c.c
--- a/sys/arch/arm/omap/omap3_i2c.c Tue Jan 01 19:03:26 2013 +0000
+++ b/sys/arch/arm/omap/omap3_i2c.c Tue Jan 01 23:20:24 2013 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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_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 @@
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;
+}
Home |
Main Index |
Thread Index |
Old Index