diff options
Diffstat (limited to 'drivers/gpio/gpio-pch.c')
-rw-r--r-- | drivers/gpio/gpio-pch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index 9656c196772e..83a156397474 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c | |||
@@ -138,9 +138,6 @@ static int pch_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, | |||
138 | unsigned long flags; | 138 | unsigned long flags; |
139 | 139 | ||
140 | spin_lock_irqsave(&chip->spinlock, flags); | 140 | spin_lock_irqsave(&chip->spinlock, flags); |
141 | pm = ioread32(&chip->reg->pm) & ((1 << gpio_pins[chip->ioh]) - 1); | ||
142 | pm |= (1 << nr); | ||
143 | iowrite32(pm, &chip->reg->pm); | ||
144 | 141 | ||
145 | reg_val = ioread32(&chip->reg->po); | 142 | reg_val = ioread32(&chip->reg->po); |
146 | if (val) | 143 | if (val) |
@@ -148,6 +145,11 @@ static int pch_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, | |||
148 | else | 145 | else |
149 | reg_val &= ~(1 << nr); | 146 | reg_val &= ~(1 << nr); |
150 | iowrite32(reg_val, &chip->reg->po); | 147 | iowrite32(reg_val, &chip->reg->po); |
148 | |||
149 | pm = ioread32(&chip->reg->pm) & ((1 << gpio_pins[chip->ioh]) - 1); | ||
150 | pm |= (1 << nr); | ||
151 | iowrite32(pm, &chip->reg->pm); | ||
152 | |||
151 | spin_unlock_irqrestore(&chip->spinlock, flags); | 153 | spin_unlock_irqrestore(&chip->spinlock, flags); |
152 | 154 | ||
153 | return 0; | 155 | return 0; |