Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/allwinner add access function to get the i2c_co...
details: https://anonhg.NetBSD.org/src/rev/1b60d85e59aa
branches: trunk
changeset: 342522:1b60d85e59aa
user: macallan <macallan%NetBSD.org@localhost>
date: Sat Dec 26 16:54:41 2015 +0000
description:
add access function to get the i2c_controller, awiniic2 is the VGA output's
DDC2 port on cubietruck
diffstat:
sys/arch/arm/allwinner/awin_twi.c | 13 ++++++++++++-
sys/arch/arm/allwinner/awin_var.h | 4 +++-
2 files changed, 15 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r 03233be22df0 -r 1b60d85e59aa sys/arch/arm/allwinner/awin_twi.c
--- a/sys/arch/arm/allwinner/awin_twi.c Sat Dec 26 16:48:54 2015 +0000
+++ b/sys/arch/arm/allwinner/awin_twi.c Sat Dec 26 16:54:41 2015 +0000
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: awin_twi.c,v 1.6 2014/12/05 15:25:27 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_twi.c,v 1.7 2015/12/26 16:54:41 macallan Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -208,3 +208,14 @@
*/
gttwsi_config_children(self);
}
+
+struct i2c_controller *
+awin_twi_get_controller(device_t dev)
+{
+ if (!device_is_a(dev, "awiniic"))
+ return NULL;
+
+ struct awin_twi_softc * const sc = device_private(dev);
+
+ return &sc->asc_sc.sc_i2c;
+}
diff -r 03233be22df0 -r 1b60d85e59aa sys/arch/arm/allwinner/awin_var.h
--- a/sys/arch/arm/allwinner/awin_var.h Sat Dec 26 16:48:54 2015 +0000
+++ b/sys/arch/arm/allwinner/awin_var.h Sat Dec 26 16:54:41 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.39 2015/11/19 18:48:22 bouyer Exp $ */
+/* $NetBSD: awin_var.h,v 1.40 2015/12/26 16:54:41 macallan Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -189,4 +189,6 @@
}
}
+struct i2c_controller *awin_twi_get_controller(device_t);
+
#endif /* _ARM_ALLWINNER_AWIN_VAR_H_ */
Home |
Main Index |
Thread Index |
Old Index