Date: Tue, 13 Apr 2010 15:15:50 GMT From: Rafal Jaworowski <raj@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 176863 for review Message-ID: <201004131515.o3DFFo84050919@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@176863?ac=10 Change 176863 by raj@raj_fdt on 2010/04/13 15:15:11 Provide decoding handler for the legacy CHRP PIC (8259). Affected files ... .. //depot/projects/fdt/sys/dev/fdt/fdt_powerpc.c#4 edit Differences ... ==== //depot/projects/fdt/sys/dev/fdt/fdt_powerpc.c#4 (text+ko) ==== @@ -85,9 +85,37 @@ fdt_pic_decode_iic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) { + if (!fdt_is_compatible(node, "chrp,iic")) + return (ENXIO); + + *interrupt = intr[0]; - /* TODO */ - return (ENXIO); + switch (intr[1]) { + case 0: + /* Active L level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_LOW; + break; + case 1: + /* Active H level */ + *trig = INTR_TRIGGER_LEVEL; + *pol = INTR_POLARITY_HIGH; + break; + case 2: + /* H to L edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_LOW; + break; + case 3: + /* L to H edge */ + *trig = INTR_TRIGGER_EDGE; + *pol = INTR_POLARITY_HIGH; + break; + default: + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + } + return (0); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004131515.o3DFFo84050919>