diff options
-rw-r--r-- | arch/mips/rb532/gpio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c index e35cb75a3ae7..f5b15a17432f 100644 --- a/arch/mips/rb532/gpio.c +++ b/arch/mips/rb532/gpio.c | |||
@@ -169,8 +169,8 @@ static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | |||
169 | 169 | ||
170 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 170 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
171 | 171 | ||
172 | if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC)) | 172 | /* disable alternate function in case it's set */ |
173 | return 1; /* alternate function, GPIOCFG is ignored */ | 173 | rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC); |
174 | 174 | ||
175 | rb532_set_bit(0, offset, gpch->regbase + GPIOCFG); | 175 | rb532_set_bit(0, offset, gpch->regbase + GPIOCFG); |
176 | return 0; | 176 | return 0; |
@@ -186,8 +186,8 @@ static int rb532_gpio_direction_output(struct gpio_chip *chip, | |||
186 | 186 | ||
187 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 187 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
188 | 188 | ||
189 | if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC)) | 189 | /* disable alternate function in case it's set */ |
190 | return 1; /* alternate function, GPIOCFG is ignored */ | 190 | rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC); |
191 | 191 | ||
192 | /* set the initial output value */ | 192 | /* set the initial output value */ |
193 | rb532_set_bit(value, offset, gpch->regbase + GPIOD); | 193 | rb532_set_bit(value, offset, gpch->regbase + GPIOD); |