Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/khorben-n900]: src/sys/dev/spi Just like for the I2C and GPIO buses, add...
details: https://anonhg.NetBSD.org/src/rev/2b9367e07760
branches: khorben-n900
changeset: 786698:2b9367e07760
user: khorben <khorben%NetBSD.org@localhost>
date: Fri May 10 01:25:07 2013 +0000
description:
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.
diffstat:
sys/dev/spi/files.spi | 4 ++--
sys/dev/spi/spi.c | 5 +++--
sys/dev/spi/spivar.h | 3 ++-
3 files changed, 7 insertions(+), 5 deletions(-)
diffs (57 lines):
diff -r 7670a593273d -r 2b9367e07760 sys/dev/spi/files.spi
--- a/sys/dev/spi/files.spi Fri May 10 01:20:04 2013 +0000
+++ b/sys/dev/spi/files.spi Fri May 10 01:25:07 2013 +0000
@@ -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
diff -r 7670a593273d -r 2b9367e07760 sys/dev/spi/spi.c
--- a/sys/dev/spi/spi.c Fri May 10 01:20:04 2013 +0000
+++ b/sys/dev/spi/spi.c Fri May 10 01:25:07 2013 +0000
@@ -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 @@
}
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);
diff -r 7670a593273d -r 2b9367e07760 sys/dev/spi/spivar.h
--- a/sys/dev/spi/spivar.h Fri May 10 01:20:04 2013 +0000
+++ b/sys/dev/spi/spivar.h Fri May 10 01:25:07 2013 +0000
@@ -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 spi_attach_args {
struct spi_handle *sa_handle;
+ int sa_intr;
};
/*
Home |
Main Index |
Thread Index |
Old Index