.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * GPIO driver for Exar XR17V35X chip |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2015 Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> |
---|
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/bitops.h> |
---|
11 | 8 | #include <linux/device.h> |
---|
.. | .. |
---|
80 | 77 | EXAR_OFFSET_MPIOSEL_HI : EXAR_OFFSET_MPIOSEL_LO; |
---|
81 | 78 | unsigned int bit = (offset + exar_gpio->first_pin) % 8; |
---|
82 | 79 | |
---|
83 | | - return !!(exar_get(chip, addr) & BIT(bit)); |
---|
| 80 | + if (exar_get(chip, addr) & BIT(bit)) |
---|
| 81 | + return GPIO_LINE_DIRECTION_IN; |
---|
| 82 | + |
---|
| 83 | + return GPIO_LINE_DIRECTION_OUT; |
---|
84 | 84 | } |
---|
85 | 85 | |
---|
86 | 86 | static int exar_get_value(struct gpio_chip *chip, unsigned int offset) |
---|