| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/arch/arm/mach-sa1100/gpio.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Generic SA-1100 GPIO handling |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | #include <linux/gpio/driver.h> |
|---|
| 11 | 8 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 56 | 53 | { |
|---|
| 57 | 54 | void __iomem *gpdr = sa1100_gpio_chip(chip)->membase + R_GPDR; |
|---|
| 58 | 55 | |
|---|
| 59 | | - return !(readl_relaxed(gpdr) & BIT(offset)); |
|---|
| 56 | + if (readl_relaxed(gpdr) & BIT(offset)) |
|---|
| 57 | + return GPIO_LINE_DIRECTION_OUT; |
|---|
| 58 | + |
|---|
| 59 | + return GPIO_LINE_DIRECTION_IN; |
|---|
| 60 | 60 | } |
|---|
| 61 | 61 | |
|---|
| 62 | 62 | static int sa1100_direction_input(struct gpio_chip *chip, unsigned offset) |
|---|