Port-powerpc archive

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

Re: New trigger types for OpenPIC



On Tue, 10 Jan 2012 23:03:32 +0900
"Toru Nishimura" <locore64%alkyltechnology.com@localhost> wrote:

> How about using plain if-clauses there like;
> 
>     if (i8259iswired && irq == 0)
>         x |= OPENPIC_POLARITY_POSITIVE; /* ISA style southbridge
> compat */ else if (type == IST_LEVEL_RISING || type == IST_LEVEL_HIGH)
>         x |= OPENPIC_POLARITY_POSITIVE;
>     else
>         x |= OPENPIC_POLARITY_NEGATIVE;
>     if (type == IST_EDGE_FALLING || type == IST_EDGE_RASING)
>         x |= OPENPIC_SENSE_EDGE;
>     else
>         x |= OPENPIC_SENSE_LEVEL;

Ok for me. This might increase readability.

I just realized that I will also have to add the new types to intr.c.

--- intr.c      27 Sep 2011 01:02:36 -0000      1.18
+++ intr.c      10 Jan 2012 14:37:03 -0000
@@ -168,8 +168,10 @@
        case IST_NONE:
                is->is_type = type;
                break;
-       case IST_EDGE:
-       case IST_LEVEL:
+       case IST_EDGE_FALLING:
+       case IST_EDGE_RAISING:
+       case IST_LEVEL_LOW:
+       case IST_LEVEL_HIGH:
                if (type == is->is_type)
                        break;
                /* FALLTHROUGH */
@@ -327,8 +329,10 @@
 static const char * const intr_typenames[] = {
    [IST_NONE]  = "none",
    [IST_PULSE] = "pulsed",
-   [IST_EDGE]  = "edge-triggered",
-   [IST_LEVEL] = "level-triggered",
+   [IST_EDGE_FALLING]  = "falling edge triggered",
+   [IST_EDGE_RISING]  = "rising edge triggered",
+   [IST_LEVEL_LOW] = "low level triggered",
+   [IST_LEVEL_HIGH] = "high level triggered",
 };
 
 const char *

-- 
Frank Wille


Home | Main Index | Thread Index | Old Index