Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283634
b: refs/heads/master
c: e499ada
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Jan 9, 2012
1 parent b350d12 commit 3a2f86e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 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: f78a26f55b2438c439609fc90b473f7f08f5b697
refs/heads/master: e499ada829cf769ac6f16627cd9f09b855a7fd6d
22 changes: 10 additions & 12 deletions trunk/drivers/sh/pfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static void write_config_reg(struct pinmux_info *gpioc,
unsigned long field, unsigned long value)
{
void __iomem *mapped_reg;
unsigned long mask, pos;
unsigned long mask, pos, data;

config_reg_helper(gpioc, crp, field, &mapped_reg, &mask, &pos);

Expand All @@ -221,17 +221,15 @@ static void write_config_reg(struct pinmux_info *gpioc,
mask = ~(mask << pos);
value = value << pos;

switch (crp->reg_width) {
case 8:
iowrite8((ioread8(mapped_reg) & mask) | value, mapped_reg);
break;
case 16:
iowrite16((ioread16(mapped_reg) & mask) | value, mapped_reg);
break;
case 32:
iowrite32((ioread32(mapped_reg) & mask) | value, mapped_reg);
break;
}
data = gpio_read_raw_reg(mapped_reg, crp->reg_width);
data &= mask;
data |= value;

if (gpioc->unlock_reg)
gpio_write_raw_reg(pfc_phys_to_virt(gpioc, gpioc->unlock_reg),
32, ~data);

gpio_write_raw_reg(mapped_reg, crp->reg_width, data);
}

static int setup_data_reg(struct pinmux_info *gpioc, unsigned gpio)
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/sh_pfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ struct pinmux_info {
unsigned int num_resources;
struct pfc_window *window;

unsigned long unlock_reg;

struct gpio_chip chip;
};

Expand Down

0 comments on commit 3a2f86e

Please sign in to comment.