From patchwork Sun Mar 31 10:07:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 10878699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0435A139A for ; Sun, 31 Mar 2019 10:07:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD46B286D6 for ; Sun, 31 Mar 2019 10:07:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D095528924; Sun, 31 Mar 2019 10:07:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D13D286D6 for ; Sun, 31 Mar 2019 10:07:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726772AbfCaKHk (ORCPT ); Sun, 31 Mar 2019 06:07:40 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.50]:23531 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726750AbfCaKHk (ORCPT ); Sun, 31 Mar 2019 06:07:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1554026858; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=WWZalGAHQUHeT7WX3zQ1/dfR05CU96A7kCwVlJkXlOg=; b=sPNKZFI+fcu2wxb7oWmZn6XMkFF8fWxcyIdxNLosRYVxAOmbJcxtNk8TSXzUfNOwdw Lx6AjMrRFe+oRIT1YixkcHxvMEOtrpyIF+CrJ7EvjjkbkSaHgg7HrzZoUAcYgYP9p1zL qZV94G+O/cUl21dOKCj9F1XcJ7TPEls2gpAlSbAm5GKMunF1o1qWLGNsy322FjIxJMQE 1K+XiYgTlZsVnm7CkIkN9IHzeBtkgXwL5zMR/LLcxHKqIx5N1Kl3VrCHGys0rZTjo6fp 0FJC/pq3WLMkWG/s9gO8mjNGqTrWaqhTbTTBq0ja+kdkf9QrC3MNJJXpU6HsmqrDVnyd RRtg== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UNf2AyPQjXtNgX" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 44.18 DYNA|AUTH) with ESMTPSA id K07648v2VA7OX1n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 31 Mar 2019 12:07:24 +0200 (CEST) From: "H. Nikolaus Schaller" To: =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Linus Walleij , Bartosz Golaszewski Cc: linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, letux-kernel@openphoenux.org, "H. Nikolaus Schaller" Subject: [BUG/PATCH 1/4] DTS: GTA04: SPI / gpiolib: work around a regression that unhides a broken legacy handler, which makes the gta04 display inoperable Date: Sun, 31 Mar 2019 12:07:20 +0200 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is an ugly workaround for a regression introduced into v5.1-rc1 by The GTA04 board uses a bitbanged SPI interface to control the LCD and it did work right from the introduction of the cs-gpios 5 years ago by but unexpectedly stopped with v5.1-rc1. Since we already use the gpio-flags for high level CS, we did not add spi-cs-high, which is listed in the bindings documentation as optional and indicative and not described as required to make it work. And it worked without this flag until now. Now the newly introduced patch to gpiolib-of.c removes a bug which prevented an ugly legacy handler for of SPI active high chip select to run. This now suddenly requires spi-cs-high to be defined in addition to the gpio flags. Trying to find a workaround in DTS shows that there seems to be another bug in the legacy handler code in gpiolib-of.c because it checks for the spi-cs-high flag not in the individual slave node (as one could expect from bindings documentation) but the spi controller node. Unfortunately it requires us to add legacy flags to a DTS to make the workaround code functioning. I would prefer that the workaround code and the spi-cs-high property is completely removed from gpiolib-of.c and all DTS which still use legacy gpio flags are fixed. fgrep spi-cs-high arch/*/boot/dts/*.dts* shows only a handful of board candidates. Signed-off-by: H. Nikolaus Schaller --- arch/arm/boot/dts/omap3-gta04.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi index 04f2b53d4d3d..1e134dfab428 100644 --- a/arch/arm/boot/dts/omap3-gta04.dtsi +++ b/arch/arm/boot/dts/omap3-gta04.dtsi @@ -114,6 +114,7 @@ gpio-miso = <&gpio1 18 GPIO_ACTIVE_HIGH>; gpio-mosi = <&gpio1 20 GPIO_ACTIVE_HIGH>; cs-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + spi-cs-high; /* make the legacy handler in gpiolib not intervene */ num-chipselects = <1>; /* lcd panel */ @@ -123,6 +124,7 @@ spi-max-frequency = <100000>; spi-cpol; spi-cpha; + spi-cs-high; /* here is where it should be but this is ignored by a bug in the gpiolib handler */ backlight= <&backlight>; label = "lcd"; From patchwork Sun Mar 31 10:07:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 10878703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3809E139A for ; Sun, 31 Mar 2019 10:08:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23655286D6 for ; Sun, 31 Mar 2019 10:08:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1725828924; Sun, 31 Mar 2019 10:08:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B454C286D6 for ; Sun, 31 Mar 2019 10:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbfCaKHo (ORCPT ); Sun, 31 Mar 2019 06:07:44 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.168]:13632 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727024AbfCaKHo (ORCPT ); Sun, 31 Mar 2019 06:07:44 -0400 X-Greylist: delayed 50207 seconds by postgrey-1.27 at vger.kernel.org; Sun, 31 Mar 2019 06:07:43 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1554026859; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=n9Y1lkgt7qHuD9W5cjttkRD2gn2A1tRKU+WvyQtEdto=; b=bFeGQLpy3rFxy5hckLBlJYUzwdpnhiUmlXt7W10D4Jd9snZvJv58N56FvbSW1i7phl jmsdq7MT4GEjAkhajNsWT9Skobc0N57TKIP2AlSUBJQaY9wFKUPfB/Crwp+Aj1vdUn2O qN+nmFHrkOOYhmXV4N7YxvO4Ra/NW732hgb078mj17wyWiWmVGhnyGGSGVZaon0Fbl+k LeXKg4quV8ocIb/3ndqNBbRwSxxt46BOmGRYzCaIuxuBla3e3OY6rrlGt/qAxF6g4HbR EUWPMUPKQo73BIiyGGgxfb/FI3utGRM0b7ngoy9Y5u+tWVYM0ZVkHcB3qJ9eCIGxhScU B46A== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UNf2AyPQjXtNgX" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 44.18 DYNA|AUTH) with ESMTPSA id K07648v2VA7PX1o (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 31 Mar 2019 12:07:25 +0200 (CEST) From: "H. Nikolaus Schaller" To: =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Linus Walleij , Bartosz Golaszewski Cc: linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, letux-kernel@openphoenux.org, "H. Nikolaus Schaller" Subject: [BUG/PATCH 2/4] REVERT: DTS: GTA04: SPI / gpiolib: no no no, we do not want to "fix" our device tree file Date: Sun, 31 Mar 2019 12:07:21 +0200 Message-Id: <6b09a3a40bba24179d5f3620cd2ca2840f1654dd.1554026842.git.hns@goldelico.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP just because some legacy boards seem to require changes in the gpio-lib which make our so far correct DTS/DTB being wrongly interpreted. A better solution seems to make the legacy handler optional so that DTS/DTB developed without legacy modes are not harmed. Signed-off-by: H. Nikolaus Schaller --- arch/arm/boot/dts/omap3-gta04.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi index 1e134dfab428..04f2b53d4d3d 100644 --- a/arch/arm/boot/dts/omap3-gta04.dtsi +++ b/arch/arm/boot/dts/omap3-gta04.dtsi @@ -114,7 +114,6 @@ gpio-miso = <&gpio1 18 GPIO_ACTIVE_HIGH>; gpio-mosi = <&gpio1 20 GPIO_ACTIVE_HIGH>; cs-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; - spi-cs-high; /* make the legacy handler in gpiolib not intervene */ num-chipselects = <1>; /* lcd panel */ @@ -124,7 +123,6 @@ spi-max-frequency = <100000>; spi-cpol; spi-cpha; - spi-cs-high; /* here is where it should be but this is ignored by a bug in the gpiolib handler */ backlight= <&backlight>; label = "lcd"; From patchwork Sun Mar 31 10:07:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 10878707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA6D217E1 for ; Sun, 31 Mar 2019 10:09:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4EF52855A for ; Sun, 31 Mar 2019 10:09:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C80182858E; Sun, 31 Mar 2019 10:09:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 770222855A for ; Sun, 31 Mar 2019 10:09:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbfCaKJb (ORCPT ); Sun, 31 Mar 2019 06:09:31 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.81]:17955 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726756AbfCaKHo (ORCPT ); Sun, 31 Mar 2019 06:07:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1554026859; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=AccDNfcwa/WgjJCtRZ3qvk/xAv4V+exLGFsGCMWL7zM=; b=jzwGLMyVKn8hPSNuYWgdOr+Cue33NGs7SpvLlye+asTrlSk2URaCtPvku82Uu/hXsp Gr5mui9NCeMmHUQLO0/zlLKmKt4VkEV36ywolz60FoOeyA5uHuMcTG64FcTYATEWnhhs 1lEwTW/Qfg0BAO7fDvdLdUkr9MNYSP1tPK6EJ7ciVIK0IWNBrGwtYE2RidzwTa13s+4M hj0YIiYtUi9h2HWsXJ1mbtJMERJS/D1/URhYuS3mVYw0Ge9UHb4O60P808nI9vNgt2aB qoRV7bBgbMKw77d1MT+dRkb0uqQjwYaYG442oa6KZrMZHXDvyWg06PIoNFwSoG+zybQy dFoA== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UNf2AyPQjXtNgX" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 44.18 DYNA|AUTH) with ESMTPSA id K07648v2VA7PX1p (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 31 Mar 2019 12:07:25 +0200 (CEST) From: "H. Nikolaus Schaller" To: =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Linus Walleij , Bartosz Golaszewski Cc: linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, letux-kernel@openphoenux.org, "H. Nikolaus Schaller" Subject: [BUG/PATCH 3/4] gpiolib: make legacy handling for spi-cs-high optional Date: Sun, 31 Mar 2019 12:07:22 +0200 Message-Id: <83b5c3ddee26c6f5e4b3b21d8a4346da5956de11.1554026842.git.hns@goldelico.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpio/Kconfig | 8 ++++++++ drivers/gpio/gpiolib-of.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 3f50526a771f..1a82619727c1 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -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 diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 8b9c3ab70f6e..a22d2233458b 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -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 } /** From patchwork Sun Mar 31 10:07:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 10878701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F610139A for ; Sun, 31 Mar 2019 10:08:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17CBE286D6 for ; Sun, 31 Mar 2019 10:08:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0891628924; Sun, 31 Mar 2019 10:08:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD33F286D6 for ; Sun, 31 Mar 2019 10:08:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731086AbfCaKHt (ORCPT ); Sun, 31 Mar 2019 06:07:49 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.84]:35699 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbfCaKHo (ORCPT ); Sun, 31 Mar 2019 06:07:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1554026860; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=WxZnJkYr+RpcZujgOEbS+hE99NSDvAcFrNV8O6sUCf4=; b=RhwG9Dn7a7nnN6St8SjMRncOUFHGPuxFv2IS9nBJ45B6hudE62tZxz2ceHT/6shRT0 g0/ODe2lXe8/wKhP2tkHAZKA6g/eO65lkena/IkSpgnWJqhR6y/1j81hfHsmYJKiEbnd xjshhA3+MCm1M9bDuRgr2BUNvWqArXBpTwhA3F82serOeHhFf2qEUdeVdJOlQFoAevEK qa7fYj4/mstXzYL7Sec2+CNPpcNak5iXUsheY4f9/ObRYeRaUFKhQRCV1Ed2zf0zN5mY 2i+0itphEe0RfFO113T1OvoHiH9txxq1qc/7pJ07WNNWbLaXUz0pakwY5T7sBMgqQZEB F8Zw== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UNf2AyPQjXtNgX" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 44.18 DYNA|AUTH) with ESMTPSA id K07648v2VA7PX1q (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 31 Mar 2019 12:07:25 +0200 (CEST) From: "H. Nikolaus Schaller" To: =?utf-8?q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Linus Walleij , Bartosz Golaszewski Cc: linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, letux-kernel@openphoenux.org, "H. Nikolaus Schaller" Subject: [BUG/PATCH 4/4] gpiolib: spi-cs-high is checking the wrong node (the controller and not the SPI slave device) Date: Sun, 31 Mar 2019 12:07:23 +0200 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Bindings say: All slave nodes can contain the following optional properties: - spi-cs-high - Empty property indicating device requires chip select active high. Signed-off-by: H. Nikolaus Schaller --- drivers/gpio/gpiolib-of.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index a22d2233458b..82e7a1f63b0a 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -143,16 +143,16 @@ static void of_gpio_flags_quirks(struct device_node *np, * conflict and the "spi-cs-high" flag will * take precedence. */ - if (of_property_read_bool(np, "spi-cs-high")) { + if (of_property_read_bool(child, "spi-cs-high")) { if (*flags & OF_GPIO_ACTIVE_LOW) { pr_warn("%s GPIO handle specifies active low - ignored\n", - of_node_full_name(np)); + of_node_full_name(child)); *flags &= ~OF_GPIO_ACTIVE_LOW; } } else { if (!(*flags & OF_GPIO_ACTIVE_LOW)) pr_info("%s enforce active low on chipselect handle\n", - of_node_full_name(np)); + of_node_full_name(child)); *flags |= OF_GPIO_ACTIVE_LOW; } break;