hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/gpio/gpio-sch311x.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * GPIO driver for the SMSC SCH311x Super-I/O chips
34 *
....@@ -5,11 +6,6 @@
56 *
67 * SuperIO functions and chip detection:
78 * (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.
139 */
1410
1511 #include <linux/ioport.h>
....@@ -188,7 +184,7 @@
188184 struct sch311x_gpio_block *block = gpiochip_get_data(chip);
189185
190186 spin_lock(&block->lock);
191
- __sch311x_gpio_set(block, offset, value);
187
+ __sch311x_gpio_set(block, offset, value);
192188 spin_unlock(&block->lock);
193189 }
194190
....@@ -232,7 +228,10 @@
232228 data = inb(block->runtime_reg + block->config_regs[offset]);
233229 spin_unlock(&block->lock);
234230
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;
236235 }
237236
238237 static int sch311x_gpio_set_config(struct gpio_chip *chip, unsigned offset,