linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Balaji T K <balajitk@ti.com>
To: linux-mmc@vger.kernel.org, cjb@laptop.org, tony@atomide.com
Cc: linux-omap@vger.kernel.org, Balaji T K <balajitk@ti.com>
Subject: [PATCH 4/5] mmc: omap_hsmmc: correct max value of clkd
Date: Mon, 21 Oct 2013 00:25:21 +0530	[thread overview]
Message-ID: <1382295322-18995-4-git-send-email-balajitk@ti.com> (raw)
In-Reply-To: <1382295322-18995-1-git-send-email-balajitk@ti.com>

clock divisor can take a max value of 1023.
Update code so that card init can be handled at f_min even at
higher IP clock frequencies from which clock to the card is
derived.

Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 9f74a57..60db34d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -75,6 +75,7 @@
 #define ICE			0x1
 #define ICS			0x2
 #define CEN			(1 << 2)
+#define CLKD_MAX		0x3FF		/* max clock divisor: 1023 */
 #define CLKD_MASK		0x0000FFC0
 #define CLKD_SHIFT		6
 #define DTO_MASK		0x000F0000
@@ -497,8 +498,8 @@ static u16 calc_divisor(struct omap_hsmmc_host *host, struct mmc_ios *ios)
 
 	if (ios->clock) {
 		dsor = DIV_ROUND_UP(clk_get_rate(host->fclk), ios->clock);
-		if (dsor > 250)
-			dsor = 250;
+		if (dsor > CLKD_MAX)
+			dsor = CLKD_MAX;
 	}
 
 	return dsor;
-- 
1.7.5.4


  parent reply	other threads:[~2013-10-20 18:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-20 18:55 [PATCH 1/5] mmc: omap_hsmmc: Fix pbias_disable for omap4 Balaji T K
2013-10-20 18:55 ` [PATCH 2/5] mmc: omap_hsmmc: context save and restore for DT Balaji T K
2013-10-20 18:55 ` [PATCH 3/5] mmc: omap_hsmmc: fix timeout for cmd and data soft reset Balaji T K
2013-10-20 18:55 ` Balaji T K [this message]
2013-10-20 18:55 ` [PATCH 5/5] mmc: omap_hsmmc: remove unused no_off Balaji T K
2013-10-27  1:30 ` [PATCH 1/5] mmc: omap_hsmmc: Fix pbias_disable for omap4 Chris Ball

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382295322-18995-4-git-send-email-balajitk@ti.com \
    --to=balajitk@ti.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).