| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * GPIO driver for the SMSC SCH311x Super-I/O chips |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * SuperIO functions and chip detection: |
|---|
| 7 | 8 | * (c) Copyright 2008 Wim Van Sebroeck <wim@iguana.be>. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (at your option) any later version. |
|---|
| 13 | 9 | */ |
|---|
| 14 | 10 | |
|---|
| 15 | 11 | #include <linux/ioport.h> |
|---|
| .. | .. |
|---|
| 188 | 184 | struct sch311x_gpio_block *block = gpiochip_get_data(chip); |
|---|
| 189 | 185 | |
|---|
| 190 | 186 | spin_lock(&block->lock); |
|---|
| 191 | | - __sch311x_gpio_set(block, offset, value); |
|---|
| 187 | + __sch311x_gpio_set(block, offset, value); |
|---|
| 192 | 188 | spin_unlock(&block->lock); |
|---|
| 193 | 189 | } |
|---|
| 194 | 190 | |
|---|
| .. | .. |
|---|
| 232 | 228 | data = inb(block->runtime_reg + block->config_regs[offset]); |
|---|
| 233 | 229 | spin_unlock(&block->lock); |
|---|
| 234 | 230 | |
|---|
| 235 | | - return !!(data & SCH311X_GPIO_CONF_DIR); |
|---|
| 231 | + if (data & SCH311X_GPIO_CONF_DIR) |
|---|
| 232 | + return GPIO_LINE_DIRECTION_IN; |
|---|
| 233 | + |
|---|
| 234 | + return GPIO_LINE_DIRECTION_OUT; |
|---|
| 236 | 235 | } |
|---|
| 237 | 236 | |
|---|
| 238 | 237 | static int sch311x_gpio_set_config(struct gpio_chip *chip, unsigned offset, |
|---|