From ba3ebd86ed0ab76508831ccaecb9dc063d298b5a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 12 Dec 2019 10:32:10 +0100 Subject: [PATCH] drop gpio patch from 4.19 --- ...se-mmc-specific-cd-and-wp-properties.patch | 122 ------------------ queue-4.19/series | 1 - 2 files changed, 123 deletions(-) delete mode 100644 queue-4.19/gpio-of-parse-mmc-specific-cd-and-wp-properties.patch diff --git a/queue-4.19/gpio-of-parse-mmc-specific-cd-and-wp-properties.patch b/queue-4.19/gpio-of-parse-mmc-specific-cd-and-wp-properties.patch deleted file mode 100644 index f632403f619..00000000000 --- a/queue-4.19/gpio-of-parse-mmc-specific-cd-and-wp-properties.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 1843ae54ce037708d78ed76c152d9644a0cd228c Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 26 Nov 2018 14:51:23 +0100 -Subject: gpio: OF: Parse MMC-specific CD and WP properties - -From: Linus Walleij - -[ Upstream commit 81c85ec15a1946f2e347ec0bf66936121eb97ce7 ] - -When retrieveing CD (card detect) and WP (write protect) -GPIO handles from the device tree, make sure to assign -them active low by default unless the "cd-inverted" or -"wp-inverted" properties are set. These properties mean -that respective signal is active HIGH since the SDHCI -specification stipulates that this kind of signals -should be treated as active LOW. - -If the twocell GPIO flag is also specified as active -low, well that's nice and we will silently ignore the -tautological specification. - -If however the GPIO line is specified as active low -in the GPIO flasg cell and "cd-inverted" or "wp-inverted" -is also specified, the latter takes precedence and we -print a warning. - -The current effect on the MMC slot-gpio core are as -follows: - -For CD GPIOs: no effect. The current code in -mmc/core/host.c calls mmc_gpiod_request_cd() with -the "override_active_level" argument set to true, -which means that whatever the GPIO descriptor -thinks about active low/high will be ignored, the -core will use the MMC_CAP2_CD_ACTIVE_HIGH to keep -track of this and reads the raw value from the -GPIO descriptor, totally bypassing gpiolibs inversion -semantics. I plan to clean this up at a later point -passing the handling of inversion semantics over -to gpiolib, so this patch prepares the ground for -that. - -Fow WP GPIOs: this is probably fixing a bug, because -the code in mmc/core/host.c calls mmc_gpiod_request_ro() -with the "override_active_level" argument set to false, -which means it will respect the inversion semantics of -the gpiolib and ignore the MMC_CAP2_RO_ACTIVE_HIGH -flag for everyone using this through device tree. -However the code in host.c confusingly goes to great -lengths setting up the MMC_CAP2_RO_ACTIVE_HIGH flag -from the GPIO descriptor and by reading the "wp-inverted" -property of the node. As far as I can tell this is all -in vain and the inversion is broken: device trees that -use "wp-inverted" do not work as intended, instead the -only way to actually get inversion on a line is by -setting the second cell flag to GPIO_ACTIVE_HIGH (which -will be the default) or GPIO_ACTIVE_LOW if they want -the proper MMC semantics. Presumably all device trees do -this right but we need to parse and handle this properly. - -Cc: linux-mmc@vger.kernel.org -Cc: linux-gpio@vger.kernel.org -Cc: Bartosz Golaszewski -Signed-off-by: Linus Walleij -Signed-off-by: Sasha Levin ---- - drivers/gpio/gpiolib-of.c | 39 +++++++++++++++++++++++++++++++++++++++ - 1 file changed, 39 insertions(+) - -diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c -index e0f149bdf98ff..1147ad968fd75 100644 ---- a/drivers/gpio/gpiolib-of.c -+++ b/drivers/gpio/gpiolib-of.c -@@ -60,6 +60,45 @@ static struct gpio_desc *of_xlate_and_get_gpiod_flags(struct gpio_chip *chip, - static void of_gpio_flags_quirks(struct device_node *np, - enum of_gpio_flags *flags) - { -+ /* -+ * Handle MMC "cd-inverted" and "wp-inverted" semantics. -+ */ -+ if (IS_ENABLED(CONFIG_MMC)) { -+ if (of_property_read_bool(np, "cd-gpios")) { -+ if (of_property_read_bool(np, "cd-inverted")) { -+ if (*flags & OF_GPIO_ACTIVE_LOW) { -+ /* "cd-inverted" takes precedence */ -+ *flags &= ~OF_GPIO_ACTIVE_LOW; -+ pr_warn("%s GPIO handle specifies CD active low - ignored\n", -+ of_node_full_name(np)); -+ } -+ } else { -+ /* -+ * Active low is the default according to the -+ * SDHCI specification. If the GPIO handle -+ * specifies the same thing - good. -+ */ -+ *flags |= OF_GPIO_ACTIVE_LOW; -+ } -+ } -+ if (of_property_read_bool(np, "wp-gpios")) { -+ if (of_property_read_bool(np, "wp-inverted")) { -+ /* "wp-inverted" takes precedence */ -+ if (*flags & OF_GPIO_ACTIVE_LOW) { -+ *flags &= ~OF_GPIO_ACTIVE_LOW; -+ pr_warn("%s GPIO handle specifies WP active low - ignored\n", -+ of_node_full_name(np)); -+ } -+ } else { -+ /* -+ * Active low is the default according to the -+ * SDHCI specification. If the GPIO handle -+ * specifies the same thing - good. -+ */ -+ *flags |= OF_GPIO_ACTIVE_LOW; -+ } -+ } -+ } - /* - * Some GPIO fixed regulator quirks. - * Note that active low is the default. --- -2.20.1 - diff --git a/queue-4.19/series b/queue-4.19/series index be708a0c1ce..503e48689bb 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -134,7 +134,6 @@ bpf-btf-implement-btf_name_valid_identifier.patch bpf-btf-check-name-validity-for-various-types.patch tools-bpftool-fix-a-bitfield-pretty-print-issue.patch asoc-au8540-use-64-bit-arithmetic-instead-of-32-bit.patch -gpio-of-parse-mmc-specific-cd-and-wp-properties.patch arm-omap1-2-fix-soc-name-printing.patch arm64-dts-meson-gxl-libretech-cc-fix-gpio-lines-name.patch arm64-dts-meson-gxbb-nanopi-k2-fix-gpio-lines-names.patch -- 2.47.3