From patchwork Fri Oct 1 03:03:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 222432 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9139jKG021272 for ; Fri, 1 Oct 2010 03:10:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752598Ab0JADKR (ORCPT ); Thu, 30 Sep 2010 23:10:17 -0400 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]:56970 "HELO na3sys009aog111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751542Ab0JADKR convert rfc822-to-8bit (ORCPT ); Thu, 30 Sep 2010 23:10:17 -0400 Received: from source ([65.219.4.130]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKTKVRGJhFus0pZUhrw/+C22hDdJJy+WI7@postini.com; Thu, 30 Sep 2010 20:10:17 PDT Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Thu, 30 Sep 2010 20:03:16 -0700 From: Philip Rakity To: "linux-mmc@vger.kernel.org" Date: Thu, 30 Sep 2010 20:03:14 -0700 Subject: [PATCH] sdhci: adjust sd 3.0 host controller spec clock divider Thread-Topic: [PATCH] sdhci: adjust sd 3.0 host controller spec clock divider Thread-Index: ActhFTEuuJ0LwB0VQbOxALm7kW/ahQ== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Oct 2010 03:10:18 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 96c7f60..73a94fe 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1003,14 +1003,12 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) goto out; if (host->version >= SDHCI_SPEC_300) { - /* Version 3.00 divisors must be a multiple of 2. */ if (host->max_clk <= clock) div = 1; else { - for (div = 2; div < SDHCI_MAX_DIV_SPEC_300; div += 2) { - if ((host->max_clk / div) <= clock) - break; - } + div = host->max_clk/clock; + if (host->max_clk % clock) + div++; } } else { /* Version 2.00 divisors must be a power of 2. */