From patchwork Mon Feb 15 16:23:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ernst Schwab X-Patchwork-Id: 79426 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1FGNILm025004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 15 Feb 2010 16:23:55 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nh3jB-0002V8-SG; Mon, 15 Feb 2010 16:23:17 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nh3jA-0002Ur-KH for spi-devel-general@lists.sourceforge.net; Mon, 15 Feb 2010 16:23:16 +0000 X-ACL-Warn: Received: from moutng.kundenserver.de ([212.227.126.171]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1Nh3j9-0003cl-9E; Mon, 15 Feb 2010 16:23:16 +0000 Received: from ip065 (koln-5d810ccd.pool.mediaWays.net [93.129.12.205]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M2pyk-1O0NEF0NtO-00sTgE; Mon, 15 Feb 2010 17:23:05 +0100 Date: Mon, 15 Feb 2010 17:23:04 +0100 From: Ernst Schwab To: spi-devel-general@lists.sourceforge.net Message-Id: <20100215172304.66663326.eschwab@online.de> X-Mailer: Sylpheed 3.0.0beta8 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 X-Provags-ID: V01U2FsdGVkX19/+o2X0o4s9xhNnOrqMIbPiTdWzqoX2JgRdHW SmLi55qsLjwM8F/kCtYQUNMGjaxOpVDDTPzZsUfKcMbY7Mxev4 hU2j7g1BTuVJ3+8VMvxm6UFHNzjP6PY X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Headers-End: 1Nh3j9-0003cl-9E Cc: dbrownell@users.sourceforge.net Subject: [spi-devel-general] [PATCH] spi: Correct SPI clock frequency setting in spi_mpc8xxx 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 15 Feb 2010 16:23:55 +0000 (UTC) diff -up linux-2.6.33-rc8.orig/drivers/spi/spi_mpc8xxx.c linux-2.6.33-rc8/drivers/spi/spi_mpc8xxx.c --- linux-2.6.33-rc8.orig/drivers/spi/spi_mpc8xxx.c 2010-02-12 20:07:45.000000000 +0100 +++ linux-2.6.33-rc8/drivers/spi/spi_mpc8xxx.c 2010-02-15 14:08:33.000000000 +0100 @@ -365,7 +365,7 @@ int mpc8xxx_spi_setup_transfer(struct sp if ((mpc8xxx_spi->spibrg / hz) > 64) { cs->hw_mode |= SPMODE_DIV16; - pm = mpc8xxx_spi->spibrg / (hz * 64); + pm = (mpc8xxx_spi->spibrg - 1) / (hz * 64) + 1; WARN_ONCE(pm > 16, "%s: Requested speed is too low: %d Hz. " "Will use %d Hz instead.\n", dev_name(&spi->dev), @@ -373,7 +373,7 @@ int mpc8xxx_spi_setup_transfer(struct sp if (pm > 16) pm = 16; } else - pm = mpc8xxx_spi->spibrg / (hz * 4); + pm = (mpc8xxx_spi->spibrg - 1) / (hz * 4) + 1; if (pm) pm--;