From patchwork Tue Aug 9 16:23:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Parsons X-Patchwork-Id: 1050222 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p79GOCvS003879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 9 Aug 2011 16:24:33 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qqp61-0002LO-Qa; Tue, 09 Aug 2011 16:24:02 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qqp61-00037c-5T; Tue, 09 Aug 2011 16:24:01 +0000 Received: from relay.ptn-ipout01.plus.net ([212.159.7.35]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qqp5h-000346-PW for linux-arm-kernel@lists.infradead.org; Tue, 09 Aug 2011 16:23:42 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8lALteQU5UXebj/2dsb2JhbABCgh2CbJJmNY8ad4FuUnE1GBOHb615AodTiS0OhjgEmA6DLoE4hnw Received: from outmx01.plus.net ([84.93.230.227]) by relay.ptn-ipout01.plus.net with ESMTP; 09 Aug 2011 17:23:30 +0100 Received: from [87.115.3.65] (helo=paul) by outmx01.plus.net with esmtp (Exim) id 1Qqp5V-0000FE-DF; Tue, 09 Aug 2011 17:23:29 +0100 Subject: [PATCH] pxa/hx4700: Set DS1WM clock_rate From: "Paul Parsons" To: Date: Tue, 09 Aug 2011 16:23:27 +0000 Mime-Version: 1.0 X-Mailer: email v2.5.0 (Linux 2.6.39 x86_64 [http://email.cleancode.org]) Message-Id: X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110809_122342_106324_14F69DA0 X-CRM114-Status: GOOD ( 15.02 ) X-Spam-Score: 1.5 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.159.7.35 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lost.distance[at]yahoo.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 1.0 FORGED_YAHOO_RCVD 'From' yahoo.com does not match 'Received' headers 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: koen@dominion.thruhere.net, eric.y.miao@gmail.com, philipp.zabel@gmail.com, mad_soft@inbox.ru X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 09 Aug 2011 16:24:33 +0000 (UTC) The mfd/asic3 driver did not set the ds1wm_driver_data.clock_rate field before passing the structure to the ds1wm cell driver. By chance, ds1wm_find_divisor() returned the correct divisor when this zero clock_rate was passed in. However a recent change to ds1wm_find_divisor() removed this unintended behaviour. This patch explicitly sets the ds1wm_driver_data.clock_rate field. Signed-off-by: Paul Parsons diff -uprN clean-3.0.1/arch/arm/mach-pxa/hx4700.c linux-3.0.1/arch/arm/mach-pxa/hx4700.c --- clean-3.0.1/arch/arm/mach-pxa/hx4700.c 2011-08-05 05:59:21.000000000 +0100 +++ linux-3.0.1/arch/arm/mach-pxa/hx4700.c 2011-08-07 23:02:18.653447085 +0100 @@ -310,6 +310,7 @@ static struct asic3_platform_data asic3_ .gpio_config_num = ARRAY_SIZE(asic3_gpio_config), .irq_base = IRQ_BOARD_START, .gpio_base = HX4700_ASIC3_GPIO_BASE, + .clock_rate = 4000000, }; static struct platform_device asic3 = { diff -uprN clean-3.0.1/drivers/mfd/asic3.c linux-3.0.1/drivers/mfd/asic3.c --- clean-3.0.1/drivers/mfd/asic3.c 2011-08-05 05:59:21.000000000 +0100 +++ linux-3.0.1/drivers/mfd/asic3.c 2011-08-07 23:02:18.653447085 +0100 @@ -867,10 +867,13 @@ static int __init asic3_mfd_probe(struct asic3_mmc_resources[0].start >>= asic->bus_shift; asic3_mmc_resources[0].end >>= asic->bus_shift; - ret = mfd_add_devices(&pdev->dev, pdev->id, + if (pdata->clock_rate) { + ds1wm_pdata.clock_rate = pdata->clock_rate; + ret = mfd_add_devices(&pdev->dev, pdev->id, &asic3_cell_ds1wm, 1, mem, asic->irq_base); - if (ret < 0) - goto out; + if (ret < 0) + goto out; + } if (mem_sdio && (irq >= 0)) { ret = mfd_add_devices(&pdev->dev, pdev->id, diff -uprN clean-3.0.1/include/linux/mfd/asic3.h linux-3.0.1/include/linux/mfd/asic3.h --- clean-3.0.1/include/linux/mfd/asic3.h 2011-08-05 05:59:21.000000000 +0100 +++ linux-3.0.1/include/linux/mfd/asic3.h 2011-08-07 23:02:18.653447085 +0100 @@ -31,6 +31,8 @@ struct asic3_platform_data { unsigned int gpio_base; + unsigned int clock_rate; + struct asic3_led *leds; };