Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/khorben-n900]: src/sys/arch/evbarm Let the device drivers on the GPIO bu...



details:   https://anonhg.NetBSD.org/src/rev/5e4bafa443fa
branches:  khorben-n900
changeset: 786702:5e4bafa443fa
user:      khorben <khorben%NetBSD.org@localhost>
date:      Sat May 11 18:01:04 2013 +0000

description:
Let the device drivers on the GPIO bus use the interrupt locator.

diffstat:

 sys/arch/evbarm/conf/N900          |  16 ++++++++--------
 sys/arch/evbarm/n900/n900_acad.c   |  13 ++++---------
 sys/arch/evbarm/n900/n900_audjck.c |  13 ++++---------
 sys/arch/evbarm/n900/n900_cambtn.c |  17 ++++++-----------
 sys/arch/evbarm/n900/n900_camcvr.c |  13 ++++---------
 sys/arch/evbarm/n900/n900_kbdsld.c |  13 ++++---------
 sys/arch/evbarm/n900/n900_lckbtn.c |  13 ++++---------
 sys/arch/evbarm/n900/n900_prxmty.c |  13 ++++---------
 8 files changed, 38 insertions(+), 73 deletions(-)

diffs (truncated from 339 to 300 lines):

diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/conf/N900
--- a/sys/arch/evbarm/conf/N900 Sat May 11 17:48:22 2013 +0000
+++ b/sys/arch/evbarm/conf/N900 Sat May 11 18:01:04 2013 +0000
@@ -1,5 +1,5 @@
 #
-#      $NetBSD: N900,v 1.13.2.1 2013/05/11 17:28:51 khorben Exp $
+#      $NetBSD: N900,v 1.13.2.2 2013/05/11 18:01:04 khorben Exp $
 #
 #      N900 -- Nokia N900 Kernel
 #
@@ -216,25 +216,25 @@
 
 # GPIO devices
 # Charging sensor
-n900acad0      at gpio0 offset 7 mask 0x1 #intr 103
+n900acad0      at gpio0 offset 7 mask 0x1 intr 103
 
 # Camera button
-n900cambtn0    at gpio2 offset 4 mask 0x3 #intr 164, 165
+n900cambtn0    at gpio2 offset 4 mask 0x3 intr 164 #and 165
 
 # Keyboard slide
-n900kbdsld0    at gpio2 offset 7 mask 0x1 #intr 167
+n900kbdsld0    at gpio2 offset 7 mask 0x1 intr 167
 
 # Proximity sensor
-n900prxmty0    at gpio2 offset 25 mask 0x1 #intr 185
+n900prxmty0    at gpio2 offset 25 mask 0x1 intr 185
 
 # Camera cover
-n900camcvr0    at gpio3 offset 14 mask 0x1 #intr 206
+n900camcvr0    at gpio3 offset 14 mask 0x1 intr 206
 
 # Lock button
-n900lckbtn0    at gpio3 offset 17 mask 0x1 #intr 209
+n900lckbtn0    at gpio3 offset 17 mask 0x1 intr 209
 
 # Audio jack
-n900audjck0    at gpio5 offset 17 mask 0x1 #intr 273
+n900audjck0    at gpio5 offset 17 mask 0x1 intr 273
 
 # System Control Module
 omapscm0       at obio0 addr 0x48002000 size 0x1000
diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/n900/n900_acad.c
--- a/sys/arch/evbarm/n900/n900_acad.c  Sat May 11 17:48:22 2013 +0000
+++ b/sys/arch/evbarm/n900/n900_acad.c  Sat May 11 18:01:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n900_acad.c,v 1.5 2013/04/20 03:37:55 khorben Exp $ */
+/*     $NetBSD: n900_acad.c,v 1.5.2.1 2013/05/11 18:01:04 khorben Exp $ */
 
 /*
  * AC adapter driver for the Nokia N900.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: n900_acad.c,v 1.5 2013/04/20 03:37:55 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: n900_acad.c,v 1.5.2.1 2013/05/11 18:01:04 khorben Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,11 +45,6 @@
 #include <arm/omap/omap2_gpio.h>
 
 
-/* The base interrupt for the corresponding GPIO device where this driver
- * attaches. This is an ugly workaround the current limitations of gpio(4),
- * which does not seem to allow a better way to locate the interrupt yet. */
-#define N900ACAD_GPIO_BASE     96
-
 #define N900ACAD_PIN_INPUT     0
 #define N900ACAD_NPINS 1
 
@@ -127,8 +122,8 @@
        gpio_pin_ctl(sc->sc_gpio, &sc->sc_map, N900ACAD_PIN_INPUT,
                        GPIO_PIN_INPUT);
 
