Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10457070ybi; Wed, 24 Jul 2019 23:35:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhoznJJwLsVPIj5GVyrZtBI/ynJApBwt6hNGJilk3Am6F6vIDcF+tsIUBTEyz2/VZVywtd X-Received: by 2002:a17:902:e20c:: with SMTP id ce12mr92407301plb.130.1564036525536; Wed, 24 Jul 2019 23:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564036525; cv=none; d=google.com; s=arc-20160816; b=fUDdsyymyfu9JxjdKE6QZmjQLo0ATiGG3dQj2p9CLbOBZgKFknEDfqXebrGM40KZON Uo6dTVtofW/9+AUBmXEFmH8kDNiqMTCx4qt2Laep5PoGMuL+wP15hCu5PclcUtaRjqOm 4iMwUSkQ7ovk1gECJRWbgr4UrUHHNqtPHo10gg4jYe7WFIWwac4ZrpTYiUkAsOUxibiR TQ6alo0FSbEYYZy9oIKTubV5kAo9wx/W6k+htLwUMgNTTJk7m4rNLdiQY3YdXVSucwPy HRXjMVYy9OfPrFMGlZR65rGvMX5Hv0SwDcFs7R+RkuMkTBaXaQav2tvyeqGyy+gPAh+u 6oLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=MA157R7B1YjDlv3TGVme83JNkT3dM1NdR6lxMLM44Co=; b=M5vXxgkLxcnJGMfglywJLiPdYDqMuNxvU39yLFHW4qm64GevBtG4r26w++8YrYezNx 8J3fXk3S6aH3fHIO1MlVy+30g4tqRq9d1c3+8z4nmrbXgCywUvkHUt1f4/qMOoQJZsD/ +mQX3Jc3gwL7lcAro83ZtbXYfeq6fe23YZZXw7EXJ+UmLzuyE5+aT6Thryu2qiUnjSBX U3+8LTuA/Gow+HUcAEC93Z9+gqPdt30GUFeoU5IRICXNy0NQbL3e1YDH3hIXFnuBtFfi gFXoxoUvhFqa6bd6JxBmNL1jcnsDM4Uo3N090+4Sx8aBXwxYQIhFZiPc0uGzjT3auCI9 p8DQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j66si14623953plb.375.2019.07.24.23.35.11; Wed, 24 Jul 2019 23:35:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387438AbfGYGXt (ORCPT + 99 others); Thu, 25 Jul 2019 02:23:49 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.166]:24799 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbfGYGXs (ORCPT ); Thu, 25 Jul 2019 02:23:48 -0400 X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBp5hRw/qOxWRk4dCzwp5iD+2s6bqei8mNpEiGupa/KJG1vh7ft13w=" X-RZG-CLASS-ID: mo00 Received: from [IPv6:2001:16b8:26ed:3500:85cc:8b56:536:d1f1] by smtp.strato.de (RZmta 44.24 AUTH) with ESMTPSA id j00b6dv6P6NhX0K (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Thu, 25 Jul 2019 08:23:43 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH 2/2] DTS: ARM: gta04: introduce legacy spi-cs-high to make display work again From: "H. Nikolaus Schaller" In-Reply-To: <20190724194259.GA25847@bogus> Date: Thu, 25 Jul 2019 08:23:49 +0200 Cc: Mark Brown , Mark Rutland , =?utf-8?Q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Discussions about the Letux Kernel , linux-spi , devicetree , Linux Kernel Mailing List , Linux-OMAP , stable Content-Transfer-Encoding: 7bit Message-Id: <2EA06398-E45B-481B-9A26-4DD2E043BF9C@goldelico.com> References: <8ae7cf816b22ef9cecee0d789fcf9e8a06495c39.1562597164.git.hns@goldelico.com> <20190724194259.GA25847@bogus> To: Rob Herring , Linus Walleij X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, > Am 24.07.2019 um 21:42 schrieb Rob Herring : > > On Mon, Jul 08, 2019 at 04:46:05PM +0200, H. Nikolaus Schaller wrote: >> commit 6953c57ab172 "gpio: of: Handle SPI chipselect legacy bindings" >> >> did introduce logic to centrally handle the legacy spi-cs-high property >> in combination with cs-gpios. This assumes that the polarity >> of the CS has to be inverted if spi-cs-high is missing, even >> and especially if non-legacy GPIO_ACTIVE_HIGH is specified. >> >> The DTS for the GTA04 was orginally introduced under the assumption >> that there is no need for spi-cs-high if the gpio is defined with >> proper polarity GPIO_ACTIVE_HIGH. > > Given that spi-cs-high is called legacy, that would imply that DT's > should not have to use spi-cs-high. Yes. > >> This was not a problem until gpiolib changed the interpretation of >> GPIO_ACTIVE_HIGH and missing spi-cs-high. > > Then we should fix gpiolib... I tried to convince Linus that this is the right way but he convinced me that a fix that handles all cases does not exist. There seem to be embedded devices with older DTB (potentially in ROM) which provide a plain 0 value for a gpios definition. And either with or without spi-cs-high. Since "0" is the same as "GPIO_ACTIVE_HIGH", the absence of spi-cs-high was and must be interpreted as active low for these devices. This leads to the inversion logic in code. AFAIR it boils down to the question if gpiolib and the bindings should still support such legacy devices with out-of tree DTB, but force in-tree DTS to add the legacy spi-cs-high property. Or if we should fix the 2 or 3 cases of in-tree legacy cases and potentially break out-of tree DTBs. IMHO it is more general to keep the out-of-tree DTBs working and "fix" what we can control (in-tree DTS). > >> The effect is that the missing spi-cs-high is now interpreted as CS being >> low (despite GPIO_ACTIVE_HIGH) which turns off the SPI interface when the >> panel is to be programmed by the panel driver. >> >> Therefore, we have to add the redundant and legacy spi-cs-high property >> to properly pass through the legacy handler. >> >> Since this is nowhere documented in the bindings, we add some words of >> WARNING. >> >> Cc: stable@vger.kernel.org >> Signed-off-by: H. Nikolaus Schaller >> --- >> Documentation/devicetree/bindings/spi/spi-bus.txt | 6 ++++++ >> arch/arm/boot/dts/omap3-gta04.dtsi | 1 + >> 2 files changed, 7 insertions(+) BR, Nikolaus