Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77492
b: refs/heads/master
c: bb6d9b5
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Jan 28, 2008
1 parent 22d9d4c commit 6e65510
Show file tree
Hide file tree
Showing 3 changed files with 26 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: 9f613be4a9b6d680772b0a52a43a4a94d8e131b6
refs/heads/master: bb6d9b56c1d5c1cbff39b7c337c900e2b3d8387a
13 changes: 13 additions & 0 deletions trunk/arch/arm/plat-s3c24xx/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)

EXPORT_SYMBOL(s3c2410_gpio_pullup);

int s3c2410_gpio_getpull(unsigned int pin)
{
void __iomem *base = S3C24XX_GPIO_BASE(pin);
unsigned long offs = S3C2410_GPIO_OFFSET(pin);

if (pin < S3C2410_GPIO_BANKB)
return -EINVAL;

return (__raw_readl(base + 0x08) & (1L << offs)) ? 1 : 0;
}

EXPORT_SYMBOL(s3c2410_gpio_getpull);

void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)
{
void __iomem *base = S3C24XX_GPIO_BASE(pin);
Expand Down
12 changes: 12 additions & 0 deletions trunk/include/asm-arm/arch-s3c2410/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,

extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);

/* s3c2410_gpio_getpull
*
* Read the state of the pull-up on a given pin
*
* return:
* < 0 => error code
* 0 => enabled
* 1 => disabled
*/

extern int s3c2410_gpio_getpull(unsigned int pin);

extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);

extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
Expand Down

0 comments on commit 6e65510

Please sign in to comment.