Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp181084pxu; Tue, 1 Dec 2020 08:45:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWzZI8DX/jeRYQDKKvNeKMjtJailRP3GfeOfGqNvUGlE06jA+c8obMANXT/Xfm+1ZPNw69 X-Received: by 2002:a50:875b:: with SMTP id 27mr3998120edv.24.1606841141617; Tue, 01 Dec 2020 08:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606841141; cv=none; d=google.com; s=arc-20160816; b=NbRxcQGrL9KsBUg9eP4kSt8dkDrHmSKmFCzSJz8xFz8DA3abK5D7OXhUlygucBjRMo zsuYyDX2OpUZY13swOdhJzL5o1sGARHonOxJBNYCEPLDjRm74b9vq90SvhJSAX5LdBQw TydLs1DnwJxqdRSqlfsJVMRJac+oL35KN3/+TmG7UarDoWqewDqQNAD/o13N1eywUxOI ttxoLDmKtzq0uP3rS1hOFQu+pUwZKVR9F0eTfC3RZwqrwY/dPVIUTpX4XQpk1VHglzFG H+xQL6sn/nlCzTRwyEGG9Q2JPUkuJjcnty6BsP56mycw+XEvCpZEh2LxTMqU/1diXD7j yF+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:mime-version :subject:dkim-signature; bh=F9OEZ/4wExuM13YosgjA9lOc+idfvAEF031dldFZwYs=; b=lQ5dYjylhL1OM6UbiQ5CC4PqvAT+d70uddTUBWs4lxFNtwNtaVFbVUeFmldppx742j j4T5n9AEE+s+un7rqAH2v9OpIrTKffLcBcAZ91IAYN2MNqGJx5TJV+ZwRdamC14Rpkjn eI04HiDKG0smquttyJDG4I1mlRHWju13FOuITcqJZjjJq1xZYGbBiH4tZ71Ve34HYkvb Tq3gOskmcRS7ElQzzTX5Y1eRJT30UXjXpqVEnMa+QJdtaGSF7ccrbjl4u2HJVqJ7msCa umDvuLuc3qu2bIh2gP0PcAxTvZOtNMJGMFsn8abrO18x9Tb1CZssxtRvD64+f7y8s4qQ PYKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=R9UBl7mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qp14si266364ejb.85.2020.12.01.08.45.17; Tue, 01 Dec 2020 08:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=R9UBl7mS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387664AbgLAQnT (ORCPT + 99 others); Tue, 1 Dec 2020 11:43:19 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.161]:22204 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgLAQnS (ORCPT ); Tue, 1 Dec 2020 11:43:18 -0500 X-Greylist: delayed 11185 seconds by postgrey-1.27 at vger.kernel.org; Tue, 01 Dec 2020 11:43:17 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1606840766; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=F9OEZ/4wExuM13YosgjA9lOc+idfvAEF031dldFZwYs=; b=R9UBl7mSOsonQBc8ZVGRntXI+2MbMtxJfRgl00JwUaQDTsG6Uke90dJ+YszMmzuQV2 fvQKHInxA5GBHv11c2RViodE48lAxJUcVMz9udcfUAQ7YxVCHCIh2y1MiAO50wsby8y3 t+ylecJo+f3VT0j2emo1M+Fyjmr8LThQ6E8IJENuwWYWphf2HR3snDrR0JvdteZb2/41 SOJpF+6BFxiBH3hurtwWIdax2+ir4LW3kUfFE/412rs3WALWC5yY5HTxlvlchHA1KFuL njBku8b0yfJPb/dO8CBALKBrGinB7SydS7qbtIaqcMjHSvFLJ4d3I6AlrsXhhT7aU5tZ 18eA== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj7wpz8NMGH/vrwDuo6A==" X-RZG-CLASS-ID: mo00 Received: from imac.fritz.box by smtp.strato.de (RZmta 47.3.4 DYNA|AUTH) with ESMTPSA id N02faawB1GdCVVd (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Tue, 1 Dec 2020 17:39:12 +0100 (CET) Subject: Re: [BUG] SPI broken for SPI based panel drivers Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=us-ascii From: "H. Nikolaus Schaller" In-Reply-To: Date: Tue, 1 Dec 2020 17:39:11 +0100 Cc: Linus Walleij , Mark Brown , kernel list , Laurent Pinchart , Discussions about the Letux Kernel Content-Transfer-Encoding: quoted-printable Message-Id: <9380CE00-9CE6-4E0B-B2E1-1B534F85E47D@goldelico.com> References: <2D7916FA-678F-4236-B478-C953CADF2FFA@goldelico.com> <4AC29229-9542-4E77-B993-217E29C7E209@goldelico.com> <20201201121620.GB5239@sirena.org.uk> <6283C16F-549C-4463-BC08-E2C1A1D78B2F@goldelico.com> To: Sven Van Asbroeck X-Mailer: Apple Mail (2.3124) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Am 01.12.2020 um 17:10 schrieb Sven Van Asbroeck = : >=20 > Nikolaus, >=20 > On Tue, Dec 1, 2020 at 9:38 AM H. Nikolaus Schaller = wrote: >>=20 >> Let's work on a fix for the fix now. >>=20 >=20 > Are you quite sure the chip-select of the tpo,td028ttec1 panel > is active-high? A quick google produced a datasheet which > seems to indicate that XCS is active-low? >=20 > See page 17 here: > http://www.lcd-source.com/datasheet/TPO/TD028TTEC1.pdf >=20 > It is of course possible that you are driving that line behind > some inverting circuitry. Hardware designers seem to do that > all the time, if they need to go from one voltage domain to > the other, etc. You are right. It is active low. But that is the start of a long story... It was introduced in DT by c2e138bc8ed80ae with cs-gpios =3D <&gpio1 19 0>; because the third parameter did not have any meaning back then, AFAIR. It was ignored and drivers did initialize gpios with inversion if needed. Missing spi-cs-high; did define active low back then for spi-gpio. In 3a637e008e542b8ebdc2ceed616b229af0462b14 the "0" was replaced by the constant=20 cs-gpios =3D <&gpio1 19 GPIO_ACTIVE_HIGH>; keeping the DTB unchanged and compatible. This did work because there was still no spi-cs-high; Then came 6953c57ab172 which mixed cs-gpios and spi-cs-high; and made use of the now wrong GPIO_ACTIVE_HIGH; A special logic converted GPIO_ACTIVE_HIGH to GPIO_ACTIVE_LOW in case of spi-cs-high; being present. A long discussion revealed that the only solution to stay compatible with old and new DT/kernels was to add spi-cs-high; and keep the wrong <&gpio1 19 GPIO_ACTIVE_HIGH>; f1f028ff89cb0d3 did "fix" this by adding spi-cs-high to the DT. Please note that apparently we were already confused about what the right value should be (ACTIVE_HIGH or ACTIVE_LOW) in 2019 but the result was working until your new patch appeared. Yes, it could be that the problem introduced by 6953c57ab172 is just coming up again with your new change. On the other hand I remember from the old discussion that changing a DT is "forbidden" if it is not upwards compatible with earlier kernels. The driver must take what it gets from (legacy) DT. BR, Nikolaus