hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/gpio/gpio-sa1100.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-sa1100/gpio.c
34 *
45 * 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.
96 */
107 #include <linux/gpio/driver.h>
118 #include <linux/init.h>
....@@ -56,7 +53,10 @@
5653 {
5754 void __iomem *gpdr = sa1100_gpio_chip(chip)->membase + R_GPDR;
5855
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;
6060 }
6161
6262 static int sa1100_direction_input(struct gpio_chip *chip, unsigned offset)