hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/gpio/gpio-kempld.c
....@@ -1,17 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Kontron PLD GPIO driver
34 *
45 * Copyright (c) 2010-2013 Kontron Europe GmbH
56 * Author: Michael Brunner <michael.brunner@kontron.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License 2 as published
9
- * by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
157 */
168
179 #include <linux/init.h>
....@@ -112,7 +104,10 @@
112104 struct kempld_gpio_data *gpio = gpiochip_get_data(chip);
113105 struct kempld_device_data *pld = gpio->pld;
114106
115
- return !kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
107
+ if (kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset))
108
+ return GPIO_LINE_DIRECTION_OUT;
109
+
110
+ return GPIO_LINE_DIRECTION_IN;
116111 }
117112
118113 static int kempld_gpio_pincount(struct kempld_device_data *pld)