Module Name: src
Committed By: khorben
Date: Fri May 10 01:25:07 UTC 2013
Modified Files:
src/sys/dev/spi [khorben-n900]: files.spi spi.c spivar.h
Log Message:
Just like for the I2C and GPIO buses, added an interrupt locator to the SPI
bus, so that ARM device drivers on either of these buses (like on the Nokia
N900) can register and react on system interrupts. These interrupts are
typically triggered via GPIO pins.
XXX This change is not adequate because intr_establish() is a MD interface,
so it will have to be re-designed before merging to the main tree.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.114.1 src/sys/dev/spi/files.spi
cvs rdiff -u -r1.8 -r1.8.6.1 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.4 -r1.4.20.1 src/sys/dev/spi/spivar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/spi/files.spi
diff -u src/sys/dev/spi/files.spi:1.2 src/sys/dev/spi/files.spi:1.2.114.1
--- src/sys/dev/spi/files.spi:1.2 Sat Oct 7 07:21:13 2006
+++ src/sys/dev/spi/files.spi Fri May 10 01:25:07 2013
@@ -1,8 +1,8 @@
-# $NetBSD: files.spi,v 1.2 2006/10/07 07:21:13 gdamore Exp $
+# $NetBSD: files.spi,v 1.2.114.1 2013/05/10 01:25:07 khorben Exp $
define spibus { }
-device spi { slave }
+device spi { slave, [intr = -1] }
attach spi at spibus
file dev/spi/spi.c spi | spibus
Index: src/sys/dev/spi/spi.c
diff -u src/sys/dev/spi/spi.c:1.8 src/sys/dev/spi/spi.c:1.8.6.1
--- src/sys/dev/spi/spi.c:1.8 Fri Feb 15 17:44:40 2013
+++ src/sys/dev/spi/spi.c Fri May 10 01:25:07 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.8 2013/02/15 17:44:40 rkujawa Exp $ */
+/* $NetBSD: spi.c,v 1.8.6.1 2013/05/10 01:25:07 khorben Exp $ */
/*-
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.8 2013/02/15 17:44:40 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.8.6.1 2013/05/10 01:25:07 khorben Exp $");
#include "locators.h"
@@ -119,6 +119,7 @@ spi_search(device_t parent, cfdata_t cf,
}
sa.sa_handle = &sc->sc_slaves[addr];
+ sa.sa_intr = cf->cf_loc[SPICF_INTR];
if (config_match(parent, cf, &sa) > 0)
config_attach(parent, cf, &sa, spi_print);
Index: src/sys/dev/spi/spivar.h
diff -u src/sys/dev/spi/spivar.h:1.4 src/sys/dev/spi/spivar.h:1.4.20.1
--- src/sys/dev/spi/spivar.h:1.4 Wed Jun 8 23:05:48 2011
+++ src/sys/dev/spi/spivar.h Fri May 10 01:25:07 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: spivar.h,v 1.4 2011/06/08 23:05:48 rmind Exp $ */
+/* $NetBSD: spivar.h,v 1.4.20.1 2013/05/10 01:25:07 khorben Exp $ */
/*-
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -82,6 +82,7 @@ struct spibus_attach_args {
struct spi_attach_args {
struct spi_handle *sa_handle;
+ int sa_intr;
};
/*