diff options
author | merge <null@invalid> | 2008-12-05 09:59:34 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-12-05 09:59:34 +0000 |
commit | 361fff778b7c4d2c78f28833415335148d86a1aa (patch) | |
tree | e616c940a691b9ff548b1aaeb747eae8a1342509 /drivers/mfd/pcf50633-gpio.c | |
parent | 5adc83c203167f77dd9b975ee275e3014287d6c7 (diff) |
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-build-fix-path-to-toolchain-on-1228470136
pending-tracking-hist top was MERGE-via-stable-tracking-build-fix-path-to-toolchain-on-1228470136 / 21b67ab8e79998b0a534263282dab1dda0f11b00 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-build-fix-path-to-toolchain-on
stable-tracking-hist top was build-fix-path-to-toolchain-on / ca14ba894df9b28822066c578dde48d7dbe931de ... parent commitmessage:
From: Andy Green <andy@openmoko.com>
build-fix-path-to-toolchain-one-at-last.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/mfd/pcf50633-gpio.c')
-rw-r--r-- | drivers/mfd/pcf50633-gpio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/mfd/pcf50633-gpio.c b/drivers/mfd/pcf50633-gpio.c index a7117fa6282..55139071d22 100644 --- a/drivers/mfd/pcf50633-gpio.c +++ b/drivers/mfd/pcf50633-gpio.c @@ -42,7 +42,7 @@ int pcf50633_gpio_get(struct pcf50633 *pcf, int gpio) u8 reg, val; reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG; - val = pcf50633_reg_read(pcf, reg); + val = pcf50633_reg_read(pcf, reg) & 0x07; return val; } @@ -55,7 +55,7 @@ void pcf50633_gpio_invert_set(struct pcf50633 *pcf, int gpio, int invert) reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG; val = !!invert << 3; - pcf50633_reg_set_bit_mask(pcf, reg, val, val); + pcf50633_reg_set_bit_mask(pcf, reg, 1 << 3, val); } EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_set); @@ -87,13 +87,14 @@ static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = { void pcf50633_gpio_power_supply_set(struct pcf50633 *pcf, int gpio, int regulator, int on) { - u8 reg, val; + u8 reg, val, mask; /* the *ENA register is always one after the *OUT register */ reg = pcf50633_regulator_registers[regulator] + 1; val = (!!on << (gpio - PCF50633_GPIO1)); + mask = (1 << (gpio - PCF50633_GPIO1)); - pcf50633_reg_set_bit_mask(pcf, reg, val, val); + pcf50633_reg_set_bit_mask(pcf, reg, mask, val); } EXPORT_SYMBOL_GPL(pcf50633_gpio_power_supply_set); |