-       sc->sc_intr = intr_establish(N900ACAD_GPIO_BASE + ga->ga_offset, IPL_VM,
-                       IST_EDGE_RISING, n900acad_intr, sc);
+       sc->sc_intr = intr_establish(ga->ga_intr, IPL_VM, IST_EDGE_RISING,
+                       n900acad_intr, sc);
        if (sc->sc_intr == NULL) {
                aprint_error(": couldn't establish interrupt\n");
                gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/n900/n900_audjck.c
--- a/sys/arch/evbarm/n900/n900_audjck.c        Sat May 11 17:48:22 2013 +0000
+++ b/sys/arch/evbarm/n900/n900_audjck.c        Sat May 11 18:01:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n900_audjck.c,v 1.1 2013/05/06 22:56:54 khorben Exp $ */
+/*     $NetBSD: n900_audjck.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $ */
 
 /*
  * Audio jack driver for the Nokia N900.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: n900_audjck.c,v 1.1 2013/05/06 22:56:54 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: n900_audjck.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,11 +45,6 @@
 #include <arm/omap/omap2_gpio.h>
 
 
-/* The base interrupt for the corresponding GPIO device where this driver
- * attaches. This is an ugly workaround the current limitations of gpio(4),
- * which does not seem to allow a better way to locate the interrupt yet. */
-#define N900AUDJCK_GPIO_BASE   256
-
 #define N900AUDJCK_PIN_INPUT   0
 #define N900AUDJCK_NPINS       1
 
@@ -128,8 +123,8 @@
        gpio_pin_ctl(sc->sc_gpio, &sc->sc_map, N900AUDJCK_PIN_INPUT,
                        GPIO_PIN_INPUT);
 
-       sc->sc_intr = intr_establish(N900AUDJCK_GPIO_BASE + ga->ga_offset,
-                       IPL_VM, IST_EDGE_BOTH, n900audjck_intr, sc);
+       sc->sc_intr = intr_establish(ga->ga_intr, IPL_VM, IST_EDGE_BOTH,
+                       n900audjck_intr, sc);
        if (sc->sc_intr == NULL) {
                aprint_error(": couldn't establish interrupt\n");
                gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/n900/n900_cambtn.c
--- a/sys/arch/evbarm/n900/n900_cambtn.c        Sat May 11 17:48:22 2013 +0000
+++ b/sys/arch/evbarm/n900/n900_cambtn.c        Sat May 11 18:01:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n900_cambtn.c,v 1.1 2013/04/20 03:37:55 khorben Exp $ */
+/*     $NetBSD: n900_cambtn.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $ */
 
 /*
  * Camera button driver for the Nokia N900.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: n900_cambtn.c,v 1.1 2013/04/20 03:37:55 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: n900_cambtn.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -46,11 +46,6 @@
 #include <arm/omap/omap2_gpio.h>
 
 
-/* The base interrupt for the corresponding GPIO device where this driver
- * attaches. This is an ugly workaround the current limitations of gpio(4),
- * which does not seem to allow a better way to locate the interrupt yet. */
-#define N900CAMBTN_GPIO_BASE   160
-
 #define N900CAMBTN_PIN_FOCUS   0
 #define N900CAMBTN_PIN_CAPTURE 1
 #define N900CAMBTN_NPINS       2
@@ -140,15 +135,15 @@
        gpio_pin_ctl(sc->sc_gpio, &sc->sc_map, N900CAMBTN_PIN_FOCUS,
                        GPIO_PIN_INPUT);
 
-       sc->sc_intr[0] = intr_establish(N900CAMBTN_GPIO_BASE + ga->ga_offset,
-                       IPL_VM, IST_EDGE_BOTH, n900cambtn_intr, sc);
+       sc->sc_intr[0] = intr_establish(ga->ga_intr, IPL_VM, IST_EDGE_BOTH,
+                       n900cambtn_intr, sc);
        if (sc->sc_intr[0] == NULL) {
                aprint_error(": couldn't establish interrupt\n");
                return;
        }
 
-       sc->sc_intr[1] = intr_establish(N900CAMBTN_GPIO_BASE + ga->ga_offset
-                       + 1, IPL_VM, IST_EDGE_BOTH, n900cambtn_intr, sc);
+       sc->sc_intr[1] = intr_establish(ga->ga_intr + 1, IPL_VM, IST_EDGE_BOTH,
+                       n900cambtn_intr, sc);
        if (sc->sc_intr[1] == NULL) {
                aprint_error(": couldn't establish interrupt\n");
                intr_disestablish(sc->sc_intr[0]);
diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/n900/n900_camcvr.c
--- a/sys/arch/evbarm/n900/n900_camcvr.c        Sat May 11 17:48:22 2013 +0000
+++ b/sys/arch/evbarm/n900/n900_camcvr.c        Sat May 11 18:01:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n900_camcvr.c,v 1.1 2013/04/20 03:37:55 khorben Exp $ */
+/*     $NetBSD: n900_camcvr.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $ */
 
 /*
  * Camera cover driver for the Nokia N900.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: n900_camcvr.c,v 1.1 2013/04/20 03:37:55 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: n900_camcvr.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,11 +45,6 @@
 #include <arm/omap/omap2_gpio.h>
 
 
-/* The base interrupt for the corresponding GPIO device where this driver
- * attaches. This is an ugly workaround the current limitations of gpio(4),
- * which does not seem to allow a better way to locate the interrupt yet. */
-#define N900CAMCVR_GPIO_BASE   192
-
 #define N900CAMCVR_PIN_INPUT   0
 #define N900CAMCVR_NPINS       1
 
@@ -127,8 +122,8 @@
        gpio_pin_ctl(sc->sc_gpio, &sc->sc_map, N900CAMCVR_PIN_INPUT,
                        GPIO_PIN_INPUT);
 
-       sc->sc_intr = intr_establish(N900CAMCVR_GPIO_BASE + ga->ga_offset,
-                       IPL_VM, IST_EDGE_BOTH, n900camcvr_intr, sc);
+       sc->sc_intr = intr_establish(ga->ga_intr, IPL_VM, IST_EDGE_BOTH,
+                       n900camcvr_intr, sc);
        if (sc->sc_intr == NULL) {
                aprint_error(": couldn't establish interrupt\n");
                gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/n900/n900_kbdsld.c
--- a/sys/arch/evbarm/n900/n900_kbdsld.c        Sat May 11 17:48:22 2013 +0000
+++ b/sys/arch/evbarm/n900/n900_kbdsld.c        Sat May 11 18:01:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n900_kbdsld.c,v 1.1 2013/04/20 03:37:55 khorben Exp $ */
+/*     $NetBSD: n900_kbdsld.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $ */
 
 /*
  * Keypad slide driver for the Nokia N900.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: n900_kbdsld.c,v 1.1 2013/04/20 03:37:55 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: n900_kbdsld.c,v 1.1.2.1 2013/05/11 18:01:04 khorben Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,11 +45,6 @@
 #include <arm/omap/omap2_gpio.h>
 
 
-/* The base interrupt for the corresponding GPIO device where this driver
- * attaches. This is an ugly workaround the current limitations of gpio(4),
- * which does not seem to allow a better way to locate the interrupt yet. */
-#define N900KBDSLD_GPIO_BASE   160
-
 #define N900KBDSLD_PIN_INPUT   0
 #define N900KBDSLD_NPINS       1
 
@@ -127,8 +122,8 @@
        gpio_pin_ctl(sc->sc_gpio, &sc->sc_map, N900KBDSLD_PIN_INPUT,
                        GPIO_PIN_INPUT);
 
-       sc->sc_intr = intr_establish(N900KBDSLD_GPIO_BASE + ga->ga_offset,
-                       IPL_VM, IST_EDGE_BOTH, n900kbdsld_intr, sc);
+       sc->sc_intr = intr_establish(ga->ga_intr, IPL_VM, IST_EDGE_BOTH,
+                       n900kbdsld_intr, sc);
        if (sc->sc_intr == NULL) {
                aprint_error(": couldn't establish interrupt\n");
                gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/n900/n900_lckbtn.c
--- a/sys/arch/evbarm/n900/n900_lckbtn.c        Sat May 11 17:48:22 2013 +0000
+++ b/sys/arch/evbarm/n900/n900_lckbtn.c        Sat May 11 18:01:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n900_lckbtn.c,v 1.3 2013/04/20 03:37:55 khorben Exp $ */
+/*     $NetBSD: n900_lckbtn.c,v 1.3.2.1 2013/05/11 18:01:04 khorben Exp $ */
 
 /*
  * Lock button driver for the Nokia N900.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: n900_lckbtn.c,v 1.3 2013/04/20 03:37:55 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: n900_lckbtn.c,v 1.3.2.1 2013/05/11 18:01:04 khorben Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,11 +45,6 @@
 #include <arm/omap/omap2_gpio.h>
 
 
-/* The base interrupt for the corresponding GPIO device where this driver
- * attaches. This is an ugly workaround the current limitations of gpio(4),
- * which does not seem to allow a better way to locate the interrupt yet. */
-#define N900LCKBTN_GPIO_BASE   192
-
 #define N900LCKBTN_PIN_INPUT   0
 #define N900LCKBTN_NPINS       1
 
@@ -128,8 +123,8 @@
        gpio_pin_ctl(sc->sc_gpio, &sc->sc_map, N900LCKBTN_PIN_INPUT,
                        GPIO_PIN_INPUT);
 
-       sc->sc_intr = intr_establish(N900LCKBTN_GPIO_BASE + ga->ga_offset,
-                       IPL_VM, IST_EDGE_BOTH, n900lckbtn_intr, sc);
+       sc->sc_intr = intr_establish(ga->ga_intr, IPL_VM, IST_EDGE_BOTH,
+                       n900lckbtn_intr, sc);
        if (sc->sc_intr == NULL) {
                aprint_error(": couldn't establish interrupt\n");
                gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
diff -r a8a42975c384 -r 5e4bafa443fa sys/arch/evbarm/n900/n900_prxmty.c
--- a/sys/arch/evbarm/n900/n900_prxmty.c        Sat May 11 17:48:22 2013 +0000



Home | Main Index | Thread Index | Old Index