From patchwork Wed Aug 7 15:20:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 2840354 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E6411BF535 for ; Wed, 7 Aug 2013 15:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC08320395 for ; Wed, 7 Aug 2013 15:22:16 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1710201EA for ; Wed, 7 Aug 2013 15:22:11 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V75Yw-0002jM-1r; Wed, 07 Aug 2013 15:22:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V75Yt-0003KU-S5; Wed, 07 Aug 2013 15:22:07 +0000 Received: from pegase1.c-s.fr ([93.17.236.30] helo=mailhub1.si.c-s.fr) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V75Yq-0003Jm-K4 for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2013 15:22:06 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id A01B31C858E; Wed, 7 Aug 2013 17:21:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from mailhub1.si.c-s.fr ([192.168.12.234]) by localhost (mailhub1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NEC0NQ55Jtc7; Wed, 7 Aug 2013 17:21:40 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 80ECE1C857E; Wed, 7 Aug 2013 17:21:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6593BC7392; Wed, 7 Aug 2013 17:21:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ZPbluSndLDUQ; Wed, 7 Aug 2013 17:21:40 +0200 (CEST) Received: from [172.25.231.7] (unknown [172.25.231.7]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 17EF2C7391; Wed, 7 Aug 2013 17:21:40 +0200 (CEST) Message-ID: <520265B2.3080403@c-s.fr> Date: Wed, 07 Aug 2013 17:20:18 +0200 From: leroy christophe User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Roland Stigge Subject: Re: MAX7301 GPIO: Do not force SPI speed when using OF Platform References: <51EFAA19.4020905@antcom.de> <52022FFF.3060507@c-s.fr> <52023AE2.3020007@antcom.de> <52023EF9.3050301@c-s.fr> <5202418B.5090203@antcom.de> In-Reply-To: <5202418B.5090203@antcom.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130807_112204_844685_78BD42DB X-CRM114-Status: GOOD ( 10.98 ) X-Spam-Score: -1.9 (-) Cc: patrick.vasseur@c-s.fr, Linus Walleij , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, Le 07/08/2013 14:46, Roland Stigge a écrit : > Hi, > > On 08/07/2013 02:35 PM, leroy christophe wrote: >>>> spi-bits = <16>; >>> I tried this, both in the device's and in the controller's node. But it >>> didn't work. However, as described, I didn't expect it to work, because >>> there is no code present to handle "spi-bits". At least not in 3.10. >>> >>> Am I missing something? Otherwise, maybe something of the tree that you >>> are talking about is missing from mainline still? >>> >>> >> Strange. I'm using 3.8.13 >> I have it handled in drivers/spi/spi.c in function >> of_register_spi_devices() > 3.8.13's (as well as newer ones') drivers/spi/spi.c doesn't handle > "spi-bits", see also > > https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/spi/spi.c?h=linux-3.8.y > > Maybe you have additional patches that are not in mainline, yet? > > Thanks, > > Roland > Yes you are right, I have the attached patch in addition which have been in our code for long time and which has never been submitted for inclusion in the mainline kernel. Sorry about that, I will submit it. Regards Christophe --- linux-3.8.13/drivers/spi/spi.c 2013-05-11 22:57:46.000000000 +0200 +++ linux/drivers/spi/spi.c 2013-08-06 18:15:34.000000000 +0200 @@ -870,6 +870,11 @@ if (of_find_property(nc, "spi-3wire", NULL)) spi->mode |= SPI_3WIRE; + /* Bits per word */ + prop = of_get_property(nc, "spi-bits", &len); + if (prop && len >= sizeof(*prop)) { + spi->bits_per_word = prop[0]; + } /* Device speed */ prop = of_get_property(nc, "spi-max-frequency", &len); if (!prop || len < sizeof(*prop)) {