Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198518
b: refs/heads/master
c: 6a39954
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks committed May 20, 2010
1 parent b533e93 commit 5605759
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 1ae35de1c1ac81f8f31879316656b0a66616a4b0
refs/heads/master: 6a399547242df3b12f13d637a95f63eaa82f9385
15 changes: 15 additions & 0 deletions trunk/arch/arm/mach-s5p6440/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ static int s5p6440_gpiolib_rbank_4bit2_input(struct gpio_chip *chip,
void __iomem *base = ourchip->base;
void __iomem *regcon = base;
unsigned long con;
unsigned long flags;

switch (offset) {
case 6:
Expand All @@ -63,10 +64,14 @@ static int s5p6440_gpiolib_rbank_4bit2_input(struct gpio_chip *chip,
break;
}

s3c_gpio_lock(ourchip, flags);

con = __raw_readl(regcon);
con &= ~(0xf << con_4bit_shift(offset));
__raw_writel(con, regcon);

s3c_gpio_unlock(ourchip, flags);

return 0;
}

Expand All @@ -78,6 +83,7 @@ static int s5p6440_gpiolib_rbank_4bit2_output(struct gpio_chip *chip,
void __iomem *regcon = base;
unsigned long con;
unsigned long dat;
unsigned long flags;
unsigned con_offset = offset;

switch (con_offset) {
Expand All @@ -96,6 +102,8 @@ static int s5p6440_gpiolib_rbank_4bit2_output(struct gpio_chip *chip,
break;
}

s3c_gpio_lock(ourchip, flags);

con = __raw_readl(regcon);
con &= ~(0xf << con_4bit_shift(con_offset));
con |= 0x1 << con_4bit_shift(con_offset);
Expand All @@ -109,6 +117,8 @@ static int s5p6440_gpiolib_rbank_4bit2_output(struct gpio_chip *chip,
__raw_writel(con, regcon);
__raw_writel(dat, base + GPIODAT_OFF);

s3c_gpio_unlock(ourchip, flags);

return 0;
}

Expand All @@ -117,6 +127,7 @@ int s5p6440_gpio_setcfg_4bit_rbank(struct s3c_gpio_chip *chip,
{
void __iomem *reg = chip->base;
unsigned int shift;
unsigned long flags;
u32 con;

switch (off) {
Expand All @@ -142,11 +153,15 @@ int s5p6440_gpio_setcfg_4bit_rbank(struct s3c_gpio_chip *chip,
cfg <<= shift;
}

s3c_gpio_lock(chip, flags);

con = __raw_readl(reg);
con &= ~(0xf << shift);
con |= cfg;
__raw_writel(con, reg);

s3c_gpio_unlock(chip, flags);

return 0;
}

Expand Down

0 comments on commit 5605759

Please sign in to comment.