Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192001
b: refs/heads/master
c: 7987bd7
h: refs/heads/master
i:
  191999: 23a84c0
v: v3
  • Loading branch information
Ben Dooks committed May 18, 2010
1 parent 98a1d4d commit 0f5ba07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c8fcfbf735e2d3b139e4247eb3e73edf64bb23f
refs/heads/master: 7987bd7a7051c979f7b9b572898f92dbef6aaeb1
12 changes: 7 additions & 5 deletions trunk/arch/arm/mach-s3c2412/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@
#include <linux/types.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>

#include <mach/regs-gpio.h>

#include <mach/hardware.h>

#include <plat/gpio-core.h>

int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state)
{
void __iomem *base = S3C24XX_GPIO_BASE(pin);
unsigned long offs = S3C2410_GPIO_OFFSET(pin);
struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
unsigned long offs = pin - chip->chip.base;
unsigned long flags;
unsigned long slpcon;

Expand All @@ -45,12 +47,12 @@ int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state)

local_irq_save(flags);

slpcon = __raw_readl(base + 0x0C);
slpcon = __raw_readl(chip->base + 0x0C);

slpcon &= ~(3 << offs);
slpcon |= state << offs;

__raw_writel(slpcon, base + 0x0C);
__raw_writel(slpcon, chip->base + 0x0C);

local_irq_restore(flags);

Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/arm/plat-s3c24xx/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

#include <mach/regs-gpio.h>

#include <plat/gpio-core.h>

/* gpiolib wrappers until these are totally eliminated */

void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)
Expand Down Expand Up @@ -68,10 +70,10 @@ EXPORT_SYMBOL(s3c2410_gpio_setpin);

unsigned int s3c2410_gpio_getpin(unsigned int pin)
{
void __iomem *base = S3C24XX_GPIO_BASE(pin);
unsigned long offs = S3C2410_GPIO_OFFSET(pin);
struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
unsigned long offs = pin - chip->chip.base;

return __raw_readl(base + 0x04) & (1<< offs);
return __raw_readl(chip->base + 0x04) & (1<< offs);
}

EXPORT_SYMBOL(s3c2410_gpio_getpin);
Expand Down

0 comments on commit 0f5ba07

Please sign in to comment.