aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch
diff options
context:
space:
mode:
authorStijn Segers <foss@volatilesystems.org>2018-06-05 23:29:31 +0200
committerJohn Crispin <john@phrozen.org>2018-06-07 09:03:24 +0200
commit1199a91095269969ba5256702359fba97c6ada08 (patch)
treeb53399707c15dfc52d354a1e2757e3c81940fe79 /target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch
parent6f8eb1b50fd8549524de3be3c540fe917b102393 (diff)
downloadupstream-1199a91095269969ba5256702359fba97c6ada08.tar.gz
upstream-1199a91095269969ba5256702359fba97c6ada08.tar.bz2
upstream-1199a91095269969ba5256702359fba97c6ada08.zip
kernel: bump 4.14 to 4.14.48 for 18.06
Refreshed patches. The following patches were upstreamed and have been deleted: * target/linux/lantiq/patches-4.14/0025-MIPS-lantiq-gphy-Remove-reboot-remove-reset-asserts.patch * target/linux/generic/pending-4.14/101-clocksource-mips-gic-timer-fix-clocksource-counter-w.patch * target/linux/generic/pending-4.14/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch * target/linux/generic/pending-4.14/181-net-usb-add-lte-modem-wistron-neweb-d18q1.patch Compile-tested: ramips/mt7621, x86/64 Run-tested: ramips/mt7621 Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Diffstat (limited to 'target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch')
-rw-r--r--target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch50
1 files changed, 25 insertions, 25 deletions
diff --git a/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch b/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch
index 992c240d62..026816d2e8 100644
--- a/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch
+++ b/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch
@@ -19,12 +19,12 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
#include <linux/gpio/machine.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
-
+
#include "gpiolib.h"
-
+
@@ -506,3 +508,69 @@ void of_gpiochip_remove(struct gpio_chip
- gpiochip_remove_pin_ranges(chip);
- of_node_put(chip->of_node);
+ gpiochip_remove_pin_ranges(chip);
+ of_node_put(chip->of_node);
}
+
+static struct of_device_id gpio_export_ids[] = {
@@ -101,20 +101,20 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
-int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
+int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name)
{
- struct gpio_chip *chip;
- struct gpio_device *gdev;
+ struct gpio_chip *chip;
+ struct gpio_device *gdev;
@@ -615,6 +615,8 @@ int gpiod_export(struct gpio_desc *desc,
- offset = gpio_chip_hwgpio(desc);
- if (chip->names && chip->names[offset])
- ioname = chip->names[offset];
+ offset = gpio_chip_hwgpio(desc);
+ if (chip->names && chip->names[offset])
+ ioname = chip->names[offset];
+ if (name)
+ ioname = name;
-
- dev = device_create_with_groups(&gpio_class, &gdev->dev,
- MKDEV(0, 0), data, gpio_groups,
+
+ dev = device_create_with_groups(&gpio_class, &gdev->dev,
+ MKDEV(0, 0), data, gpio_groups,
@@ -636,6 +638,12 @@ err_unlock:
- gpiod_dbg(desc, "%s: status %d\n", __func__, status);
- return status;
+ gpiod_dbg(desc, "%s: status %d\n", __func__, status);
+ return status;
}
+EXPORT_SYMBOL_GPL(__gpiod_export);
+
@@ -123,14 +123,14 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ return __gpiod_export(desc, direction_may_change, NULL);
+}
EXPORT_SYMBOL_GPL(gpiod_export);
-
+
static int match_export(struct device *dev, const void *desc)
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -127,6 +127,12 @@ static inline int gpio_export(unsigned g
- return gpiod_export(gpio_to_desc(gpio), direction_may_change);
+ return gpiod_export(gpio_to_desc(gpio), direction_may_change);
}
-
+
+int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name);
+static inline int gpio_export_with_name(unsigned gpio, bool direction_may_change, const char *name)
+{
@@ -138,22 +138,22 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+}
+
static inline int gpio_export_link(struct device *dev, const char *name,
- unsigned gpio)
+ unsigned gpio)
{
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
-@@ -451,6 +451,7 @@ static inline struct gpio_desc *devm_get
-
+@@ -451,6 +451,7 @@ struct gpio_desc *devm_fwnode_get_gpiod_
+
#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
-
+
+int _gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name);
int gpiod_export(struct gpio_desc *desc, bool direction_may_change);
int gpiod_export_link(struct device *dev, const char *name,
- struct gpio_desc *desc);
+ struct gpio_desc *desc);
@@ -458,6 +459,13 @@ void gpiod_unexport(struct gpio_desc *de
-
+
#else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */
-
+
+static inline int _gpiod_export(struct gpio_desc *desc,
+ bool direction_may_change,
+ const char *name)
@@ -162,5 +162,5 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+}
+
static inline int gpiod_export(struct gpio_desc *desc,
- bool direction_may_change)
+ bool direction_may_change)
{