Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10442
b: refs/heads/master
c: 42d3a12
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Oct 28, 2005
1 parent 5b717cb commit a041e4d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c09f98271f685af349d3f0199360f1c0e85550e0
refs/heads/master: 42d3a120fe9a1831b88e7037ce0b048d82433b09
22 changes: 22 additions & 0 deletions trunk/arch/arm/mach-s3c2410/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* 04-Oct-2004 BJD Added irq filter controls for GPIO
* 05-Nov-2004 BJD EXPORT_SYMBOL() added for all code
* 13-Mar-2005 BJD Updates for __iomem
* 26-Oct-2005 BJD Added generic configuration types
*/


Expand Down Expand Up @@ -58,6 +59,27 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
}

switch (function) {
case S3C2410_GPIO_LEAVE:
mask = 0;
function = 0;
break;

case S3C2410_GPIO_INPUT:
case S3C2410_GPIO_OUTPUT:
case S3C2410_GPIO_SFN2:
case S3C2410_GPIO_SFN3:
if (pin < S3C2410_GPIO_BANKB) {
function &= 1;
function <<= S3C2410_GPIO_OFFSET(pin);
} else {
function &= 3;
function <<= S3C2410_GPIO_OFFSET(pin)*2;
}
}

/* modify the specified register wwith IRQs off */

local_irq_save(flags);

con = __raw_readl(base + 0x00);
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/asm-arm/arch-s3c2410/regs-gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* 18-11-2004 BJD Added S3C2440 AC97 controls
* 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
* 28-Mar-2005 LCVR Fixed definition of GPB10
* 26-Oct-2005 BJD Added generic configuration types
*/


Expand All @@ -43,6 +44,11 @@
/* general configuration options */

#define S3C2410_GPIO_LEAVE (0xFFFFFFFF)
#define S3C2410_GPIO_INPUT (0xFFFFFFF0)
#define S3C2410_GPIO_OUTPUT (0xFFFFFFF1)
#define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */
#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */
#define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */

/* configure GPIO ports A..G */

Expand Down

0 comments on commit a041e4d

Please sign in to comment.