| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Kontron PLD GPIO driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2010-2013 Kontron Europe GmbH |
|---|
| 5 | 6 | * 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. |
|---|
| 15 | 7 | */ |
|---|
| 16 | 8 | |
|---|
| 17 | 9 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 112 | 104 | struct kempld_gpio_data *gpio = gpiochip_get_data(chip); |
|---|
| 113 | 105 | struct kempld_device_data *pld = gpio->pld; |
|---|
| 114 | 106 | |
|---|
| 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; |
|---|
| 116 | 111 | } |
|---|
| 117 | 112 | |
|---|
| 118 | 113 | static int kempld_gpio_pincount(struct kempld_device_data *pld) |
|---|