Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296935
b: refs/heads/master
c: 7fcca71
h: refs/heads/master
i:
  296933: bc38b2c
  296931: b60d4e6
  296927: de85766
v: v3
  • Loading branch information
Tarun Kanti DebBarma committed Mar 21, 2012
1 parent 98e541b commit fb778e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 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: 2a900eb74c123a21054836ab2c63d6ff46f854c6
refs/heads/master: 7fcca715de3438b8fc3c8a144702f3a95c8ff63c
18 changes: 7 additions & 11 deletions trunk/drivers/gpio/gpio-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,18 @@ static void _set_gpio_dataout_mask(struct gpio_bank *bank, int gpio, int enable)
bank->context.dataout = l;
}

static int _get_gpio_datain(struct gpio_bank *bank, int gpio)
static int _get_gpio_datain(struct gpio_bank *bank, int offset)
{
void __iomem *reg = bank->base + bank->regs->datain;

return (__raw_readl(reg) & GPIO_BIT(bank, gpio)) != 0;
return (__raw_readl(reg) & (1 << offset)) != 0;
}

static int _get_gpio_dataout(struct gpio_bank *bank, int gpio)
static int _get_gpio_dataout(struct gpio_bank *bank, int offset)
{
void __iomem *reg = bank->base + bank->regs->dataout;

return (__raw_readl(reg) & GPIO_BIT(bank, gpio)) != 0;
return (__raw_readl(reg) & (1 << offset)) != 0;
}

static inline void _gpio_rmw(void __iomem *base, u32 reg, u32 mask, bool set)
Expand Down Expand Up @@ -865,19 +865,15 @@ static int gpio_is_input(struct gpio_bank *bank, int mask)
static int gpio_get(struct gpio_chip *chip, unsigned offset)
{
struct gpio_bank *bank;
void __iomem *reg;
int gpio;
u32 mask;

gpio = chip->base + offset;
bank = container_of(chip, struct gpio_bank, chip);
reg = bank->base;
mask = GPIO_BIT(bank, gpio);
mask = (1 << offset);

if (gpio_is_input(bank, mask))
return _get_gpio_datain(bank, gpio);
return _get_gpio_datain(bank, offset);
else
return _get_gpio_dataout(bank, gpio);
return _get_gpio_dataout(bank, offset);
}

static int gpio_output(struct gpio_chip *chip, unsigned offset, int value)
Expand Down

0 comments on commit fb778e4

Please sign in to comment.