hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/gpio/gpio-exar.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * GPIO driver for Exar XR17V35X chip
34 *
45 * 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.
96 */
107 #include <linux/bitops.h>
118 #include <linux/device.h>
....@@ -80,7 +77,10 @@
8077 EXAR_OFFSET_MPIOSEL_HI : EXAR_OFFSET_MPIOSEL_LO;
8178 unsigned int bit = (offset + exar_gpio->first_pin) % 8;
8279
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;
8484 }
8585
8686 static int exar_get_value(struct gpio_chip *chip, unsigned int offset)