From patchwork Mon Feb 11 16:28:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Renner X-Patchwork-Id: 2124911 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork1.kernel.org (Postfix) with ESMTP id 71D883FCA4 for ; Mon, 11 Feb 2013 16:28:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1U4wEl-0006I9-Fe; Mon, 11 Feb 2013 16:28:11 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1U4wEj-0006Hz-Hp for spi-devel-general@lists.sourceforge.net; Mon, 11 Feb 2013 16:28:09 +0000 X-ACL-Warn: Received: from moutng.kundenserver.de ([212.227.126.171]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1U4wEi-0002l0-25 for spi-devel-general@lists.sourceforge.net; Mon, 11 Feb 2013 16:28:09 +0000 Received: from [192.168.0.18] (dslb-178-004-235-003.pools.arcor-ip.net [178.4.235.3]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MOAIW-1U1cJR3gto-005rqT; Mon, 11 Feb 2013 17:28:01 +0100 Message-ID: <51191C11.9070607@efe-gmbh.de> Date: Mon, 11 Feb 2013 17:28:01 +0100 From: "Jens Renner (EFE)" Organization: EFE GmbH User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: spi-devel-general@lists.sourceforge.net Subject: [PATCH] spi: spi-xilinx: Use DT information for bits_per_word value X-Enigmail-Version: 1.5 X-Provags-ID: V02:K0:JG2ryyn4F3iUvALsK19m/qhJaxuaEtJnen5ddft+47/ RSEaIR16l7ZRQYUhLy0JqNGzMR3QQhALSCnkxgSjtwhm5sO7YP B7k5HCCyfii5hRRrPVvT1w0CDYDye0A4+qfKhh0ogFLBT7SNO3 6F5g3OZd6oNNgUlwNET5mdD43pg7ZWzdl9KYuUDv7sDo/yzeBK BCCgeWjzPh2wO6T3/H14Cw9Q9sJ8an0LQ0vJO9mbJtM88xXZij AfPDcg7qL484OwJecsGCDTw+ngT3y5szYCcQTCYXHAvd2BQQwk k5+xW3FtL0q2UiqMCNk56fp3wBcp6J/RcPGw7uZ1Fa10OCwaHj kdEfBJhWxykyF8sD1v8g= X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.171 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 3.0 TBIRD_SPOOF Claims Thunderbird mail client but looks suspicious X-Headers-End: 1U4wEi-0002l0-25 X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net From: Jens Renner This patch overrides the default value of bits_per_word with the actual value of "xlnx,num-transfer-bits" from the DTS file to allow for 16 and 32 bit word lengths. Signed-off-by: Jens Renner --- ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index e1d7696..03abdfa 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -487,6 +487,12 @@ static int xilinx_spi_probe(struct platform_device *dev) &len); if (prop && len >= sizeof(*prop)) num_cs = __be32_to_cpup(prop); + + /* override default number of bits per word */ + prop = of_get_property(dev->dev.of_node, + "xlnx,num-transfer-bits", &len); + if (prop && len >= sizeof(*prop)) + bits_per_word = __be32_to_cpup(prop); } #endif