@@ -39,6 +39,14 @@ config OF_GPIO
depends on OF
depends on HAS_IOMEM
+config SPI_CS_HIGH_LEGACY_HANDLING
+ def_bool n
+ depends on OF_GPIO
+ help
+ This enables a legacy handler which decodes the boolean spi-cs-high
+ property found in some DTS/DTB to correctly work with cs-gpios
+ with GPIO_ACTIVE_HIGH.
+
config GPIO_ACPI
def_bool y
depends on ACPI
@@ -114,6 +114,7 @@ static void of_gpio_flags_quirks(struct device_node *np,
of_node_full_name(np));
}
+#if defined(CONFIG_SPI_CS_HIGH_LEGACY_HANDLING)
/*
* Legacy handling of SPI active high chip select. If we have a
* property named "cs-gpios" we need to inspect the child node
@@ -158,6 +159,7 @@ static void of_gpio_flags_quirks(struct device_node *np,
}
}
}
+#endif
}
/**
It is better to make legacy support a config option instead of requiring non-legacy device tree files to be updated. Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> --- drivers/gpio/Kconfig | 8 ++++++++ drivers/gpio/gpiolib-of.c | 2 ++ 2 files changed, 10 insertions(+)