From werner at docs.openmoko.org Fri Dec 23 15:38:45 2011 From: werner at docs.openmoko.org (werner at docs.openmoko.org) Date: Fri, 23 Dec 2011 15:38:45 +0100 Subject: r6007 - trunk/src/target/gpio Message-ID: Author: werner Date: 2011-12-23 15:38:45 +0100 (Fri, 23 Dec 2011) New Revision: 6007 Modified: trunk/src/target/gpio/gpio-s3c6410.c Log: gpio-s3c6410.c (set_h): correct offset of pull-up register (by Andy Pevy) Andy wrote: In the set_h function, the offset used for calculating the pud register address is set to 8 but the actual offset for the 3 registers that use the function (GPIO ports H, K and L) should be 0x0C. I have changed my code and I can now successfully use port K on my application. Modified: trunk/src/target/gpio/gpio-s3c6410.c =================================================================== --- trunk/src/target/gpio/gpio-s3c6410.c 2011-03-24 23:42:47 UTC (rev 6006) +++ trunk/src/target/gpio/gpio-s3c6410.c 2011-12-23 14:38:45 UTC (rev 6007) @@ -204,9 +204,9 @@ *(uint32_t *) (mem+p->offset+4) = dat; } - pud = *(uint32_t *) (mem+p->offset+8); + pud = *(uint32_t *) (mem+p->offset+12); pud = (pud & ~(15 << (num*4))) | (r << (num*4)); - *(uint32_t *) (mem+p->offset+8) = pud; + *(uint32_t *) (mem+p->offset+12) = pud; } From werner at docs.openmoko.org Fri Dec 23 21:59:54 2011 From: werner at docs.openmoko.org (werner at docs.openmoko.org) Date: Fri, 23 Dec 2011 21:59:54 +0100 Subject: r6008 - trunk/src/target/gpio Message-ID: Author: werner Date: 2011-12-23 21:59:54 +0100 (Fri, 23 Dec 2011) New Revision: 6008 Modified: trunk/src/target/gpio/gpio-s3c6410.c Log: gpio-s3c6410.c (set_h): changed "dat" offset from 4 to 8 (by Andy Pevy) Modified: trunk/src/target/gpio/gpio-s3c6410.c =================================================================== --- trunk/src/target/gpio/gpio-s3c6410.c 2011-12-23 14:38:45 UTC (rev 6007) +++ trunk/src/target/gpio/gpio-s3c6410.c 2011-12-23 20:59:54 UTC (rev 6008) @@ -199,9 +199,9 @@ } if (d != -1) { - dat = *(uint32_t *) (mem+p->offset+4); + dat = *(uint32_t *) (mem+p->offset+8); dat = (dat & ~(1 << num)) | (d << num); - *(uint32_t *) (mem+p->offset+4) = dat; + *(uint32_t *) (mem+p->offset+8) = dat; } pud = *(uint32_t *) (mem+p->offset+12);