Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c AllWinner implementation uses a different regist...
details: https://anonhg.NetBSD.org/src/rev/b6e2e459f5d2
branches: trunk
changeset: 802319:b6e2e459f5d2
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Sep 09 22:44:32 2014 +0000
description:
AllWinner implementation uses a different register layout, select it with options GTTWSI_ALLWINNER
diffstat:
sys/dev/i2c/files.i2c | 3 ++-
sys/dev/i2c/gttwsireg.h | 14 +++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diffs (54 lines):
diff -r 45adc4227a2b -r b6e2e459f5d2 sys/dev/i2c/files.i2c
--- a/sys/dev/i2c/files.i2c Tue Sep 09 21:26:47 2014 +0000
+++ b/sys/dev/i2c/files.i2c Tue Sep 09 22:44:32 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.i2c,v 1.54 2014/05/18 11:46:23 kardel Exp $
+# $NetBSD: files.i2c,v 1.55 2014/09/09 22:44:32 jmcneill Exp $
obsolete defflag opt_i2cbus.h I2C_SCAN
define i2cbus { }
@@ -54,6 +54,7 @@
file dev/i2c/motoi2c.c motoi2c
define mvi2c
file dev/i2c/gttwsi_core.c mvi2c
+defflag opt_gttwsi.h GTTWSI_ALLWINNER
#
# I2C client devices
diff -r 45adc4227a2b -r b6e2e459f5d2 sys/dev/i2c/gttwsireg.h
--- a/sys/dev/i2c/gttwsireg.h Tue Sep 09 21:26:47 2014 +0000
+++ b/sys/dev/i2c/gttwsireg.h Tue Sep 09 22:44:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gttwsireg.h,v 1.1 2013/09/06 00:56:12 matt Exp $ */
+/* $NetBSD: gttwsireg.h,v 1.2 2014/09/09 22:44:32 jmcneill Exp $ */
/*
* Copyright (c) 2008 Eiji Kawauchi.
@@ -27,8 +27,19 @@
#ifndef _GTTWSIREG_H_
#define _GTTWSIREG_H_
+#include "opt_gttwsi.h"
+
#define GTTWSI_SIZE 0x100
+#if defined(GTTWSI_ALLWINNER)
+#define TWSI_SLAVEADDR 0x00
+#define TWSI_EXTEND_SLAVEADDR 0x04
+#define TWSI_DATA 0x08
+#define TWSI_CONTROL 0x0c
+#define TWSI_STATUS 0x10
+#define TWSI_BAUDRATE 0x14
+#define TWSI_SOFTRESET 0x1c
+#else
#define TWSI_SLAVEADDR 0x00
#define TWSI_EXTEND_SLAVEADDR 0x10
#define TWSI_DATA 0x04
@@ -36,6 +47,7 @@
#define TWSI_STATUS 0x0c /* for read */
#define TWSI_BAUDRATE 0x0c /* for write */
#define TWSI_SOFTRESET 0x1c
+#endif
#define SLAVEADDR_GCE_MASK 0x01
#define SLAVEADDR_SADDR_MASK 0xfe
Home |
Main Index |
Thread Index |
Old Index